Compare commits
3 Commits
db6f140858
...
43cd57a158
Author | SHA1 | Date | |
---|---|---|---|
43cd57a158 | |||
63a5ce9947 | |||
a3b1904923 |
@ -14,7 +14,11 @@ steps:
|
|||||||
- latest
|
- latest
|
||||||
trigger:
|
trigger:
|
||||||
branch:
|
branch:
|
||||||
|
include:
|
||||||
- master
|
- master
|
||||||
|
event:
|
||||||
|
exclude:
|
||||||
|
- pull_request
|
||||||
|
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
|
@ -13,6 +13,13 @@ public class ApiKeyAuthAuthentication
|
|||||||
|
|
||||||
public async Task InvokeAsync(HttpContext context)
|
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))
|
if (!context.Request.Headers.TryGetValue(HeaderApiKey, out var extractedApiKey))
|
||||||
{
|
{
|
||||||
context.Response.StatusCode = 401;
|
context.Response.StatusCode = 401;
|
||||||
|
Loading…
Reference in New Issue
Block a user