voice_detection / auth.py
ranar110
Initial commit of Voice Detection System
37c6d1c
raw
history blame contribute delete
283 Bytes
from fastapi import Header, HTTPException
API_KEY = "my_secret_key_123" # Simple hardcoded key for demo
async def verify_api_key(x_api_key: str = Header(...)):
if x_api_key != API_KEY:
raise HTTPException(status_code=401, detail="Invalid API Key")
return x_api_key