1
0
mirror of synced 2026-05-22 21:33:16 +00:00

Removal of deprecated methods and classes.

This commit is contained in:
Luke Taylor
2010-06-26 16:23:42 +01:00
parent 6a79cf7be2
commit 026517f674
22 changed files with 162 additions and 1018 deletions
@@ -87,6 +87,14 @@ public class FilterSecurityInterceptor extends AbstractSecurityInterceptor imple
return this.securityMetadataSource;
}
public SecurityMetadataSource obtainSecurityMetadataSource() {
return this.securityMetadataSource;
}
public void setSecurityMetadataSource(FilterInvocationSecurityMetadataSource newSource) {
this.securityMetadataSource = newSource;
}
public Class<? extends Object> getSecureObjectClass() {
return FilterInvocation.class;
}
@@ -127,22 +135,6 @@ public class FilterSecurityInterceptor extends AbstractSecurityInterceptor imple
return observeOncePerRequest;
}
public SecurityMetadataSource obtainSecurityMetadataSource() {
return this.securityMetadataSource;
}
/**
* @deprecated use setSecurityMetadataSource instead
*/
public void setObjectDefinitionSource(FilterInvocationSecurityMetadataSource newSource) {
logger.warn("The property 'objectDefinitionSource' is deprecated. Please use 'securityMetadataSource' instead");
this.securityMetadataSource = newSource;
}
public void setSecurityMetadataSource(FilterInvocationSecurityMetadataSource newSource) {
this.securityMetadataSource = newSource;
}
public void setObserveOncePerRequest(boolean observeOncePerRequest) {
this.observeOncePerRequest = observeOncePerRequest;
}
@@ -1,17 +0,0 @@
package org.springframework.security.web.authentication;
/**
* Renamed class, retained for backwards compatibility.
* <p>
* See {@link AbstractAuthenticationProcessingFilter}.
*
* @author Luke Taylor
* @deprecated Use AbstractAuthenticationProcessingFilter instead.
*/
@Deprecated
public abstract class AbstractProcessingFilter extends AbstractAuthenticationProcessingFilter {
protected AbstractProcessingFilter(String defaultFilterProcessesUrl) {
super(defaultFilterProcessesUrl);
}
}
@@ -1,14 +0,0 @@
package org.springframework.security.web.authentication;
/**
* Renamed class, retained for backwards compatibility.
* <p>
* See {@link UsernamePasswordAuthenticationFilter}.
*
* @author Luke Taylor
* @deprecated Use UsernamePasswordAuthenticationFilter instead.
*/
public class AuthenticationProcessingFilter extends UsernamePasswordAuthenticationFilter {
}
@@ -1,13 +0,0 @@
package org.springframework.security.web.authentication;
/**
* Renamed class, retained for backwards compatibility.
* <p>
* See {@link LoginUrlAuthenticationEntryPoint}.
*
* @author Luke Taylor
* @deprecated Use LoginUrlAuthenticationEntryPoint instead.
*/
public class AuthenticationProcessingFilterEntryPoint extends LoginUrlAuthenticationEntryPoint{
}
@@ -1,15 +0,0 @@
package org.springframework.security.web.authentication.preauth;
import org.springframework.security.web.authentication.Http403ForbiddenEntryPoint;
/**
* Renamed class, retained for backwards compatibility.
* <p>
* See {@link Http403ForbiddenEntryPoint}.
*
* @author Luke Taylor
* @deprecated Use Http403ForbiddenEntryPoint instead.
*/
public class PreAuthenticatedProcessingFilterEntryPoint extends Http403ForbiddenEntryPoint {
}
@@ -222,40 +222,6 @@ public class HttpSessionSecurityContextRepository implements SecurityContextRepo
return context;
}
@SuppressWarnings("unchecked")
@Deprecated
/**
* Sets the {@code SecurityContext} implementation class.
*
* @deprecated use a custom {@code SecurityContextHolderStrategy} where the {@code createEmptyContext} method
* returns the correct implementation.
*/
public void setSecurityContextClass(Class contextClass) {
if (contextClass == null || (!SecurityContext.class.isAssignableFrom(contextClass))) {
throw new IllegalArgumentException("securityContextClass must implement SecurityContext "
+ "(typically use org.springframework.security.core.context.SecurityContextImpl; existing class is "
+ contextClass + ")");
}
this.securityContextClass = contextClass;
contextObject = generateNewContext();
}
/**
* Normally, the {@code SecurityContext} retrieved from the session is stored directly in the
* {@code SecurityContextHolder}, meaning that it is shared between concurrent threads.
* In this case, if one thread modifies the contents of the context, all threads will see the same
* change.
*
* @param cloneFromHttpSession set to true to clone the security context retrieved from the session.
* Defaults to false.
* @deprecated Override the {@code loadContext} method and copy the created context instead.
*/
@Deprecated
public void setCloneFromHttpSession(boolean cloneFromHttpSession) {
this.cloneFromHttpSession = cloneFromHttpSession;
}
/**
* If set to true (the default), a session will be created (if required) to store the security context if it is
* determined that its contents are different from the default empty context value.
@@ -18,20 +18,6 @@ import org.springframework.security.web.context.SaveContextOnUpdateOrErrorRespon
public class HttpSessionSecurityContextRepositoryTests {
private final TestingAuthenticationToken testToken = new TestingAuthenticationToken("someone", "passwd", "ROLE_A");
@Test(expected=IllegalArgumentException.class)
@Deprecated
public void detectsInvalidContextClass() throws Exception {
HttpSessionSecurityContextRepository repo = new HttpSessionSecurityContextRepository();
repo.setSecurityContextClass(String.class);
}
@Deprecated
@Test(expected=IllegalArgumentException.class)
public void cannotSetNullContextClass() throws Exception {
HttpSessionSecurityContextRepository repo = new HttpSessionSecurityContextRepository();
repo.setSecurityContextClass(null);
}
@Test
public void sessionIsntCreatedIfContextDoesntChange() throws Exception {
HttpSessionSecurityContextRepository repo = new HttpSessionSecurityContextRepository();
@@ -162,30 +148,6 @@ public class HttpSessionSecurityContextRepositoryTests {
assertNull(request.getSession(false));
}
@Test
@Deprecated
public void settingCloneFromContextLoadsClonedContextObject() throws Exception {
HttpSessionSecurityContextRepository repo = new HttpSessionSecurityContextRepository();
repo.setCloneFromHttpSession(true);
MockHttpServletRequest request = new MockHttpServletRequest();
MockContext contextBefore = new MockContext();
request.getSession().setAttribute(HttpSessionSecurityContextRepository.SPRING_SECURITY_CONTEXT_KEY, contextBefore);
contextBefore.setAuthentication(testToken);
MockHttpServletResponse response = new MockHttpServletResponse();
HttpRequestResponseHolder holder = new HttpRequestResponseHolder(request, response);
SecurityContext loadedContext = repo.loadContext(holder);
assertTrue(loadedContext instanceof MockContext);
assertFalse(loadedContext == contextBefore);
}
@Test
@Deprecated
public void generateNewContextWorksWithContextClass() throws Exception {
HttpSessionSecurityContextRepository repo = new HttpSessionSecurityContextRepository();
repo.setSecurityContextClass(MockContext.class);
assertTrue(repo.generateNewContext() instanceof MockContext);
}
@Test
@SuppressWarnings("deprecation")
public void sessionDisableUrlRewritingPreventsSessionIdBeingWrittenToUrl() throws Exception {