We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9e9e2fb commit b9c7737Copy full SHA for b9c7737
backend/api/security.py
@@ -10,17 +10,11 @@
10
from fastapi.security import APIKeyHeader
11
from starlette.status import HTTP_401_UNAUTHORIZED, HTTP_403_FORBIDDEN
12
13
-from api.config import Settings
+from api.config import Settings, get_settings
14
15
# Write token (admin) auth
16
api_key_header = APIKeyHeader(name="Authorization", auto_error=False)
17
18
-
19
-def get_settings() -> Settings:
20
- # Instantiate settings outside of Pydantic request validation to avoid DI issues.
21
- return Settings()
22
23
24
async def require_write_token(
25
authorization: str | None = Security(api_key_header),
26
settings: Settings = Depends(get_settings),
0 commit comments