-
Notifications
You must be signed in to change notification settings - Fork 2
Add support of Mercure running on a subdomain #1394
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
base: 1.x
Are you sure you want to change the base?
Conversation
|
I replaced the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your PR!
I just have a small suggestion to improve readability.
Co-authored-by: Martin Eiber <[email protected]>
|
| $tokenProvider: '@Pimcore\Bundle\StudioBackendBundle\Mercure\Service\ClientTokenService' | ||
| $cookieLifetime: '%pimcore_studio_backend.mercure_settings.cookie_lifetime%' | ||
| $cookieSameSite: '%pimcore_studio_backend.mercure_settings.cookie_same_site%' | ||
| $jwt_cookie_strictness: '%pimcore_studio_backend.mercure_settings.jwt_cookie_strictness%' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| $jwt_cookie_strictness: '%pimcore_studio_backend.mercure_settings.jwt_cookie_strictness%' | |
| $jwtCookieStrictness: '%pimcore_studio_backend.mercure_settings.jwt_cookie_strictness%' |
to keep camelCase as the others
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe even just $cookieStrictness, it's always JWT in this context
| ->info('Domain where to set the Mercure auth cookie, e.g. ".example.com".') | ||
| ->defaultNull() | ||
| ->end() | ||
| ->booleanNode('jwt_cookie_strictness') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe as booleanNode might be not good if we have to consider SAMESITE_LAX use case too, might need a followup for https://github.com/pimcore/direct-edit/pull/85 in case
| private UrlServiceInterface $urlService, | ||
| private int $cookieLifetime = 3600, | ||
| private string $cookieSameSite = Cookie::SAMESITE_STRICT, | ||
| private bool $jwt_cookie_strictness = true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| private bool $jwt_cookie_strictness = true, | |
| private bool $jwtCookieStrictness = true, |
| true, | ||
| false, | ||
| $this->cookieSameSite | ||
| $this->jwt_cookie_strictness ? Cookie::SAMESITE_STRICT : Cookie::SAMESITE_NONE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| $this->jwt_cookie_strictness ? Cookie::SAMESITE_STRICT : Cookie::SAMESITE_NONE | |
| $this->jwtCookieStrictness ? Cookie::SAMESITE_STRICT : Cookie::SAMESITE_NONE |



On Pimcore PaaS, we'd like to switch from running Mercure in a side app to running Mercure as a Service.
But running Mercure as a Service implies that we run it on a subdomain.
Those modifications are required for the authentication layer.
There are also changes required in studio-ui-bundle, see pimcore/studio-ui-bundle#2095.