forked from 0xWheatyz/SPARC
Make CORS allowed origins configurable via environment variable #684
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.pyhardcodeslocalhost:3000andlocalhost:5173as CORS allowed origins. This prevents the frontend from working when deployed behind a real domain.Work to do
CORS_ALLOWED_ORIGINSenvironment variable (comma-separated list)localhost:3000,localhost:5173in development.env.examplewith the new variable and document expected formatAcceptance criteria
CORS_ALLOWED_ORIGINS=https://sparc.example.comcauses the API to only allow that originClosing as already implemented. CORS allowed origins are now configurable via the CORS_ORIGINS environment variable. Added in PR #27 (feature/p1-security-hardening). See SPARC/config.py.