-
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
RFC: Move REST route recognition after routing resolves #130
base: 4.6
Are you sure you want to change the base?
Conversation
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.
It could be a bit confusing. We have X-Siteaccess
header. While I get it's not working as expected, is there a possibility to fix that?
Second thing, so now we execute the same check twice in onKernelRequest
and addAttributeForIbexaRestRoute
. If we go with that solution can we keep just one method?
It is working as expected. All this does is expose REST routes under site-access aware prefixes, and results in both methods of switching to a different site-access to work. (
Currently yes. There is an argument to be made to keep the old method still executing since it is "almost" a contract. There might be packages or developers that rely on a particular order of event listeners. |
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.
Could you please elaborate a bit on the origins of this change? I don't fully get the necessity of it.
Sure. Our frontend is using - or rather, would like to use - However, route generated there uses So my suggestion is: move REST route recognition later down in the event chain. That way we will have access to the "actual" route, with site access prefix stripped. I've done basic checks and REST works properly still when this is moved into lower priority - but I've left the original recognition too, because there might be code that relies on it being checked early. |
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.
Ok. But in 5.0 let's get rid of the extra event.
Description:
This PR adds a secondary check for REST API route after routing has been resolved.
This allows routes like
/admin/api/ibexa/v2
to work.Note
I removed the original method completely (
onKernelRequest
) and REST API remained functional.For QA:
Documentation: