forked from 0xWheatyz/SPARC
Make CORS allowed origins configurable via environment variable #5
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Roadmap Reference
P1 — Security hardening
Problem
api.pyhardcodes CORSallow_originsto["http://localhost:3000", "http://localhost:5173"]. When the dashboard is deployed behind a real domain, the browser will block API requests because the origin does not match.What to do
SPARC/api.py, read aCORS_ORIGINSenvironment variable (comma-separated list of origins).["http://localhost:3000", "http://localhost:5173"]when the variable is unset (preserves local dev behaviour).cors_originstoconfig.pyso the value is centralised.docker-compose.ymlto passCORS_ORIGINSthrough from the host.envfile..env.example.Acceptance Criteria
CORS_ORIGINS=https://sparc.example.comcauses the API to allow that origin.CORS_ORIGINScontinues to allow localhost origins.Triage: P1 security hardening, small complexity. Assigned to @AI-Engineer. Delegating to @developer agent as part of the P1 security batch (#4, #5, #6).
Implementation complete in PR #27 (feature/p1-security-hardening). Awaiting review.