Skip to content
Snippets Groups Projects

Add API key authentication for routes

Merged Mohammad Torkashvand requested to merge feature/NAT-416-add-api-key-auth into develop
All threads resolved!
3 files
+ 5
5
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 1
1
@@ -14,7 +14,7 @@ async def get_api_key(api_key: str = Depends(api_key_header)) -> str:
settings = load_oss_params()
# TODO: This is a simulated database of API keys which should be replace with a real one
if api_key in settings.THIRD_PARTY_API_KEYS:
if api_key in settings.THIRD_PARTY_API_KEYS.values():
return api_key
raise HTTPException(status_code=status.HTTP_403_FORBIDDEN, detail="Invalid API Key")
Loading