|
from typing import Annotated
|
|
from fastapi import Header, HTTPException
|
|
import config
|
|
|
|
async def get_token_header(x_token: Annotated[str, Header()]):
|
|
if x_token != config.getConfig()["api-key"]
|
|
raise HTTPException(status_code=400, detail="X-Token header is invalid")
|