1
0
mirror of synced 2026-08-04 17:27:13 +00:00

Removal of ParsingPathMatcher

Changes needed for the removal of ParsingPathMatcher in Spring Framework

https://github.com/spring-projects/spring-framework/commit/b1440b681663c4087ca19fdb755598b7c9706c11#diff-972650c759c249004b9725f94b570db3R156
This commit is contained in:
Rob Winch
2017-08-02 11:11:11 -05:00
parent 0f0563cd6f
commit bfaead6f68
5 changed files with 58 additions and 59 deletions
@@ -17,6 +17,7 @@ package org.springframework.security.config.web.server;
import org.springframework.http.HttpMethod;
import org.springframework.security.web.server.util.matcher.OrServerWebExchangeMatcher;
import org.springframework.security.web.server.util.matcher.PathPatternParserServerWebExchangeMatcher;
import org.springframework.security.web.server.util.matcher.ServerWebExchangeMatcher;
import org.springframework.security.web.server.util.matcher.ServerWebExchangeMatchers;
@@ -40,7 +41,7 @@ abstract class AbstractServerWebExchangeMatcherRegistry<T> {
/**
* Maps a {@link List} of
* {@link org.springframework.security.web.server.util.matcher.PathMatcherServerWebExchangeMatcher}
* {@link PathPatternParserServerWebExchangeMatcher}
* instances.
*
* @param method the {@link HttpMethod} to use for any
@@ -54,13 +55,13 @@ abstract class AbstractServerWebExchangeMatcherRegistry<T> {
/**
* Maps a {@link List} of
* {@link org.springframework.security.web.server.util.matcher.PathMatcherServerWebExchangeMatcher}
* {@link PathPatternParserServerWebExchangeMatcher}
* instances.
*
* @param method the {@link HttpMethod} to use or {@code null} for any
* {@link HttpMethod}.
* @param antPatterns the ant patterns to create. If {@code null} or empty, then matches on nothing.
* {@link org.springframework.security.web.server.util.matcher.PathMatcherServerWebExchangeMatcher} from
* {@link PathPatternParserServerWebExchangeMatcher} from
*
* @return the object that is chained after creating the {@link ServerWebExchangeMatcher}
*/
@@ -70,11 +71,11 @@ abstract class AbstractServerWebExchangeMatcherRegistry<T> {
/**
* Maps a {@link List} of
* {@link org.springframework.security.web.server.util.matcher.PathMatcherServerWebExchangeMatcher}
* {@link PathPatternParserServerWebExchangeMatcher}
* instances that do not care which {@link HttpMethod} is used.
*
* @param antPatterns the ant patterns to create
* {@link org.springframework.security.web.server.util.matcher.PathMatcherServerWebExchangeMatcher} from
* {@link PathPatternParserServerWebExchangeMatcher} from
*
* @return the object that is chained after creating the {@link ServerWebExchangeMatcher}
*/
@@ -32,8 +32,7 @@ import org.springframework.security.core.userdetails.UserDetailsRepository;
import org.springframework.security.test.web.reactive.server.WebTestClientBuilder;
import org.springframework.security.web.server.SecurityWebFilterChain;
import org.springframework.security.web.server.WebFilterChainFilter;
import org.springframework.security.web.server.util.matcher.PathMatcherServerWebExchangeMatcher;
import org.springframework.security.web.server.util.matcher.ServerWebExchangeMatcher;
import org.springframework.security.web.server.util.matcher.PathPatternParserServerWebExchangeMatcher;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.reactive.server.WebTestClient;
@@ -101,7 +100,7 @@ public class EnableWebFluxSecurityTests {
@Bean
public SecurityWebFilterChain apiHttpSecurity(HttpSecurity http) {
http
.securityMatcher(new PathMatcherServerWebExchangeMatcher("/api/**"))
.securityMatcher(new PathPatternParserServerWebExchangeMatcher("/api/**"))
.authorizeExchange()
.anyExchange().denyAll();
return http.build();