You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feature #45907 [SecurityBundle] Allow specifying attributes for RequestMatcher (freiondrej-lmc)
This PR was squashed before being merged into the 6.2 branch.
Discussion
----------
[SecurityBundle] Allow specifying attributes for `RequestMatcher`
| Q | A
| ------------- | ---
| Branch? | 6.1
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | Fix #45901
| License | MIT
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"].
Commits
-------
c19d1cb3ef [SecurityBundle] Allow specifying attributes for `RequestMatcher`
thrownewInvalidConfigurationException('The "request_matcher" option should not be specified alongside other options. Consider integrating your constraints inside your RequestMatcher directly.');
thrownewInvalidConfigurationException('The "route" option should not be specified alongside "attributes._route" option. Use just one of the options.');
0 commit comments