baton/backend/middleware.py
2026-03-20 20:44:00 +02:00

12 lines
345 B
Python

from __future__ import annotations
from fastapi import Header, HTTPException
from backend import config
async def verify_webhook_secret(
x_telegram_bot_api_secret_token: str = Header(default=""),
) -> None:
if x_telegram_bot_api_secret_token != config.WEBHOOK_SECRET:
raise HTTPException(status_code=403, detail="Forbidden")