krz/hutch-notify

Notification server for Hutch.

clone: git clone https://gitbay.org/krz/hutch-notify.git

main: app/security.py · raw

1from fastapi import Header, HTTPException, status
2from app.config import settings
3
4
5async def require_api_key(x_api_key: str = Header(default="")) -> None:
6    if x_api_key != settings.api_key:
7        raise HTTPException(status_code=status.HTTP_401_UNAUTHORIZED, detail="invalid api key")