Skip to content

Commit

Permalink
Merge branch '2.7' into 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
soyuka committed Oct 19, 2023
2 parents 09511a1 + fe670d6 commit 96256d7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/mercure.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,14 @@ In addition to `private`, the following options are available:

Use `iri` (iriConverter) and `escape` (rawurlencode) functions to add an alternative topic, in order to restrict a subscriber with `topic_selector` to receive only publications that are authorized (partner match).

> Let's say that a subscriber wants to receive updates concerning all book resources it has access to. The subscriber can use the topic selector <https://example.com/books/{id}> as value of the topic query parameter.
> Let's say that a subscriber wants to receive updates concerning all book resources it has access to. The subscriber can use the topic selector `https://example.com/books/{id}` as value of the topic query parameter.
> Adding this same URI template to the mercure.subscribe claim of the JWS presented by the subscriber to the hub would allow this subscriber to receive all updates for all book resources. It is not what we want here: this subscriber is only authorized to access some of these resources.
>
> To solve this problem, the mercure.subscribe claim could contain a topic selector such as: <https://example.com/users/foo/{?topic}>.
> To solve this problem, the mercure.subscribe claim could contain a topic selector such as: `https://example.com/users/foo/{?topic}`.
>
> The publisher could then take advantage of the previously described behavior by publishing a private update having <https://example.com/books/1> as canonical topic and <https://example.com/users/foo/?topic=https%3A%2F%2Fexample.com%2Fbooks%2F1> as alternate topic.
> The publisher could then take advantage of the previously described behavior by publishing a private update having `https://example.com/books/1` as canonical topic and `https://example.com/users/foo/?topic=https%3A%2F%2Fexample.com%2Fbooks%2F1` as alternate topic.
>
> <https://mercure.rocks/spec#subscribers>
> [https://mercure.rocks/spec#subscribers](https://mercure.rocks/spec#subscribers)
Below is an example using the `topics` option:

Expand Down

0 comments on commit 96256d7

Please sign in to comment.