Browse Source

Register FilterChainProxy for all dispatcher types

Closes gh-12180
pull/12225/head
Marcus Da Coregio 3 years ago committed by Marcus Hert Da Coregio
parent
commit
063f06e7bf
  1. 1
      docs/modules/ROOT/pages/whats-new.adoc
  2. 5
      web/src/main/java/org/springframework/security/web/context/AbstractSecurityWebApplicationInitializer.java
  3. 4
      web/src/test/java/org/springframework/security/web/context/AbstractSecurityWebApplicationInitializerTests.java

1
docs/modules/ROOT/pages/whats-new.adoc

@ -47,6 +47,7 @@ Use the OpenSaml 4 Support instead.
** Remove `Saml2AuthenticationToken(String, String, String, String, List)` ** Remove `Saml2AuthenticationToken(String, String, String, String, List)`
** Remove `RelyingPartyRegistration.ProviderDetails` and related methods ** Remove `RelyingPartyRegistration.ProviderDetails` and related methods
** Remove `OpenSamlAuthenticationProvider` ** Remove `OpenSamlAuthenticationProvider`
* https://github.com/spring-projects/spring-security/issues/12180[gh-12180] - Register `FilterChainProxy` for all dispatcher types
== Core == Core

5
web/src/main/java/org/springframework/security/web/context/AbstractSecurityWebApplicationInitializer.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2022 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.
@ -280,7 +280,8 @@ public abstract class AbstractSecurityWebApplicationInitializer implements WebAp
* @return * @return
*/ */
protected EnumSet<DispatcherType> getSecurityDispatcherTypes() { protected EnumSet<DispatcherType> getSecurityDispatcherTypes() {
return EnumSet.of(DispatcherType.REQUEST, DispatcherType.ERROR, DispatcherType.ASYNC); return EnumSet.of(DispatcherType.REQUEST, DispatcherType.ERROR, DispatcherType.ASYNC, DispatcherType.FORWARD,
DispatcherType.INCLUDE);
} }
/** /**

4
web/src/test/java/org/springframework/security/web/context/AbstractSecurityWebApplicationInitializerTests.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2013 the original author or authors. * Copyright 2002-2022 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.
@ -54,7 +54,7 @@ import static org.mockito.Mockito.verify;
public class AbstractSecurityWebApplicationInitializerTests { public class AbstractSecurityWebApplicationInitializerTests {
private static final EnumSet<DispatcherType> DEFAULT_DISPATCH = EnumSet.of(DispatcherType.REQUEST, private static final EnumSet<DispatcherType> DEFAULT_DISPATCH = EnumSet.of(DispatcherType.REQUEST,
DispatcherType.ERROR, DispatcherType.ASYNC); DispatcherType.ERROR, DispatcherType.ASYNC, DispatcherType.FORWARD, DispatcherType.INCLUDE);
@Test @Test
public void onStartupWhenDefaultContextThenRegistersSpringSecurityFilterChain() { public void onStartupWhenDefaultContextThenRegistersSpringSecurityFilterChain() {

Loading…
Cancel
Save