I hereby claim:
- I am zbartl on github.
- I am zbartl (https://keybase.io/zbartl) on keybase.
- I have a public key whose fingerprint is 72AC C158 9B5D F9C4 2D8E 0748 23DF C192 DB7F 8740
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
public class TestServerFixture | |
{ | |
... | |
public TestServerFixture() | |
{ | |
var builder = new WebHostBuilder() | |
.UseStartup(typeof(TestServerStartup)); | |
... | |
} | |
} |
[Fact] | |
public async Task Should_be_able_to_see_secret() | |
{ | |
var data = new Dictionary<string, string>() | |
{ | |
{ "email", "test@gmail.com" }, | |
{ "secret", "shh!" } | |
}; | |
var secretContent = new FormUrlEncodedContent(data); |
public class Startup | |
{ | |
... | |
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) | |
{ | |
... | |
app.UseIdentity(); |
public class AuthenticatedTestRequestMiddleware | |
{ | |
public const string TestingCookieAuthentication = "TestCookieAuthentication"; | |
public const string TestingHeader = "X-Integration-Testing"; | |
public const string TestingHeaderValue = "abcde-12345"; | |
private readonly RequestDelegate _next; | |
public AuthenticatedTestRequestMiddleware(RequestDelegate next) | |
{ |
public class TestServerFixture | |
{ | |
public TestServer Server { get; private set; } | |
public HttpClient Client { get; private set; } | |
public TestServerFixture() | |
{ | |
var builder = new WebHostBuilder() | |
.UseStartup(typeof(Startup)); |
[Fact] | |
public async Task Should_be_able_to_see_secret() | |
{ | |
var data = new Dictionary<string, string>() | |
{ | |
{ "email", "test@gmail.com" }, | |
{ "secret", "shh!" } | |
}; | |
var secretContent = new FormUrlEncodedContent(data); |
[HttpPost] | |
[Authorize("Client")] | |
[Route("secret-thing")] | |
public async Task<IActionResult> SecretAction(SecretThing.Command command) | |
{ | |
command.LoginId = _userManager.GetUserId(User); | |
await _mediator.Send(command); | |
return RedirectToAction("Classified"); | |
} |