Summary
Add API key auth to protect all endpoints except health checks.
Blocked by
Nothing — this is a starting ticket.
Blocks
Steps
- Create
backend/app/middleware/auth.py
- Define a FastAPI dependency that reads
X-API-Key from the request header
- Compare against a list of valid keys stored in env var
API_KEYS (comma-separated)
- Return 401 if header is missing, 403 if key is invalid
- Apply the dependency to all routes except
/health and /ready
- Add
API_KEYS to .env.example
- Write tests: request without key → 401, bad key → 403, valid key → 200
Acceptance Criteria
Summary
Add API key auth to protect all endpoints except health checks.
Blocked by
Nothing — this is a starting ticket.
Blocks
Steps
backend/app/middleware/auth.pyX-API-Keyfrom the request headerAPI_KEYS(comma-separated)/healthand/readyAPI_KEYSto.env.exampleAcceptance Criteria
/healthand/readyare accessible without authCloses #62