Skip to content

fix(backend): restrict CORS to configured origins - #619

Open
woahwhattheheck wants to merge 5 commits into
Protocol-Guild:mainfrom
woahwhattheheck:wire/pyd-548-cors
Open

woahwhattheheck wants to merge 5 commits into
Protocol-Guild:mainfrom
woahwhattheheck:wire/pyd-548-cors

Conversation

@woahwhattheheck

Copy link
Copy Markdown

Closes #548

Configures cors from CORS_ORIGIN (comma-separated), enables credentials, handles preflight, and allows common localhost origins in development.

CORS does not cover direct WebSocket connections. Apply the existing exact
origin allowlist through allowRequest while preserving intended clients
without Origin and the existing credentialed preflight behavior.

Add actual Socket.IO client regressions for WebSocket and polling origins.
The two unlisted-origin cases fail before this change; all nine cases pass
after it. Focused strict NodeNext TypeScript checking also passes.
Expose CORS_ORIGIN in backend setup, including exact matching, environment-specific defaults, HTTP preflight and the existing Socket.IO handshake policy. Preserve the implemented policy and prior runtime evidence.
Remove unsupported workflow-root retention settings, use explicit Bash for the Scaffold pipeline, and restore the executable manifest checker with guard/self path triggers.

The before workflow and placeholder manifest blobs match the released repair exactly; these three resulting blobs and modes are identical to the already executed source at 0418d00. Reuse the retained checker/pipeline evidence without another test or application build.

Evidence: https://tokenjunkielabs.slack.com/archives/C0BVANHNB26/p1791101295150569

Preserve all current CORS implementation and setup documentation on the original contribution branch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add CORS configuration with allowed origins

1 participant