-
Notifications
You must be signed in to change notification settings - Fork 3
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
IBX-8356: Reworked Ibexa\Core\MVC\Symfony\Security\Authentication\AuthenticatorInterface
usages to comply with Symfony-based authentication
#101
Conversation
Ibexa\Core\MVC\Symfony\Security\Authentication\AuthenticatorInterface
usages to comply with Symfony-based authentication
b0508ca
to
a3b1471
Compare
d7547bf
to
e73f707
Compare
9d185ea
to
5c75500
Compare
bce578a
to
02f4263
Compare
9c8f8c2
to
b23cde0
Compare
02f4263
to
37babd1
Compare
src/lib/Security/EventListener/JWT/AuthenticationSuccessSubscriber.php
Outdated
Show resolved
Hide resolved
I would need to know why the matcher specifically is being dropped, and what will be the new expected user configuration. We used to use |
Can you please elaborate which matcher you have in mind? The configuration is tackled within https://github.com/ibexa/recipes-dev/pull/122/files. |
3173e5b
to
50f9fbe
Compare
|
…ype headers are provided
…thenticatorInterface` usages to comply with Symfony-based authentication
…thenticatorInterface` usages to comply with Symfony-based authentication
…thenticatorInterface` usages to comply with Symfony-based authentication
…be dropped on the new REST API release
99e5fea
to
c7df328
Compare
e94ba89
to
35307f0
Compare
Quality Gate passedIssues Measures |
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.
Small suggestion for follow-up PR:
When using unsupported XML format error description could be more user friendly.
Now it states: "You must provide a ValueObject for visiting, "NULL" provided."
It's something we might address when swapping over to Symfony Serializer for request parsing. Our current Visitors are barely performing sanity checks at all, and that error sounds more like something PHP would spew on it's own. |
Related PRs:
Ibexa\Core\MVC\Symfony\Security\Authentication\AuthenticatorInterface
to be replaced with Symfony-based authentication core#375 (will be merged at the end, not blocking this part)Description:
Reimplemented JWT authentication. The need for that comes from the fact, that
Ibexa\Core\MVC\Symfony\Security\Authentication\AuthenticatorInterface
relies on deprecated Symfony authorization mechanisms and will be dropped.Reworked to be compliant with https://symfony.com/bundles/LexikJWTAuthenticationBundle/current/index.html#symfony-5-3-and-higher. The third-party provider has already moved to Symfony
json_login
authenticator so we are just adapting our implementation accordingly.Few important changes:
Content-Type: application/vnd.ibexa.api.JWT+json
header can still be used for keeping the whole solution BC safe, however the new authenticator should be referenced viaContent-Type: application/json
header instead,JsonLoginHeaderReplacingSubscriber
which replaces mentioned header on the fly. I also left aTODO
note to remember it should be dropped once the new REST API version is released. I am open for suggestions how to improve such reminder,SecurityListener
and kind of replaced it withAuthenticationSuccessSubscriber
- it sets current repository user on successful authentication and normalize the end response to be in-tact with the previous one (another BC-safe piece of code). The reason for that is thatjson_login
handles the response outside and forms it similar to:Ibexa\Rest\Server\Controller\JWT::createToken
- all the heavy lifting is done by thejson_login
authenticator so it's not needed anymore. The whole controller was left though, as to my understanding it is needed for the route to be configured properly. If this is wrong, the whole class can just be dropped,src/lib/Security/AuthorizationHeaderRESTRequestMatcher.php
was moved out of contracts and marked as@internal
as we shouldn't allow manipulating with such vital part of the authentication process,For QA:
Documentation:
We need to mention changes to payload, response and headers described above as much as removed/moved classes.