Compare commits

...

3 Commits

Author SHA1 Message Date
jtom38 43cd57a158 Merge pull request 'You can access /health without a api key now.' (#3) from features/health-no-auth into master
continuous-integration/drone/push Build is passing Details
Reviewed-on: #3
2023-06-13 21:39:57 -07:00
James Tombleson 63a5ce9947 attempting to not build docker on pr
continuous-integration/drone/pr Build is passing Details
2023-06-13 21:37:32 -07:00
James Tombleson a3b1904923 You can access /health without a api key now.
continuous-integration/drone/pr Build is passing Details
2023-06-13 21:32:49 -07:00
2 changed files with 12 additions and 1 deletions

View File

@ -14,7 +14,11 @@ steps:
- latest
trigger:
branch:
- master
include:
- master
event:
exclude:
- pull_request
---
kind: pipeline

View File

@ -13,6 +13,13 @@ public class ApiKeyAuthAuthentication
public async Task InvokeAsync(HttpContext context)
{
// allow access to /health without auth
if (context.Request.Path == "/health")
{
await _next(context);
return;
}
if (!context.Request.Headers.TryGetValue(HeaderApiKey, out var extractedApiKey))
{
context.Response.StatusCode = 401;