Repository navigation
fix: scope compatibility mode to 0.x clients - #1444
Merged
Merged
Conversation
0.x clients reconnect with the lastEventID query parameter and read the cursor from the Last-Event-ID response field. Accept both under protocol_version_compatibility 8, sending the 0.x field only to requests using lastEventID or topic=. Fixes #1443
Protocol 7 predates authorization details: a 1.x token must hold a grant for every topic it publishes to, even in compatibility mode.
Compatibility mode relaxed the RFC 9068 checks for any token without authorization_details, so any JWT from a shared issuer, such as an OpenID Connect ID token, bypassed disabled anonymous access. Relax them only for tokens carrying a mercure claim, decided once per token. - Reject 1.x tokens in the authorization query parameter and the mercureAuthorization cookie. - Require iss in 1.x tokens, also under the implicit issuer. - Reject subscribe requests mixing 0.x and 1.x query parameters.
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.
Fixes #1443.
protocol_version_compatibilityrestored 0.x subscriptions but not history replay, and relaxed checks for 1.x clients as well. This PR restores replay and limits the relaxation to 0.x requests and tokens.protocol_version_compatibility 8, the hub accepts the 0.xlastEventIDquery parameter again. It sends the 0.xLast-Event-IDresponse field only to requests usinglastEventIDortopic=. An emptylastEventIDis ignored, as in 0.x.mercureclaim and noauthorization_detailsskip the RFC 9068 checks (typ,exp,aud,iss). Before, any token withoutauthorization_detailsskipped them, so any JWT from a shared issuer, such as an OpenID Connect ID token, got past disabled anonymous access.authorizationquery parameter and themercureAuthorizationcookie. They must carryiss, even when the hub only uses the deprecated top-level directives.topic,lastEventID,Last-Event-ID) and 1.x (match*,last_event_id) query parameters get a400.protocol_version_compatibility 7now requires a legacymercure.publishclaim. Tokens with only a publish authorization detail no longer qualify.docs/UPGRADE.mddocuments the behavior changes in a 1.1.3 section. A 0.x token with nomercureclaim at all is now rejected in compatibility mode; adding"mercure": {}keeps it working.