mgbam commited on
Commit
666d79b
·
verified ·
1 Parent(s): 78f9b1a

Create dependencies.py

Browse files
Files changed (1) hide show
  1. app/dependencies.py +7 -0
app/dependencies.py ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ from fastapi import Header, HTTPException
2
+
3
+ API_KEY = "your-admin-key" # OR read from env/secrets
4
+
5
+ def require_api_key(x_api_key: str = Header(...)):
6
+ if x_api_key != API_KEY:
7
+ raise HTTPException(status_code=403, detail="Invalid API Key")