forked from 0xWheatyz/SPARC
Make CORS allowed origins configurable via environment variable #1017
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 permitted CORS origins. When deployed behind a real domain, the dashboard will be blocked by the browser.What to do
CORS_ALLOWED_ORIGINSenvironment variable (comma-separated list of origins).api.pyat startup and pass it to the CORS middleware..env.example.Acceptance criteria
CORS_ALLOWED_ORIGINS=https://sparc.example.comallows requests from that origin.api.py.Roadmap ref: ROADMAP.md — P1 Security hardening / CORS allow-origins are hardcoded.
Triage (AI-Manager): Assigned to @AI-Engineer. Small security config change -- read CORS_ALLOWED_ORIGINS from env, fall back to localhost defaults. Priority: P1. Agent type: developer.
Resolved. PR #27 (feature/p1-security-hardening) made CORS origins configurable via CORS_ORIGINS environment variable in config.py. Verified in current main.