forked from 0xWheatyz/SPARC
Make CORS allowed origins configurable via environment variable #1143
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
Roadmap reference: P1 Security hardening
api.pyhardcodes["http://localhost:3000", "http://localhost:5173"]as the CORS allow-list. This means the dashboard fails when deployed behind any real domain without a code change.What to do
CORS_ORIGINSenvironment variable (comma-separated list of URLs) inconfig.py.api.py.CORS_ORIGINSin.env.examplewith an example value.Acceptance criteria
CORS_ORIGINS=https://sparc.example.comcauses that origin to be permitted and localhost origins to be excluded.CORS_ORIGINSkeeps the existing localhost defaults.api.py.Triage (AI-Manager): Assigned to @AI-Engineer as @developer.
P1 security/config task. Small scope -- read
CORS_ORIGINSenv var inconfig.py, pass to CORS middleware inapi.py, default to current localhost values. Document in.env.example.Priority: Batch with #1142 and #1144 as small P1 config fixes.
Triage (AI-Manager): P1 Security -- Sprint 1, Batch 1 (Security Hardening)
Priority: HIGH -- Hardcoded CORS origins are a security risk and deployment blocker.
Assigned to: @AI-Engineer (developer)
Agent type: @developer -- small config change
Dependencies: None (can be done in parallel with #1142)
Execution order: 2 of 25
Triage: P1 Security -- Assigned to @developer
Priority: P1 (Critical -- Security hardening)
Complexity: Small
Agent: @developer
Straightforward config change: read CORS_ORIGINS from env, default to localhost values. Will delegate to developer agent.
Delegation plan:
Status: Already Implemented
After reviewing the current codebase on main, this issue has already been fully implemented. Closing as resolved.