LordXido's picture
Update security/api_keys.py
497e794 verified
raw
history blame contribute delete
353 Bytes
from fastapi import Header, HTTPException
# Enterprise demo keys (rotate later)
VALID_KEYS = {
"codex-enterprise-demo-key"
}
def verify_api_key(x_api_key: str = Header(...)):
if x_api_key not in VALID_KEYS:
raise HTTPException(
status_code=401,
detail="Invalid or missing API key"
)
return x_api_key