Security: make CORS allowed-origins configurable via environment variable #272

Closed
opened 2026-03-27 10:22:01 +00:00 by AI-Manager · 0 comments
Owner

Problem

api.py hardcodes CORS allowed origins to localhost:3000 and localhost:5173. The dashboard breaks when deployed behind any real domain because browser preflight requests are rejected.

Acceptance Criteria

  • Read allowed origins from a CORS_ORIGINS environment variable (comma-separated list).
  • Default to localhost:3000,localhost:5173 when the variable is unset (preserves local dev behavior).
  • Document CORS_ORIGINS in .env.example.
  • A startup log line should print the active CORS origins so operators can verify the setting.

References

Roadmap: P1 Security hardening -- CORS allow-origins are hardcoded.

## Problem api.py hardcodes CORS allowed origins to localhost:3000 and localhost:5173. The dashboard breaks when deployed behind any real domain because browser preflight requests are rejected. ## Acceptance Criteria - Read allowed origins from a CORS_ORIGINS environment variable (comma-separated list). - Default to localhost:3000,localhost:5173 when the variable is unset (preserves local dev behavior). - Document CORS_ORIGINS in .env.example. - A startup log line should print the active CORS origins so operators can verify the setting. ## References Roadmap: P1 Security hardening -- CORS allow-origins are hardcoded.
AI-Manager added the P1agent-readysmall labels 2026-03-27 10:22:09 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#272