Skip to content

Restrict CORS to configured origins#41

Merged
patryk-przybysz merged 3 commits into
develfrom
feat/restrict-cors-origins
Jun 17, 2026
Merged

Restrict CORS to configured origins#41
patryk-przybysz merged 3 commits into
develfrom
feat/restrict-cors-origins

Conversation

@patryk-przybysz

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #35: replace permissive Access-Control-Allow-Origin: * with a configurable origin allowlist for the REST API and WebSocket upgrades.

  • Adds rest.origins config
  • Default allowlist: Vite dev server (localhost:5173, 127.0.0.1:5173) and GitHub Pages (https://monvit.github.io)
  • HTTP CORS echoes allowed origins; disallowed preflights return 403
  • WebSocket CheckOrigin uses the same list

Closes #36

The initial config used rest.allowed_origins / --rest.allowed-origins, which did not map to koanf paths. Rename to rest.origins so env and CLI overrides work.
@patryk-przybysz patryk-przybysz requested a review from kox13 June 15, 2026 18:07
@patryk-przybysz patryk-przybysz self-assigned this Jun 15, 2026
@patryk-przybysz patryk-przybysz added the enhancement New feature or request label Jun 15, 2026
@patryk-przybysz patryk-przybysz enabled auto-merge (squash) June 15, 2026 18:12

@kox13 kox13 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@patryk-przybysz patryk-przybysz merged commit f15b355 into devel Jun 17, 2026
1 check passed
@patryk-przybysz patryk-przybysz deleted the feat/restrict-cors-origins branch June 17, 2026 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants