Add anonymous /health endpoint for k8s probes (SOR.Admin)
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 <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
@@ -192,6 +192,12 @@ app.UseAuthentication();
|
|||||||
app.UseAuthorization();
|
app.UseAuthorization();
|
||||||
app.UseAntiforgery();
|
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 ─────────────────────────────────────────────────────────
|
// ── Auth endpoints ─────────────────────────────────────────────────────────
|
||||||
|
|
||||||
// Challenge: cookie auth redirects here when a request is unauthenticated.
|
// Challenge: cookie auth redirects here when a request is unauthenticated.
|
||||||
|
|||||||
Reference in New Issue
Block a user