Repository navigation
fix(api): accept only sign-in tokens on the GraphQL socket - #730
Merged
Merged
Conversation
The socket checked a token's signature, expiry and revocation but not what the token was minted for, so it was looser than the HTTP GraphQL endpoint. A token from a confirmation link, a password reset link or the sign-in page's short-lived exchange is not a sign-in and now connects with no actor. The socket now runs the same bearer check the HTTP endpoint does, at connect and again on every document, so the two cannot drift apart. A session whose stored token is gone stops working on the next document.
The library reads a token's subject before verifying it and raises when it is not a string, which ended the socket connection attempt with an error instead of an anonymous connection.
The rescue around the bearer check also swallowed unrelated failures and answered them as an anonymous connection. The subject is checked before the lookup, so anything else that goes wrong surfaces as it does over HTTP.
mwoods79
added a commit
that referenced
this pull request
Nov 30, 2026
…vocation * origin/main: fix(api): accept only sign-in tokens on the GraphQL socket (#730) fix(huddl): tie organizer-only huddl details to the current role (#726) fix(groups): keep a group's address book with its organizers (#725) fix(discover): noindex empty filtered public discovery responses (#734)
mwoods79
added a commit
that referenced
this pull request
Nov 30, 2026
…-tokens * origin/main: fix(api): accept only sign-in tokens on the GraphQL socket (#730) fix(huddl): tie organizer-only huddl details to the current role (#726) fix(groups): keep a group's address book with its organizers (#725) fix(discover): noindex empty filtered public discovery responses (#734)
mwoods79
added a commit
that referenced
this pull request
Nov 30, 2026
…arer-token * origin/main: fix(api): accept only sign-in tokens on the GraphQL socket (#730) fix(huddl): tie organizer-only huddl details to the current role (#726) fix(groups): keep a group's address book with its organizers (#725) fix(discover): noindex empty filtered public discovery responses (#734) # Conflicts: # lib/huddlz_web/graphql_socket.ex
mwoods79
added a commit
that referenced
this pull request
Nov 30, 2026
…n-escaping * origin/main: fix(api): authenticate API, GraphQL and MCP from the bearer alone (#729) fix(api): accept only sign-in tokens on the GraphQL socket (#730) fix(huddl): tie organizer-only huddl details to the current role (#726) fix(groups): keep a group's address book with its organizers (#725)
mwoods79
added a commit
that referenced
this pull request
Nov 30, 2026
…dl-links * origin/main: fix(api): accept only sign-in tokens on the GraphQL socket (#730) fix(huddl): tie organizer-only huddl details to the current role (#726) fix(groups): keep a group's address book with its organizers (#725) fix(discover): noindex empty filtered public discovery responses (#734)
mwoods79
added a commit
that referenced
this pull request
Nov 30, 2026
…mutations * origin/main: fix(api): accept only sign-in tokens on the GraphQL socket (#730) fix(huddl): tie organizer-only huddl details to the current role (#726) fix(groups): keep a group's address book with its organizers (#725) fix(discover): noindex empty filtered public discovery responses (#734)
mwoods79
added a commit
that referenced
this pull request
Nov 30, 2026
…ership * origin/main: fix(api): accept only sign-in tokens on the GraphQL socket (#730) fix(huddl): tie organizer-only huddl details to the current role (#726) fix(groups): keep a group's address book with its organizers (#725) fix(discover): noindex empty filtered public discovery responses (#734)
mwoods79
added a commit
that referenced
this pull request
Nov 30, 2026
* origin/main: fix(auth): bind administrator viewing credentials to the browser session (#736) fix(api): authenticate API, GraphQL and MCP from the bearer alone (#729) fix(api): accept only sign-in tokens on the GraphQL socket (#730) fix(huddl): tie organizer-only huddl details to the current role (#726) fix(groups): keep a group's address book with its organizers (#725)
mwoods79
added a commit
that referenced
this pull request
Nov 30, 2026
…r-leave * origin/main: fix(api): accept only sign-in tokens on the GraphQL socket (#730) fix(huddl): tie organizer-only huddl details to the current role (#726) fix(groups): keep a group's address book with its organizers (#725) fix(discover): noindex empty filtered public discovery responses (#734)
mwoods79
added a commit
that referenced
this pull request
Dec 1, 2026
* origin/main: fix(auth): have open pages follow a change of access (#735) fix(groups): authorize membership changes against their roster (#739) fix(auth): bind administrator viewing credentials to the browser session (#736) fix(api): authenticate API, GraphQL and MCP from the bearer alone (#729) fix(api): accept only sign-in tokens on the GraphQL socket (#730) fix(huddl): tie organizer-only huddl details to the current role (#726) fix(groups): keep a group's address book with its organizers (#725) fix(discover): noindex empty filtered public discovery responses (#734)
mwoods79
added a commit
that referenced
this pull request
Dec 1, 2026
…d-sorts * origin/main: fix(auth): have open pages follow a change of access (#735) fix(groups): authorize membership changes against their roster (#739) fix(auth): bind administrator viewing credentials to the browser session (#736) fix(api): authenticate API, GraphQL and MCP from the bearer alone (#729) fix(api): accept only sign-in tokens on the GraphQL socket (#730) fix(huddl): tie organizer-only huddl details to the current role (#726) fix(groups): keep a group's address book with its organizers (#725) fix(discover): noindex empty filtered public discovery responses (#734)
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.
Summary
The GraphQL socket (
/ws/gql) now takes exactly the bearer token the HTTP GraphQL endpoint takes: a stored, unrevoked sign-in token. A token minted for another purpose connects with no actor.inspect, so a crash report of the socket's state does not print it.Confirmation.discard_links/1is unchanged: a discarded link is already refused by the confirm action and the HTTP endpoint, and now by the socket.Evidence
Merge Danger
Door: two-way
No schema or data change; reverting restores the old check.
Blast Radius: narrow
Only clients of
/ws/gql. A client connecting with a sign-in token is unaffected. Each document over the socket now costs one more token lookup.