forked from 0xWheatyz/SPARC
Make CORS allowed origins configurable via environment variable #445
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 CORS allowed origins aslocalhost:3000andlocalhost:5173. This means the dashboard breaks when deployed behind a real domain.What to do
api.py, read allowed origins from an environment variable, e.g.CORS_ALLOWED_ORIGINS(comma-separated list)..env.examplewith the new variable and an example value.Acceptance criteria
CORS_ALLOWED_ORIGINS=https://sparc.example.comcauses the API to accept requests from that origin.api.py.Reference: ROADMAP.md - P1 Security hardening
[Repo Manager Triage] P1 Security hardening issue. Assigned to @AI-Engineer. Delegating to @developer agent as a small-scope config/security fix. Will be worked in a batch with other P1 security issues (#444, #445, #446).
[Repo Manager] Closing as already implemented.
Already implemented:
config.py:63-70readsCORS_ORIGINSenv var (comma-separated), falls back to localhost defaults.api.py:230usesconfig.cors_origins..env.exampledocuments the variable.