Skip to content

Commit c263c85

Browse files
committed
Start building against Spring Security 6.5.0-RC1 snapshots
See gh-45147
1 parent 7abfde7 commit c263c85

File tree

8 files changed

+22
-14
lines changed

8 files changed

+22
-14
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryActuatorAutoConfiguration.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
import org.springframework.security.config.annotation.web.WebSecurityConfigurer;
6363
import org.springframework.security.config.annotation.web.builders.WebSecurity;
6464
import org.springframework.security.config.annotation.web.configuration.WebSecurityCustomizer;
65-
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
6665
import org.springframework.security.web.util.matcher.OrRequestMatcher;
6766
import org.springframework.security.web.util.matcher.RequestMatcher;
6867
import org.springframework.web.cors.CorsConfiguration;
@@ -184,12 +183,15 @@ static class IgnoredCloudFoundryPathsWebSecurityCustomizer implements WebSecurit
184183
}
185184

186185
@Override
186+
@SuppressWarnings("removal")
187187
public void customize(WebSecurity web) {
188188
List<RequestMatcher> requestMatchers = new ArrayList<>();
189189
this.pathMappedEndpoints.getAllPaths()
190-
.forEach((path) -> requestMatchers.add(new AntPathRequestMatcher(path + "/**")));
191-
requestMatchers.add(new AntPathRequestMatcher(BASE_PATH));
192-
requestMatchers.add(new AntPathRequestMatcher(BASE_PATH + "/"));
190+
.forEach((path) -> requestMatchers
191+
.add(new org.springframework.security.web.util.matcher.AntPathRequestMatcher(path + "/**")));
192+
requestMatchers.add(new org.springframework.security.web.util.matcher.AntPathRequestMatcher(BASE_PATH));
193+
requestMatchers
194+
.add(new org.springframework.security.web.util.matcher.AntPathRequestMatcher(BASE_PATH + "/"));
193195
web.ignoring().requestMatchers(new OrRequestMatcher(requestMatchers));
194196
}
195197

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/servlet/AntPathRequestMatcherProvider.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,11 @@ class AntPathRequestMatcherProvider implements RequestMatcherProvider {
3737
}
3838

3939
@Override
40+
@SuppressWarnings("removal")
4041
public RequestMatcher getRequestMatcher(String pattern, HttpMethod httpMethod) {
4142
String path = this.pathFactory.apply(pattern);
42-
return new AntPathRequestMatcher(path, (httpMethod != null) ? httpMethod.name() : null);
43+
return new org.springframework.security.web.util.matcher.AntPathRequestMatcher(path,
44+
(httpMethod != null) ? httpMethod.name() : null);
4345
}
4446

4547
}

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/servlet/EndpointRequest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
import org.springframework.core.annotation.MergedAnnotation;
4343
import org.springframework.core.annotation.MergedAnnotations;
4444
import org.springframework.http.HttpMethod;
45-
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
4645
import org.springframework.security.web.util.matcher.OrRequestMatcher;
4746
import org.springframework.security.web.util.matcher.RequestMatcher;
4847
import org.springframework.util.Assert;
@@ -232,12 +231,14 @@ protected List<RequestMatcher> getLinksMatchers(RequestMatcherFactory requestMat
232231
return linksMatchers;
233232
}
234233

234+
@SuppressWarnings("removal")
235235
protected RequestMatcherProvider getRequestMatcherProvider(WebApplicationContext context) {
236236
try {
237237
return getRequestMatcherProviderBean(context);
238238
}
239239
catch (NoSuchBeanDefinitionException ex) {
240-
return (pattern, method) -> new AntPathRequestMatcher(pattern, (method != null) ? method.name() : null);
240+
return (pattern, method) -> new org.springframework.security.web.util.matcher.AntPathRequestMatcher(
241+
pattern, (method != null) ? method.name() : null);
241242
}
242243
}
243244

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/servlet/PathRequest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import org.springframework.boot.autoconfigure.security.StaticResourceLocation;
2525
import org.springframework.boot.security.servlet.ApplicationContextRequestMatcher;
2626
import org.springframework.boot.web.context.WebServerApplicationContext;
27-
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
2827
import org.springframework.security.web.util.matcher.RequestMatcher;
2928
import org.springframework.web.context.WebApplicationContext;
3029

