Allow public access to documentation endpoints
All checks were successful
Build And Test / publish (push) Successful in 48s

Skip auth for /docs, /redoc, /openapi.json

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-30 16:58:19 -08:00
parent a2104917fd
commit 34cefc75b6

View File

@@ -20,8 +20,9 @@ class APIKeyAuthMiddleware(BaseHTTPMiddleware):
if not self.api_key: if not self.api_key:
return await call_next(request) return await call_next(request)
# Skip auth for health check endpoints # Skip auth for health check and documentation endpoints
if request.url.path in ["/health", "/healthz", "/"]: public_paths = ["/health", "/healthz", "/", "/docs", "/redoc", "/openapi.json"]
if request.url.path in public_paths:
return await call_next(request) return await call_next(request)
# Get the Authorization header # Get the Authorization header