From d6b99a9fe52d7c3e224cb96e7348d6c52c57e454 Mon Sep 17 00:00:00 2001 From: dingo Date: Sat, 4 Apr 2026 12:16:39 -0400 Subject: [PATCH] Add anonymous /health endpoint for k8s probes (SOR.Admin) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without it, liveness/readiness probe requests hit the fallback auth policy, trigger an OIDC challenge, fail with 500, and restart the pod in a loop — which is the root cause of the repeated auth instability. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude Co-Authored-By: Happy --- Server/src/SOR.Admin/Program.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Server/src/SOR.Admin/Program.cs b/Server/src/SOR.Admin/Program.cs index e1f78f7..de4f3e9 100644 --- a/Server/src/SOR.Admin/Program.cs +++ b/Server/src/SOR.Admin/Program.cs @@ -192,6 +192,12 @@ app.UseAuthentication(); app.UseAuthorization(); app.UseAntiforgery(); +// ── Health check ─────────────────────────────────────────────────────────── +// Must be AllowAnonymous — k8s liveness/readiness probes hit this before any +// session exists. Without it the fallback policy triggers an OIDC challenge, +// which fails and returns 500, causing the probe to kill the pod in a loop. +app.MapGet("/health", () => Results.Ok()).AllowAnonymous(); + // ── Auth endpoints ───────────────────────────────────────────────────────── // Challenge: cookie auth redirects here when a request is unauthenticated.