symfony / mercure

The Mercure Component allows to easily push updates to web browsers and other HTTP clients using the Mercure protocol.
https://symfony.com/doc/current/components/mercure.html
MIT License
414 stars 39 forks source link

Its impossible to create subscribe only token #80

Closed hubertnnn closed 1 year ago

hubertnnn commented 2 years ago

Based on mercure specification:

If mercure.publish:
- is not defined, then the publisher MUST NOT be authorized to dispatch any update
- contains an empty array, the publisher MUST NOT be authorized to publish private updates, but can publish public updates for all topics.

Current implementation of Token Factory makes every token contain an array under publish key. In other words, the most restrictive token possible still allows publishing public updates for all topics.

We need a possibility to set publish to either null (and remove publish key form the token) or an empty array.

silverbackdan commented 2 years ago

PR Opened.