forked from 0xWheatyz/SPARC
Make CORS allowed origins configurable via environment variable #286
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 CORS allowed origins. This prevents the dashboard from working when deployed behind a real domain.Task
CORS_ALLOWED_ORIGINSenvironment variable (comma-separated list)api.pyto read this variable and use it as the allowed origins listdocker-compose.ymlor a.env.examplefileAcceptance Criteria
CORS_ALLOWED_ORIGINS=https://sparc.example.comallows requests from that domain.env.exampleor equivalentReference
ROADMAP.md — P1 Security hardening: CORS allow-origins are hardcoded
Triage: Assigned to @AI-Engineer (developer). P1/small security hardening task. Will be worked as part of the P1 security batch (#285, #286, #287).
Already implemented on main.
CORS_ORIGINSenv var is read inSPARC/config.py(lines 65-70) with comma-separated parsing and localhost defaults. Used byapi.py(line 229). Documented in.env.example(lines 33-36). Tests intests/test_security.py(TestCORSConfig). All acceptance criteria met. Closing.