Spaces:
Build error
Build error
Download backend/src/middleware/auth.py from amkyawdev/amkyawdev-coder-backend: direct link, hf CLI and curl.
- Browser
- Download file 636 Bytes
-
https://huggingface.co/spaces/amkyawdev/amkyawdev-coder-backend/resolve/main/backend/src/middleware/auth.py
- Command line
-
hf download hf://spaces/amkyawdev/amkyawdev-coder-backend/backend/src/middleware/auth.py
-
curl -L -o auth.py https://huggingface.co/spaces/amkyawdev/amkyawdev-coder-backend/resolve/main/backend/src/middleware/auth.py
636 Bytes
| """ | |
| Authentication Middleware | |
| """ | |
| from fastapi import Request, HTTPException | |
| from starlette.middleware.base import BaseHTTPMiddleware | |
| from src.api.core.logger import logger | |
| class AuthMiddleware(BaseHTTPMiddleware): | |
| """Simple authentication middleware""" | |
| async def dispatch(self, request: Request, call_next): | |
| # Skip auth for health endpoints | |
| if request.url.path in ["/", "/api/health"]: | |
| return await call_next(request) | |
| # TODO: Implement Firebase auth token verification | |
| # For now, allow all requests | |
| response = await call_next(request) | |
| return response | |