This commit is contained in:
2025-09-12 07:32:32 -07:00
parent 45a62e7c3b
commit 7c7dcb5b10
29 changed files with 2493 additions and 394 deletions

View File

@@ -65,7 +65,11 @@ app = FastAPI(
# API Key Authentication Middleware
@app.middleware("http")
async def api_key_auth(request: Request, call_next):
if request.url.path.startswith("/docs") or request.url.path.startswith("/redoc") or request.url.path == "/health":
# Skip authentication for documentation and health endpoints
if (request.url.path.startswith("/docs") or
request.url.path.startswith("/redoc") or
request.url.path == "/health" or
request.url.path == "/openapi.json"):
return await call_next(request)
api_key = request.headers.get("X-API-KEY")