Repository navigation
fix(auth): bind socket tokens to handshake origin - #1939
Merged
BlueHotDog merged 3 commits intoOct 25, 2026
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
BlueHotDog
changed the base branch from
main
to
test/mcp-subscriptions-regression
October 22, 2026 14:55
This was referenced Oct 22, 2026
BlueHotDog
force-pushed
the
fix/websocket-handshake-origin
branch
from
October 24, 2026 14:33
68399f5 to
c598576
Compare
Base automatically changed from
test/mcp-subscriptions-regression
to
integration/mcp-2026-07-28
October 24, 2026 14:33
BlueHotDog
force-pushed
the
fix/websocket-handshake-origin
branch
from
October 24, 2026 14:33
c598576 to
961e79b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Bind embedded-client WebSocket authentication to the actual handshake
Origin, rather than trusting the socket's claimed origin alone.connect_infometadata.This PR changes only origin authentication. The separate MCP interim-result reproduction test is intentionally red and is not included.
Validation
Latest cleanup validation:
MIX_TEST_DB_SUFFIX=_delta_origin_cleanup make -C apps/frontman_server precommit TEST_ARGS='test/frontman_server_web/channels/user_socket_test.exs test/frontman_server_web/controllers/client_token_controller_test.exs'— passed compilation, formatting, strict Credo, and all 16 targeted tests.make -C apps/frontman_server strict-compile— passed development and test compilation with warnings treated as errors.input_requiredregression covered by the next fix layer, not origin authentication.make -C libs/frontman-client check— formatting and build passed; 110 of 111 tests passed, including the new no-origin-param regression. The sole failure is the inherited empty-subscription acknowledgment regression.make buildand the pre-commit/pre-push hooks passed, including shared binding compilation, formatting, strict Credo, source-comment checks, and dead-code analysis.Endpoint.call/2and Plug's upgrade-capable test adapter. No live-browser/TCP handshake test was run.This cleanup uses only the actual handshake origin for token authentication. Older clients may still send an origin parameter, but it is ignored. The internal header remains the bridge into Phoenix socket connect metadata; the endpoint replaces it before dispatch.
Checklist
make devIntegration stack
Integration target:
integration/mcp-2026-07-28. No PR in this stack targetsmain.All PRs are regular, non-draft PRs. The test foundation is intentionally red; inherited failures remain expected until the relevant fix layers are present. The origin-only suite passed before inheriting those regressions.
Review and integrate bottom-up. After a predecessor is merged into the integration branch, retarget the next PR to the integration branch before merging it. Do not merge an upper PR into the test branch out of order. A later, separately approved PR will take the completed integration branch to
main.Stack setup has not merged either PR into the integration branch or
main. No empty placeholder fix PRs are created.Current review stack
integration/mcp-2026-07-28← #1940 (reproduction tests) ← #1939 (origin authentication) ← #1948 (MRTR decline) ← #1949 (browser subscriptions / notification envelopes).All four PRs are non-draft. Review bottom-up. After integrating a predecessor, retarget the next PR to the integration branch before merging it. Neither the integration branch nor
mainhas been updated by these fix layers.At #1949, local validation passes: 1,081 server tests plus precommit checks; 115 browser-client tests plus formatting/build. Both original regressions are green. Independent reviews approved the MRTR layer and the subscription layer after the safe-cancellation-logging follow-up.
Remaining findings stay test-first: replay safety, structured-result consumption, schema validity, and contract validation. No production rollout or merge to
mainis authorized by this stack setup.