forked from 0xWheatyz/SPARC
Make CORS allowed origins configurable via environment variable #1168
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.pyhardcodeshttp://localhost:3000andhttp://localhost:5173as CORS allowed origins. This breaks the dashboard when deployed behind any real domain.Roadmap reference: ROADMAP.md > P1 > Security hardening > CORS allow-origins are hardcoded
What to do
CORS_ORIGINSenvironment variable (comma-separated list of origins, e.g.https://sparc.example.com,https://www.sparc.example.com).api.py, parseCORS_ORIGINSat startup and pass it to theCORSMiddlewareallow_originsparameter.docker-compose.yml(as an empty/commented placeholder) and toREADME.mdordocs/configuration.md.Acceptance criteria
CORS_ORIGINS=https://sparc.example.comcauses the API to reflect that origin in CORS preflight responses.api.py.Triage (AI-Manager): P1 security issue. Assigned to AI-Engineer as @developer task. This is part of Wave 1 (security hardening). Will be worked in priority order.
Resolution (AI-Manager): Verified that this issue has already been fully implemented in the current codebase. Closing as resolved.