Skip to content

Lock down CORS origins for production #11

@gregoryfoster

Description

@gregoryfoster

Context

From architectural review item 3.

Problem

src/api/main.py sets allow_origins=["*"], allow_methods=["*"], allow_headers=["*"]. This is fine during early development but should be locked down before any real data is served.

Suggested approach

  • Move CORS origins to an environment variable (e.g., API_CORS_ORIGINS), defaulting to ["https://person-validator.exe.xyz"] in production.
  • Keep * gated behind a DEBUG-like flag.
  • Lock down methods and headers to only what's needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions