|
@@ -1,5 +1,5 @@
|
|
/*
|
|
/*
|
|
- * Copyright 2002-2024 the original author or authors.
|
|
|
|
|
|
+ * Copyright 2002-2025 the original author or authors.
|
|
*
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* you may not use this file except in compliance with the License.
|
|
@@ -44,6 +44,7 @@ import org.springframework.security.provisioning.InMemoryUserDetailsManager
|
|
import org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.*
|
|
import org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.*
|
|
import org.springframework.security.web.SecurityFilterChain
|
|
import org.springframework.security.web.SecurityFilterChain
|
|
import org.springframework.security.web.access.intercept.RequestAuthorizationContext
|
|
import org.springframework.security.web.access.intercept.RequestAuthorizationContext
|
|
|
|
+import org.springframework.security.web.util.matcher.DispatcherTypeRequestMatcher
|
|
import org.springframework.security.web.util.matcher.RegexRequestMatcher
|
|
import org.springframework.security.web.util.matcher.RegexRequestMatcher
|
|
import org.springframework.test.web.servlet.MockMvc
|
|
import org.springframework.test.web.servlet.MockMvc
|
|
import org.springframework.test.web.servlet.get
|
|
import org.springframework.test.web.servlet.get
|
|
@@ -632,7 +633,6 @@ class AuthorizeHttpRequestsDslTests {
|
|
open fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
|
open fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
|
http {
|
|
http {
|
|
authorizeHttpRequests {
|
|
authorizeHttpRequests {
|
|
- shouldFilterAllDispatcherTypes = true
|
|
|
|
authorize(anyRequest, denyAll)
|
|
authorize(anyRequest, denyAll)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -671,7 +671,6 @@ class AuthorizeHttpRequestsDslTests {
|
|
open fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
|
open fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
|
http {
|
|
http {
|
|
authorizeHttpRequests {
|
|
authorizeHttpRequests {
|
|
- shouldFilterAllDispatcherTypes = true
|
|
|
|
authorize(anyRequest, permitAll)
|
|
authorize(anyRequest, permitAll)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -710,7 +709,8 @@ class AuthorizeHttpRequestsDslTests {
|
|
open fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
|
open fun securityFilterChain(http: HttpSecurity): SecurityFilterChain {
|
|
http {
|
|
http {
|
|
authorizeHttpRequests {
|
|
authorizeHttpRequests {
|
|
- shouldFilterAllDispatcherTypes = false
|
|
|
|
|
|
+ authorize(DispatcherTypeRequestMatcher(DispatcherType.ERROR), permitAll)
|
|
|
|
+ authorize(DispatcherTypeRequestMatcher(DispatcherType.ASYNC), permitAll)
|
|
authorize(anyRequest, denyAll)
|
|
authorize(anyRequest, denyAll)
|
|
}
|
|
}
|
|
}
|
|
}
|