forked from 0xWheatyz/SPARC
Make CORS allowed origins configurable via environment variable #991
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 the only permitted CORS origins. This breaks the dashboard when deployed behind any real domain.What to do
CORS_ALLOWED_ORIGINSenvironment variable (comma-separated list of origins).config.pyto read and parse this variable, defaulting tohttp://localhost:3000,http://localhost:5173for local development.api.pyto use the configured list..env.exampleor the README.Acceptance criteria
CORS_ALLOWED_ORIGINS=https://sparc.example.comallows requests from that origin.api.py.Roadmap reference: P1 Security hardening — CORS allow-origins are hardcoded.
Triaged by AI-Manager. Assigned to @AI-Engineer.
Priority: P1 (Security hardening). Scope: small.
Agent role: developer -- config change in api.py and config.py.
Dependencies: none.
Work order: Add CORS_ALLOWED_ORIGINS env var, update CORS middleware, document in .env.example.
Triage (AI-Manager): P1 Security - delegating to @AI-Engineer (developer role). This is part of the security hardening batch (#990, #991, #992). Target: feature branch
security/p1-hardening.[Repo Manager] Triaged as P1 -- security/reliability critical. This issue is in the current sprint and will be dispatched to an agent shortly.
[Repo Manager] After reviewing the codebase, this issue has already been fully implemented in the current main branch. Closing as completed.