DigestProcessingFilter now provides userCache getter and setter.

This commit is contained in:
Ben Alex 2005-03-21 08:03:11 +00:00
parent 0530351f0d
commit c936801842
3 changed files with 25 additions and 0 deletions

View File

@ -435,6 +435,14 @@ public class DigestProcessingFilter implements Filter, InitializingBean {
return digestMd5; return digestMd5;
} }
public void setUserCache(UserCache userCache) {
this.userCache = userCache;
}
public UserCache getUserCache() {
return userCache;
}
public void init(FilterConfig arg0) throws ServletException {} public void init(FilterConfig arg0) throws ServletException {}
private void fail(ServletRequest request, ServletResponse response, private void fail(ServletRequest request, ServletResponse response,

View File

@ -27,6 +27,7 @@ import net.sf.acegisecurity.context.ContextHolder;
import net.sf.acegisecurity.context.security.SecureContextImpl; import net.sf.acegisecurity.context.security.SecureContextImpl;
import net.sf.acegisecurity.context.security.SecureContextUtils; import net.sf.acegisecurity.context.security.SecureContextUtils;
import net.sf.acegisecurity.providers.dao.AuthenticationDao; import net.sf.acegisecurity.providers.dao.AuthenticationDao;
import net.sf.acegisecurity.providers.dao.UserCache;
import net.sf.acegisecurity.providers.dao.UsernameNotFoundException; import net.sf.acegisecurity.providers.dao.UsernameNotFoundException;
import net.sf.acegisecurity.util.StringSplitUtils; import net.sf.acegisecurity.util.StringSplitUtils;
@ -193,6 +194,11 @@ public class DigestProcessingFilterTests extends TestCase {
filter.setAuthenticationEntryPoint(new DigestProcessingFilterEntryPoint()); filter.setAuthenticationEntryPoint(new DigestProcessingFilterEntryPoint());
assertTrue(filter.getAuthenticationEntryPoint() != null); assertTrue(filter.getAuthenticationEntryPoint() != null);
filter.setUserCache(null);
assertNull(filter.getUserCache());
filter.setUserCache(new MockUserCache());
assertNotNull(filter.getUserCache());
} }
public void testInvalidDigestAuthorizationTokenGeneratesError() public void testInvalidDigestAuthorizationTokenGeneratesError()
@ -885,4 +891,14 @@ public class DigestProcessingFilterTests extends TestCase {
} }
} }
} }
private class MockUserCache implements UserCache {
public UserDetails getUserFromCache(String username) {
return null;
}
public void putUserInCache(UserDetails user) {}
public void removeUserFromCache(String username) {}
}
} }

View File

@ -37,6 +37,7 @@
<action dev="benalex" type="fix">TokenBasedRememberMeServices now respects expired users, expired credentials and disabled users</action> <action dev="benalex" type="fix">TokenBasedRememberMeServices now respects expired users, expired credentials and disabled users</action>
<action dev="benalex" type="fix">HttpSessionContextIntegrationFilter now handles HttpSession invalidation without redirection</action> <action dev="benalex" type="fix">HttpSessionContextIntegrationFilter now handles HttpSession invalidation without redirection</action>
<action dev="benalex" type="fix">StringSplitUtils.split() ignored delimiter argument</action> <action dev="benalex" type="fix">StringSplitUtils.split() ignored delimiter argument</action>
<action dev="benalex" type="fix">DigestProcessingFilter now provides userCache getter and setter</action>
</release> </release>
<release version="0.8.0" date="2005-03-03"> <release version="0.8.0" date="2005-03-03">
<action dev="benalex" type="add">Added Digest Authentication support (RFC 2617 and RFC 2069)</action> <action dev="benalex" type="add">Added Digest Authentication support (RFC 2617 and RFC 2069)</action>