Allow public access to documentation endpoints
All checks were successful
Build And Test / publish (push) Successful in 48s
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:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user