From a7c25076d16bde9ec928b9ef01bce952406ea7b1 Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Wed, 8 Apr 2026 14:29:21 -0500 Subject: initial commit --- app/security.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 app/security.py (limited to 'app/security.py') diff --git a/app/security.py b/app/security.py new file mode 100644 index 0000000..b1ed939 --- /dev/null +++ b/app/security.py @@ -0,0 +1,7 @@ +from fastapi import Header, HTTPException, status +from app.config import settings + + +async def require_api_key(x_api_key: str = Header(default="")) -> None: + if x_api_key != settings.api_key: + raise HTTPException(status_code=status.HTTP_401_UNAUTHORIZED, detail="invalid api key") -- cgit v1.2.3