From a3b19049235e201ecdc49521b7750e9be0a32f47 Mon Sep 17 00:00:00 2001 From: James Tombleson Date: Tue, 13 Jun 2023 21:32:49 -0700 Subject: [PATCH 1/2] You can access /health without a api key now. --- Newsbot.Collector.Api/Middleware/ApiKeyAuthentication.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Newsbot.Collector.Api/Middleware/ApiKeyAuthentication.cs b/Newsbot.Collector.Api/Middleware/ApiKeyAuthentication.cs index 9837003..59afbb2 100644 --- a/Newsbot.Collector.Api/Middleware/ApiKeyAuthentication.cs +++ b/Newsbot.Collector.Api/Middleware/ApiKeyAuthentication.cs @@ -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; -- 2.40.1 From 63a5ce9947a335d33e21eb4a45b544a79338cbbb Mon Sep 17 00:00:00 2001 From: James Tombleson Date: Tue, 13 Jun 2023 21:37:32 -0700 Subject: [PATCH 2/2] attempting to not build docker on pr --- .drone.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 53131e0..bff520d 100644 --- a/.drone.yml +++ b/.drone.yml @@ -14,7 +14,11 @@ steps: - latest trigger: branch: - - master + include: + - master + event: + exclude: + - pull_request --- kind: pipeline -- 2.40.1