up
All checks were successful
Deploy Dev / Build (pull_request) Successful in 5s
Deploy Dev / Push (pull_request) Successful in 8s
Deploy Dev / Deploy dev (pull_request) Successful in 6s

This commit is contained in:
emmatveev 2024-11-17 02:32:45 +03:00
parent 46b0b49c92
commit dc20588b18
2 changed files with 0 additions and 13 deletions

View File

@ -1,13 +0,0 @@
import fastapi
import os
QUEUES_TOKEN = os.getenv('QUEUES_TOKEN')
class CheckToken:
async def __call__(self, request: fastapi.Request, call_next):
if QUEUES_TOKEN:
token = request.headers.get('X-Queues-Token')
if not token or token != QUEUES_TOKEN:
raise fastapi.HTTPException(403)
return await call_next(request)