File size: 353 Bytes
497e794
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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