-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Add PathPatternRequestMatcher #16499
Conversation
bdd1cf1
to
12f1cf2
Compare
bca1d7f
to
a22f87d
Compare
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 all of your work on this @jzheaux! I've provided feedback below:
.../java/org/springframework/security/config/annotation/web/AbstractRequestMatcherRegistry.java
Outdated
Show resolved
Hide resolved
docs/modules/ROOT/pages/servlet/authorization/authorize-http-requests.adoc
Show resolved
Hide resolved
docs/modules/ROOT/pages/servlet/authorization/authorize-http-requests.adoc
Outdated
Show resolved
Hide resolved
web/src/main/java/org/springframework/security/web/util/matcher/RequestMatchers.java
Outdated
Show resolved
Hide resolved
web/src/main/java/org/springframework/security/web/util/matcher/RequestMatchers.java
Outdated
Show resolved
Hide resolved
web/src/main/java/org/springframework/security/web/util/matcher/RequestMatchers.java
Outdated
Show resolved
Hide resolved
...in/java/org/springframework/security/web/servlet/util/matcher/PathPatternRequestMatcher.java
Show resolved
Hide resolved
This static factory simplifes the creation of RequestMatchers that specify the servlet path and other request elements Closes spring-projectsgh-16430
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 all your work on this! I've provided (optional) feedback. Feel free to merge once you are comfortable.
This PR adds
PathPatternRequestMatcher
, a request matcher that doesn't requireHandlerMappingIntrospector
.Also, it adds a servlet-aware builder for specifying the servlet path (using this request matcher) in a way that looks similar to Kotlin and XML:
Future tickets like #16509 are taking a look at a first-class way to represent the servlet inside the authorization DSL. This builder is still helpful since there are many other places in the Java DSL where request matchers are provided that may need the servlet path specified.