Verify API key from Authorization header
(credentials: HTTPAuthorizationCredentials = Security(security))
| 34 | return bcrypt.checkpw(password.encode(), hashed.encode()) |
| 35 | |
| 36 | async def verify_api_key_header(credentials: HTTPAuthorizationCredentials = Security(security)) -> str: |
| 37 | """Verify API key from Authorization header""" |
| 38 | api_key = credentials.credentials |
| 39 | if not AuthManager.verify_api_key(api_key): |
| 40 | raise HTTPException(status_code=401, detail="Invalid API key") |
| 41 | return api_key |
| 42 | |
| 43 | |
| 44 | async def verify_api_key_flexible( |
nothing calls this directly
no test coverage detected