Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spec!: add support for several topic matcher types, including URL Pattern #959

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

dunglas
Copy link
Owner

@dunglas dunglas commented Oct 14, 2024

Replaces #831 with a more flexible and future-proof approach.

Summary

  • the topic query parameter becomes match and now only supports exact matching
  • new query parameters match{MatchType}
    • by default, matchRegexp, matchURLPattern, and matchURITemplate are defined
    • they respectively allow matching with regexp, URL Patterns, and URI Templates (URI Templates were already supported)
    • hub can implement custom matcher types
    • future updates may introduce new match types
  • it's now possible to include per-topic (or topic matcher) payloads (replaces feat: payload for a specific topic #945)
  • the JWT format has been updated to match these new capabilities
  • the subscription API format has been updated to match these new capabilities

The official hub will be able to support both the current and new protocols simultaneously (no hard BC break).

TODO:

  • update all examples

spec/mercure.md Outdated Show resolved Hide resolved
spec/mercure.md Outdated Show resolved Hide resolved
spec/mercure.md Outdated
* Topic matcher: An expression intended to be matched by one or several topics,
depending on the matcher type.
* Topic matcher type: Several types of matchers **MAY** be supported by the hub. The hub **MUST** support exact matching of topic and **SHOULD** support
matching topics using I-Regexp [@!RFC9485], URL patterns [@!urlpattern] and URI Templates [@!RFC6570] as
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd say:

should support at least one of the following topic matchers:

Copy link
Owner Author

Choose a reason for hiding this comment

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

I'll improve this by adding a table.

Link: <https://example.com/.well-known/mercure>; rel="mercure"

{"@id": "/books/foo", "foo": "bar", "@context": {"@language": "fr-FR"}}
~~~
Copy link
Contributor

Choose a reason for hiding this comment

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

nothing has changed there it just got moved?

Copy link
Owner Author

Choose a reason for hiding this comment

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

yes

spec/mercure.md Outdated Show resolved Hide resolved
spec/mercure.md Outdated Show resolved Hide resolved
spec/mercure.md Outdated Show resolved Hide resolved
spec/mercure.md Outdated Show resolved Hide resolved
spec/mercure.md Outdated Show resolved Hide resolved
spec/mercure.md Outdated Show resolved Hide resolved
dunglas and others added 4 commits October 16, 2024 12:28
Co-authored-by: Antoine Bluchet <[email protected]>
Co-authored-by: Antoine Bluchet <[email protected]>
Co-authored-by: Antoine Bluchet <[email protected]>
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.

2 participants