mirror of
https://github.com/flibusta-apps/meilie_updater.git
synced 2025-12-06 07:05:37 +01:00
12 lines
347 B
Python
12 lines
347 B
Python
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!"
|
|
)
|