-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[SecurityBundle] Allow specifying attributes for RequestMatcher
#45907
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
Conversation
Hey! To help keep things organized, we don't allow "Draft" pull requests. Could you please click the "ready for review" button or close this PR and open a new one when you are done? Note that a pull request does not have to be "perfect" or "ready for merge" when you first open it. We just want it to be ready for a first review. Cheers! Carsonbot |
Hey! I see that this is your first PR. That is great! Welcome! Symfony has a contribution guide which I suggest you to read. In short:
Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change. When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor! I am going to sit back now and wait for the reviews. Cheers! Carsonbot |
Hey! I think @monteiro has recently worked with this code. Maybe they can help review this? Cheers! Carsonbot |
Thanks for the PR. Please rebase and target 6.1 since that's a new feature. Please also update the description of the PR a bit so that ppl that wonder about what the attached patch does can have some clues (eg to start writing the doc about this). |
3e6b8ce
to
a45ecd1
Compare
@carsonbot please find me a reviewer |
@freiondrej-lmc Thanks for the PR!
The 6.1 branch is feature-frozen, as such the current focus should be about stabilizing 6.1. So this is for 6.2 and we have 6 months to review and fine-tune it. |
RequestMatcher
I think you can ignore the failing test case, its from another PR |
Well most of it is, but also mine:
https://github.com/symfony/symfony/actions/runs/3098415653/jobs/5016302933 |
@OskarStark I now ran the tests locally and I did not get this error with my code. Maybe there are some changes from a different PR involved? I don’t know the details of the pipeline and how isolated the PRs are from each other 😕 any help will be much appreciated! |
@OskarStark any ideas would be very welcome. Will this PR even make it into 6.2? |
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.
(test failures are unrelated)
Thank you @freiondrej-lmc. |
@freiondrej-lmc The remaining failures that you mentioned in #45907 (comment) were related to the refactoring of the request matchers that happened in the meantime in #47595. #47930 is going to fix them. |
…te matcher (wouterj) This PR was merged into the 6.2 branch. Discussion ---------- [SecurityBundle] Add XML support for new request attribute matcher | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - This adds support for the XML format to the new attribute request matching options (ref #45907). Commits ------- aa64204 [SecurityBundle] Add XML support for new request attribute matcher
The \Symfony\Component\HttpFoundation\RequestMatcher supports array $attributes, which makes it possible to specify a _route (useful e.g. in a multilingual project where $path is translated). However, its current configuration does not offer the possibility to specify the attributes. This PR adds this possibility, so this already existing feature can be leveraged.
I also added a shortcut to just specify "route": "xxx", which translates to "attributes": ["_route": "xxx"].