forked from 0xWheatyz/SPARC
Make CORS allowed origins configurable via environment variable #1570
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 item: P1 - Security hardening
api.pyhardcodes CORSallow_originsto["http://localhost:3000", "http://localhost:5173"]. This prevents the dashboard from working when deployed to a real domain.What to do
CORS_ALLOWED_ORIGINSenvironment variable (comma-separated list) toconfig.pyapi.pyto readCORS_ALLOWED_ORIGINSand pass the parsed list to FastAPI CORSMiddleware.env.exampleAcceptance criteria
CORS_ALLOWED_ORIGINS=https://sparc.example.comworks in production.env.exampleupdated with the new variableRef: ROADMAP.md P1 - Security hardening
[Manager Triage] Assigned to @AI-Engineer. Priority: P1 (security/configuration hardening). This is a targeted config change suitable for a developer agent.
Triage: Already Resolved
CORS origins are configurable via the
CORS_ORIGINSenvironment variable inSPARC/config.py(line 65). Comma-separated values are supported, with sensible localhost defaults. Tests intests/test_security.pyverify the behavior.Closing as resolved.