forked from 0xWheatyz/SPARC
Make CORS allowed origins configurable via environment variable #569
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?
Context
api.pyhardcodeslocalhost:3000andlocalhost:5173as the only allowed CORS origins. When the app is deployed behind a real domain the dashboard will be blocked by the browser due to CORS policy violations.What to do
CORS_ALLOWED_ORIGINSenvironment variable (comma-separated list of origins) toconfig.py.api.pyto read from this config value.http://localhost:3000,http://localhost:5173so local dev behaviour is unchanged.docker-compose.ymlor a.env.examplefile.Acceptance criteria
CORS_ALLOWED_ORIGINS=https://sparc.example.comallows requests from that origin.api.py.Reference
Roadmap: P1 — Security hardening
Triage Note: Part of the security hardening group (#568, #569, #570). These three issues are independent and can be worked in parallel.
Priority: P1 | Complexity: small | Assigned agent type: @developer
Triage (AI-Manager): P1 security hardening issue. Assigned to @AI-Engineer (developer role). This is a small, well-scoped change. Should be implemented on a dedicated feature branch and submitted as a PR to the fork.
This issue has been resolved. Implemented in PR #27 (feature/p1-security-hardening) - configurable CORS origins. All changes are merged into main. Closing as completed.