mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-03-04 12:29:09 +00:00
Revert "SEC-2045: AbstractPreAuthenticationFilter afterPropertiesSet invokes super"
This commit contains the wrong JIRA ID. This reverts commit c53fd99430739ced5289c6bbe5c50563710fa610.
This commit is contained in:
parent
9e35e4aab4
commit
8a54d597af
@ -68,12 +68,6 @@ public abstract class AbstractPreAuthenticatedProcessingFilter extends GenericFi
|
||||
*/
|
||||
@Override
|
||||
public void afterPropertiesSet() {
|
||||
try {
|
||||
super.afterPropertiesSet();
|
||||
} catch(ServletException e) {
|
||||
// convert to RuntimeException for passivity on afterPropertiesSet signature
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
Assert.notNull(authenticationManager, "An AuthenticationManager must be set");
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,6 @@ import static org.mockito.Matchers.any;
|
||||
import static org.mockito.Mockito.*;
|
||||
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.junit.After;
|
||||
@ -78,16 +77,6 @@ public class AbstractPreAuthenticatedProcessingFilterTests {
|
||||
}
|
||||
}
|
||||
|
||||
// SEC-2045
|
||||
@Test
|
||||
public void testAfterPropertiesSetInvokesSuper() throws Exception {
|
||||
ConcretePreAuthenticatedProcessingFilter filter = new ConcretePreAuthenticatedProcessingFilter();
|
||||
AuthenticationManager am = mock(AuthenticationManager.class);
|
||||
filter.setAuthenticationManager(am);
|
||||
filter.afterPropertiesSet();
|
||||
assertTrue(filter.initFilterBeanInvoked);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDoFilterAuthenticated() throws Exception {
|
||||
testDoFilter(true);
|
||||
@ -151,18 +140,12 @@ public class AbstractPreAuthenticatedProcessingFilterTests {
|
||||
|
||||
private static class ConcretePreAuthenticatedProcessingFilter extends AbstractPreAuthenticatedProcessingFilter {
|
||||
private String principal = "testPrincipal";
|
||||
private boolean initFilterBeanInvoked;
|
||||
protected Object getPreAuthenticatedPrincipal(HttpServletRequest httpRequest) {
|
||||
return principal;
|
||||
}
|
||||
protected Object getPreAuthenticatedCredentials(HttpServletRequest httpRequest) {
|
||||
return "testCredentials";
|
||||
}
|
||||
@Override
|
||||
protected void initFilterBean() throws ServletException {
|
||||
super.initFilterBean();
|
||||
initFilterBeanInvoked = true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user