This commit is contained in:
2021-11-21 22:32:25 +03:00
commit 18df7c12f4
23 changed files with 667 additions and 0 deletions

9
src/app/depends.py Normal file
View File

@@ -0,0 +1,9 @@
from fastapi import Security, HTTPException, status
from core.auth import default_security
from core.config import env_config
async def check_token(api_key: str = Security(default_security)):
if api_key != env_config.API_KEY:
raise HTTPException(status_code=status.HTTP_403_FORBIDDEN, detail="Wrong api key!")