-
-
Notifications
You must be signed in to change notification settings - Fork 842
Mercure configuration #200
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
Comments
Seems related to this: #128 |
Indeed!
This is definitely outdated. This behavior changed in the recent versions of MercureBundle. It's now a secret key that must be set, not a full JWT. As a summary:
|
Thanks for clarifying. I'm still a little confused on the following:
It seems that the So if the Mercure hub should have a different secret than the MercureBundle, then which secret holds which purpose? I had initially thought they should be the same secret, so that the hub can verify JWTs generated by the bundle. |
Yes indeed you're right. I mean that you must pass |
Ah!💡 I initially misunderstood what you meant when you said Thanks again for clearing this up! |
…various improvements (tchapi, dunglas) This PR was merged into the 5.3 branch. Discussion ---------- [Mercure] Compatibility with the Docker integration and various improvements Includes #16151. Closes dunglas/symfony-docker#200. Commits ------- ad0cbe5 nitpicking adf49ef Update mercure.rst daaa3f1 Update mercure.rst ec87085 Update mercure.rst b4fb9fb Update mercure.rst 3ca1aa1 Update mercure.rst 81c1387 Update mercure.rst e35f1cc Update mercure.rst 7496149 review 142a6f9 [mercure] Compatibility with the Docker integration and various improvements 123ad73 Remove unneeded JWT reference f948ab2 Update mercure.rst regarding JWT token secret
Hi!
First of all, thanks a lot for this skeleton.
I'm trying to make async updates work with Mercure, allowing only authenticated updates and subscribers - however there's some things I do not understand yet.
In the docker-compose.yml at line 26 we see the following configuration:
which is the same value that is passed to Caddy on lines 36/37:
As they all share the same value (both the default value as well as whatever the user defines as
$CADDY_MERCURE_JWT_SECRET
) I take it that these values should be identical.It seems that the
MERCURE_JWT_SECRET
environment variable inside thephp
service relates to theMERCURE_JWT_SECRET
within.env
- which by default reads:So I would take it that these values should be cryptographically random values, which would be used as the secret passphrase to sign and verify JWTs.
However, the documentation for configuring Mercure within API Platform says the following:
which at least conflicts with the comment inside
.env
, and if the rest of my understanding is correct, also conflicts with the configuration insidedocker-compose.yml
.So my question boils down to the following:
Should the
publisher_jwt
andsubscriber_jwt
values within the Caddyfile indeed contain a cryptographically random value?Should the
MERCURE_JWT_SECRET
within.env
indeed contain a JWT, which should be signed with the cryptographically randompublisher_jwt
value?The text was updated successfully, but these errors were encountered: