summaryrefslogtreecommitdiff
path: root/app/security.py
diff options
context:
space:
mode:
authorChristian Cleberg <[email protected]>2026-04-08 14:29:21 -0500
committerChristian Cleberg <[email protected]>2026-04-08 14:29:21 -0500
commita7c25076d16bde9ec928b9ef01bce952406ea7b1 (patch)
tree802c5f84902f240c6aab95acc1e6348dfbd806c2 /app/security.py
downloadhutch-notify-a7c25076d16bde9ec928b9ef01bce952406ea7b1.tar.gz
hutch-notify-a7c25076d16bde9ec928b9ef01bce952406ea7b1.tar.bz2
hutch-notify-a7c25076d16bde9ec928b9ef01bce952406ea7b1.zip
initial commit
Diffstat (limited to 'app/security.py')
-rw-r--r--app/security.py7
1 files changed, 7 insertions, 0 deletions
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")