@@ -77,8 +76,10 @@ protected boolean ignoreApplicationContext(WebApplicationContext applicationCont
7776
}
7877

7978
@Override
79+
@SuppressWarnings("removal")
8080
protected void initialized(Supplier<H2ConsoleProperties> h2ConsoleProperties) {
81-
this.delegate = new AntPathRequestMatcher(h2ConsoleProperties.get().getPath() + "/**");
81+
this.delegate = new org.springframework.security.web.util.matcher.AntPathRequestMatcher(
82+
h2ConsoleProperties.get().getPath() + "/**");
8283
}
8384

8485
@Override

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/servlet/StaticResourceRequest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import org.springframework.boot.autoconfigure.web.servlet.DispatcherServletPath;
2929
import org.springframework.boot.security.servlet.ApplicationContextRequestMatcher;
3030
import org.springframework.boot.web.context.WebServerApplicationContext;
31-
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
3231
import org.springframework.security.web.util.matcher.OrRequestMatcher;
3332
import org.springframework.security.web.util.matcher.RequestMatcher;
3433
import org.springframework.util.Assert;
@@ -135,8 +134,10 @@ protected void initialized(Supplier<DispatcherServletPath> dispatcherServletPath
135134
this.delegate = new OrRequestMatcher(getDelegateMatchers(dispatcherServletPath.get()).toList());
136135
}
137136

137+
@SuppressWarnings("removal")
138138
private Stream<RequestMatcher> getDelegateMatchers(DispatcherServletPath dispatcherServletPath) {
139-
return getPatterns(dispatcherServletPath).map(AntPathRequestMatcher::new);
139+
return getPatterns(dispatcherServletPath)
140+
.map(org.springframework.security.web.util.matcher.AntPathRequestMatcher::new);
140141
}
141142

142143
private Stream<String> getPatterns(DispatcherServletPath dispatcherServletPath) {

spring-boot-project/spring-boot-dependencies/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2362,7 +2362,7 @@ bom {
23622362
releaseNotes("https://github.com/spring-projects/spring-retry/releases/tag/v{version}")
23632363
}
23642364
}
2365-
library("Spring Security", "6.5.0-M3") {
2365+
library("Spring Security", "6.5.0-SNAPSHOT") {
23662366
considerSnapshots()
23672367
group("org.springframework.security") {
23682368
bom("spring-security-bom")

spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/autoconfigure/RemoteDevtoolsSecurityConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
2626
import org.springframework.security.config.annotation.web.configurers.CsrfConfigurer;
2727
import org.springframework.security.web.SecurityFilterChain;
28-
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
2928

3029
/**
3130
* Spring Security configuration that allows anonymous access to the remote devtools
@@ -46,9 +45,10 @@ class RemoteDevtoolsSecurityConfiguration {
4645
}
4746

4847
@Bean
48+
@SuppressWarnings("removal")
4949
@Order(SecurityProperties.BASIC_AUTH_ORDER - 1)
5050
SecurityFilterChain devtoolsSecurityFilterChain(HttpSecurity http) throws Exception {
51-
http.securityMatcher(new AntPathRequestMatcher(this.url));
51+
http.securityMatcher(new org.springframework.security.web.util.matcher.AntPathRequestMatcher(this.url));
5252
http.authorizeHttpRequests((requests) -> requests.anyRequest().anonymous());
5353
http.csrf(CsrfConfigurer::disable);
5454
return http.build();

spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator-custom-security/src/main/java/smoketest/actuator/customsecurity/SecurityConfiguration.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ private UserDetails createUserDetails(String username, String password, String..
5858
}
5959

6060
@Bean
61+
@SuppressWarnings("removal")
6162
SecurityFilterChain configure(HttpSecurity http, HandlerMappingIntrospector handlerMappingIntrospector)
6263
throws Exception {
6364
http.authorizeHttpRequests((requests) -> {

0 commit comments

Comments
 (0)