Skip to content

[Mercure] Update the default JWT secret #17259

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions mercure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ MercureBundle will use it to automatically generate and sign the needed JWTs.
In addition to these environment variables,
MercureBundle provides a more advanced configuration:

* ``secret``: the key to use to sign the JWT (all other options, beside ``algorithm``, ``subscribe``, and ``publish`` will be ignored)
* ``secret``: the key to use to sign the JWT - A key of the same size as the hash output (for instance, 256 bits for
"HS256") or larger MUST be used. (all other options, beside ``algorithm``, ``subscribe``, and ``publish`` will be ignored)
* ``publish``: a list of topics to allow publishing to when generating the JWT (only usable when ``secret``, or ``factory`` are provided)
* ``subscribe``: a list of topics to allow subscribing to when generating the JWT (only usable when ``secret``, or ``factory`` are provided)
* ``algorithm``: The algorithm to use to sign the JWT (only usable when ``secret`` is provided)
Expand All @@ -132,7 +133,7 @@ MercureBundle provides a more advanced configuration:
default:
url: https://mercure-hub.example.com/.well-known/mercure
jwt:
secret: '!ChangeMe!'
secret: '!ChangeThisMercureHubJWTSecretKey!'
publish: ['foo', 'https://example.com/foo']
subscribe: ['bar', 'https://example.com/bar']
algorithm: 'hmac.sha256'
Expand All @@ -150,7 +151,7 @@ MercureBundle provides a more advanced configuration:
url="https://mercure-hub.example.com/.well-known/mercure"
>
<jwt
secret="!ChangeMe!"
secret="!ChangeThisMercureHubJWTSecretKey!"
algorithm="hmac.sha256"
provider="My\Provider"
factory="My\Factory"
Expand All @@ -172,7 +173,7 @@ MercureBundle provides a more advanced configuration:
'default' => [
'url' => 'https://mercure-hub.example.com/.well-known/mercure',
'jwt' => [
'secret' => '!ChangeMe!',
'secret' => '!ChangeThisMercureHubJWTSecretKey!',
'publish' => ['foo', 'https://example.com/foo'],
'subscribe' => ['bar', 'https://example.com/bar'],
'algorithm' => 'hmac.sha256',
Expand Down