# app/core/security.py from fastapi import Header, HTTPException import os API_SECRET_KEY = os.getenv("API_SECRET_KEY") def verify_api_key(x_api_key: str = Header(None)): if not x_api_key or x_api_key != API_SECRET_KEY: raise HTTPException(status_code=401, detail="Invalid API key") return True