fix(auth): add /api/readyz to auth bypass list (GRO-2692) #238
Reference in New Issue
Block a user
Delete Branch "fix/gro-2692-readyz-auth-bypass"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
UAT regression (GRO-2692) found that
GET /api/readyzreturns 401 instead of the expected 200/503 because the endpoint was not included inauthMiddleware's bypass list.Root cause:
app.basePath("/api")+api.use("*", authMiddleware)applies to all/api/*paths regardless of route registration order (Hono basePath middleware bypass). Public routes must be explicitly listed in theauthMiddlewarebypass condition.Fix: Add
|| c.req.path === "/api/readyz"to the bypass check insrc/middleware/auth.ts, alongside the existing/api/healthbypass.Changed files
src/middleware/auth.ts— one-line addition to public route bypass listUAT Playbook
No UAT_PLAYBOOK.md change needed — §4.0 TC-API-0.2 and TC-API-0.3 already cover this endpoint correctly; the fix makes the endpoint accessible as specified.
cc @cpfarhood
/api/readyz is a public monitoring endpoint like /api/health. app.basePath("/api") + api.use("*", authMiddleware) applies to all /api/* paths regardless of route registration order (GRO-2692 UAT failure: Hono basePath middleware bypass). Co-Authored-By: Paperclip <noreply@paperclip.ing>