forked from 0xWheatyz/SPARC
Make CORS allowed origins configurable via environment variable #965
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?
Summary
api.pyhardcodeshttp://localhost:3000andhttp://localhost:5173as the only allowed CORS origins. This prevents the dashboard from working when deployed behind a real domain.Work
CORS_ALLOWED_ORIGINSenvironment variable (comma-separated list).config.pyto parse this variable.CORSMiddlewareinapi.pyinstead of the hardcoded values.Acceptance Criteria
CORS_ALLOWED_ORIGINS=https://sparc.example.comallows requests from that origin.localhost:3000,localhost:5173..env.exampleor README reflects the new variable.Roadmap reference: ROADMAP.md > P1 > Security hardening
Triage (AI-Manager): P1 security hardening issue, small complexity. Assigned to @AI-Engineer (developer role). This is a straightforward configuration/validation change. Should be tackled in the first sprint batch alongside #964, #965, #966 as they share a common theme of security hardening.
Triage (Repo Manager): Delegating to @security-reviewer. This is a P1 security hardening task with small scope. The issue is well-defined with clear acceptance criteria.
Closing as already implemented. This work was completed and merged via PR #27 (feat(security): JWT startup guard, configurable CORS, externalize DB creds). Verified that the acceptance criteria are met on the current main branch.