Introduce Ordered Filter and WebFilter interfaces
Add `Ordered` variants of `javax.servlet.Filter` and `org.springframework.web.server.WebFilter` mainly so that we can deprecate `FilterRegistrationBean.REQUEST_WRAPPER_FILTER_MAX_ORDER`. Closes gh-14793
This commit is contained in:
@@ -25,7 +25,7 @@ import java.util.UUID;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.boot.web.servlet.DispatcherType;
|
||||
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||
import org.springframework.boot.web.servlet.filter.OrderedFilter;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
@@ -58,7 +58,7 @@ public class SecurityProperties implements SecurityPrerequisite {
|
||||
* other filters registered with the container). There is no connection between this
|
||||
* and the {@code @Order} on a WebSecurityConfigurer.
|
||||
*/
|
||||
public static final int DEFAULT_FILTER_ORDER = FilterRegistrationBean.REQUEST_WRAPPER_FILTER_MAX_ORDER
|
||||
public static final int DEFAULT_FILTER_ORDER = OrderedFilter.REQUEST_WRAPPER_FILTER_MAX_ORDER
|
||||
- 100;
|
||||
|
||||
private final Filter filter = new Filter();
|
||||
|
||||
@@ -32,7 +32,7 @@ import org.springframework.boot.autoconfigure.orm.jpa.test.City;
|
||||
import org.springframework.boot.test.context.runner.WebApplicationContextRunner;
|
||||
import org.springframework.boot.test.rule.OutputCapture;
|
||||
import org.springframework.boot.web.servlet.DelegatingFilterProxyRegistrationBean;
|
||||
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||
import org.springframework.boot.web.servlet.filter.OrderedFilter;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
@@ -85,8 +85,7 @@ public class SecurityAutoConfigurationTests {
|
||||
.getBean("securityFilterChainRegistration",
|
||||
DelegatingFilterProxyRegistrationBean.class)
|
||||
.getOrder()).isEqualTo(
|
||||
FilterRegistrationBean.REQUEST_WRAPPER_FILTER_MAX_ORDER
|
||||
- 100));
|
||||
OrderedFilter.REQUEST_WRAPPER_FILTER_MAX_ORDER - 100));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -126,8 +125,7 @@ public class SecurityAutoConfigurationTests {
|
||||
.getBean("securityFilterChainRegistration",
|
||||
DelegatingFilterProxyRegistrationBean.class)
|
||||
.getOrder()).isEqualTo(
|
||||
FilterRegistrationBean.REQUEST_WRAPPER_FILTER_MAX_ORDER
|
||||
- 100));
|
||||
OrderedFilter.REQUEST_WRAPPER_FILTER_MAX_ORDER - 100));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user