diff --git a/core/src/main/java/org/acegisecurity/acl/basic/GrantedAuthorityEffectiveAclsResolver.java b/core/src/main/java/org/acegisecurity/acl/basic/GrantedAuthorityEffectiveAclsResolver.java index e539049a7b..e812f571e9 100644 --- a/core/src/main/java/org/acegisecurity/acl/basic/GrantedAuthorityEffectiveAclsResolver.java +++ b/core/src/main/java/org/acegisecurity/acl/basic/GrantedAuthorityEffectiveAclsResolver.java @@ -17,8 +17,8 @@ package org.acegisecurity.acl.basic; import org.acegisecurity.Authentication; import org.acegisecurity.GrantedAuthority; -import org.acegisecurity.UserDetails; import org.acegisecurity.acl.AclEntry; +import org.acegisecurity.userdetails.UserDetails; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/core/src/main/java/org/acegisecurity/concurrent/SessionRegistryUtils.java b/core/src/main/java/org/acegisecurity/concurrent/SessionRegistryUtils.java index 69df951075..5b2a2f201a 100644 --- a/core/src/main/java/org/acegisecurity/concurrent/SessionRegistryUtils.java +++ b/core/src/main/java/org/acegisecurity/concurrent/SessionRegistryUtils.java @@ -16,8 +16,8 @@ package org.acegisecurity.concurrent; import org.acegisecurity.Authentication; -import org.acegisecurity.UserDetails; import org.acegisecurity.ui.WebAuthenticationDetails; +import org.acegisecurity.userdetails.UserDetails; import org.springframework.util.Assert; diff --git a/core/src/main/java/org/acegisecurity/event/authentication/AuthenticationSwitchUserEvent.java b/core/src/main/java/org/acegisecurity/event/authentication/AuthenticationSwitchUserEvent.java index a3c8ac4862..444294f319 100644 --- a/core/src/main/java/org/acegisecurity/event/authentication/AuthenticationSwitchUserEvent.java +++ b/core/src/main/java/org/acegisecurity/event/authentication/AuthenticationSwitchUserEvent.java @@ -16,7 +16,7 @@ package org.acegisecurity.event.authentication; import org.acegisecurity.Authentication; -import org.acegisecurity.UserDetails; +import org.acegisecurity.userdetails.UserDetails; /** diff --git a/core/src/main/java/org/acegisecurity/providers/AbstractAuthenticationToken.java b/core/src/main/java/org/acegisecurity/providers/AbstractAuthenticationToken.java index 946ea5fddf..f46c867642 100644 --- a/core/src/main/java/org/acegisecurity/providers/AbstractAuthenticationToken.java +++ b/core/src/main/java/org/acegisecurity/providers/AbstractAuthenticationToken.java @@ -16,7 +16,7 @@ package org.acegisecurity.providers; import org.acegisecurity.Authentication; -import org.acegisecurity.UserDetails; +import org.acegisecurity.userdetails.UserDetails; /** diff --git a/core/src/main/java/org/acegisecurity/providers/ProviderManager.java b/core/src/main/java/org/acegisecurity/providers/ProviderManager.java index 77b321ac8b..5cf58796c0 100644 --- a/core/src/main/java/org/acegisecurity/providers/ProviderManager.java +++ b/core/src/main/java/org/acegisecurity/providers/ProviderManager.java @@ -42,7 +42,7 @@ import org.acegisecurity.event.authentication.AuthenticationFailureServiceExcept import org.acegisecurity.event.authentication.AuthenticationSuccessEvent; import org.acegisecurity.providers.cas.ProxyUntrustedException; -import org.acegisecurity.providers.dao.UsernameNotFoundException; +import org.acegisecurity.userdetails.UsernameNotFoundException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/core/src/main/java/org/acegisecurity/providers/anonymous/AnonymousProcessingFilter.java b/core/src/main/java/org/acegisecurity/providers/anonymous/AnonymousProcessingFilter.java index cfe4e2e060..3b5500d7a7 100644 --- a/core/src/main/java/org/acegisecurity/providers/anonymous/AnonymousProcessingFilter.java +++ b/core/src/main/java/org/acegisecurity/providers/anonymous/AnonymousProcessingFilter.java @@ -17,7 +17,7 @@ package org.acegisecurity.providers.anonymous; import org.acegisecurity.Authentication; import org.acegisecurity.context.SecurityContextHolder; -import org.acegisecurity.providers.dao.memory.UserAttribute; +import org.acegisecurity.userdetails.memory.UserAttribute; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/core/src/main/java/org/acegisecurity/providers/cas/CasAuthenticationProvider.java b/core/src/main/java/org/acegisecurity/providers/cas/CasAuthenticationProvider.java index 6d03891a21..3667281df8 100644 --- a/core/src/main/java/org/acegisecurity/providers/cas/CasAuthenticationProvider.java +++ b/core/src/main/java/org/acegisecurity/providers/cas/CasAuthenticationProvider.java @@ -18,12 +18,12 @@ package org.acegisecurity.providers.cas; import org.acegisecurity.Authentication; import org.acegisecurity.AuthenticationException; import org.acegisecurity.BadCredentialsException; -import org.acegisecurity.UserDetails; import org.acegisecurity.providers.AuthenticationProvider; import org.acegisecurity.providers.UsernamePasswordAuthenticationToken; import org.acegisecurity.ui.cas.CasProcessingFilter; +import org.acegisecurity.userdetails.UserDetails; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/core/src/main/java/org/acegisecurity/providers/cas/CasAuthenticationToken.java b/core/src/main/java/org/acegisecurity/providers/cas/CasAuthenticationToken.java index cffaa05e13..2b9d996b82 100644 --- a/core/src/main/java/org/acegisecurity/providers/cas/CasAuthenticationToken.java +++ b/core/src/main/java/org/acegisecurity/providers/cas/CasAuthenticationToken.java @@ -16,8 +16,8 @@ package org.acegisecurity.providers.cas; import org.acegisecurity.GrantedAuthority; -import org.acegisecurity.UserDetails; import org.acegisecurity.providers.AbstractAuthenticationToken; +import org.acegisecurity.userdetails.UserDetails; import org.springframework.util.Assert; diff --git a/core/src/main/java/org/acegisecurity/providers/cas/CasAuthoritiesPopulator.java b/core/src/main/java/org/acegisecurity/providers/cas/CasAuthoritiesPopulator.java index 2c99a74083..67a1ab989c 100644 --- a/core/src/main/java/org/acegisecurity/providers/cas/CasAuthoritiesPopulator.java +++ b/core/src/main/java/org/acegisecurity/providers/cas/CasAuthoritiesPopulator.java @@ -16,7 +16,7 @@ package org.acegisecurity.providers.cas; import org.acegisecurity.AuthenticationException; -import org.acegisecurity.UserDetails; +import org.acegisecurity.userdetails.UserDetails; /** diff --git a/core/src/main/java/org/acegisecurity/providers/cas/populator/DaoCasAuthoritiesPopulator.java b/core/src/main/java/org/acegisecurity/providers/cas/populator/DaoCasAuthoritiesPopulator.java index e8221e7614..9cc967ba25 100644 --- a/core/src/main/java/org/acegisecurity/providers/cas/populator/DaoCasAuthoritiesPopulator.java +++ b/core/src/main/java/org/acegisecurity/providers/cas/populator/DaoCasAuthoritiesPopulator.java @@ -16,16 +16,16 @@ package org.acegisecurity.providers.cas.populator; import org.acegisecurity.AuthenticationException; -import org.acegisecurity.UserDetails; import org.acegisecurity.providers.cas.CasAuthoritiesPopulator; -import org.acegisecurity.providers.dao.AuthenticationDao; +import org.acegisecurity.userdetails.UserDetailsService; +import org.acegisecurity.userdetails.UserDetails; import org.springframework.beans.factory.InitializingBean; import org.springframework.util.Assert; /** - * Populates the CAS authorities via an {@link AuthenticationDao}. + * Populates the CAS authorities via an {@link UserDetailsService}. * *
* The additional information (username, password, enabled status etc) an
@@ -41,15 +41,15 @@ public class DaoCasAuthoritiesPopulator implements CasAuthoritiesPopulator,
InitializingBean {
//~ Instance fields ========================================================
- private AuthenticationDao authenticationDao;
+ private UserDetailsService authenticationDao;
//~ Methods ================================================================
- public void setAuthenticationDao(AuthenticationDao authenticationDao) {
+ public void setAuthenticationDao(UserDetailsService authenticationDao) {
this.authenticationDao = authenticationDao;
}
- public AuthenticationDao getAuthenticationDao() {
+ public UserDetailsService getAuthenticationDao() {
return authenticationDao;
}
diff --git a/core/src/main/java/org/acegisecurity/providers/dao/AbstractUserDetailsAuthenticationProvider.java b/core/src/main/java/org/acegisecurity/providers/dao/AbstractUserDetailsAuthenticationProvider.java
index 3deb9d3ecb..a330bfe2eb 100644
--- a/core/src/main/java/org/acegisecurity/providers/dao/AbstractUserDetailsAuthenticationProvider.java
+++ b/core/src/main/java/org/acegisecurity/providers/dao/AbstractUserDetailsAuthenticationProvider.java
@@ -21,11 +21,12 @@ import org.acegisecurity.AuthenticationException;
import org.acegisecurity.CredentialsExpiredException;
import org.acegisecurity.DisabledException;
import org.acegisecurity.LockedException;
-import org.acegisecurity.UserDetails;
import org.acegisecurity.providers.AuthenticationProvider;
import org.acegisecurity.providers.UsernamePasswordAuthenticationToken;
import org.acegisecurity.providers.dao.cache.NullUserCache;
+import org.acegisecurity.userdetails.UserDetailsService;
+import org.acegisecurity.userdetails.UserDetails;
import org.springframework.beans.factory.InitializingBean;
@@ -38,7 +39,7 @@ import org.springframework.util.Assert;
/**
* A base {@link AuthenticationProvider} that allows subclasses to override and
- * work with {@link org.acegisecurity.UserDetails} objects. The class is
+ * work with {@link org.acegisecurity.userdetails.UserDetails} objects. The class is
* designed to respond to {@link UsernamePasswordAuthenticationToken}
* authentication requests.
*
@@ -63,8 +64,8 @@ import org.springframework.util.Assert;
* Caching is handled via the UserDetails
object being placed in
* the {@link UserCache}. This ensures that subsequent requests with the same
* username can be validated without needing to query the {@link
- * AuthenticationDao}. It should be noted that if a user appears to present an
- * incorrect password, the {@link AuthenticationDao} will be queried to
+ * UserDetailsService}. It should be noted that if a user appears to present an
+ * incorrect password, the {@link UserDetailsService} will be queried to
* confirm the most up-to-date password was used for comparison.
*
- * An {@link org.acegisecurity.providers.dao.AuthenticationDao} is required
+ * An {@link org.acegisecurity.userdetails.UserDetailsService} is required
* by this implementation, so that it can construct a valid
* Authentication
from the returned {@link
- * org.acegisecurity.UserDetails}. This is also necessary so that the
+ * org.acegisecurity.userdetails.UserDetails}. This is also necessary so that the
* user's password is available and can be checked as part of the encoded
* cookie.
*
- * Implemented with value object semantics (immutable after construction, like
- * a String
). Developers may use this class directly, subclass
- * it, or write their own {@link UserDetails} implementation from scratch.
+ * Implemented with value object semantics (immutable after construction, like a
+ * String
). Developers may use this class directly, subclass it,
+ * or write their own {@link UserDetails} implementation from scratch.
*
User
with the details required by {@link
- * DaoAuthenticationProvider}.
- *
- * @param username the username presented to the
- * DaoAuthenticationProvider
- * @param password the password that should be presented to the
- * DaoAuthenticationProvider
- * @param enabled set to true
if the user is enabled
- * @param authorities the authorities that should be granted to the caller
- * if they presented the correct username and password and the user
- * is enabled
- *
- * @throws IllegalArgumentException if a null
value was passed
- * either as a parameter or as an element in the
- * GrantedAuthority[]
array
- *
- * @deprecated use new constructor with extended properties (this
- * constructor will be removed from release 1.0.0)
- */
- public User(String username, String password, boolean enabled,
- GrantedAuthority[] authorities) throws IllegalArgumentException {
- this(username, password, enabled, true, true, authorities);
- }
+ private boolean accountNonExpired;
- /**
- * Construct the User
with the details required by {@link
- * DaoAuthenticationProvider}.
- *
- * @param username the username presented to the
- * DaoAuthenticationProvider
- * @param password the password that should be presented to the
- * DaoAuthenticationProvider
- * @param enabled set to true
if the user is enabled
- * @param accountNonExpired set to true
if the account has not
- * expired
- * @param credentialsNonExpired set to true
if the credentials
- * have not expired
- * @param authorities the authorities that should be granted to the caller
- * if they presented the correct username and password and the user
- * is enabled
- *
- * @throws IllegalArgumentException if a null
value was passed
- * either as a parameter or as an element in the
- * GrantedAuthority[]
array
- *
- * @deprecated use new constructor with extended properties (this
- * constructor will be removed from release 1.0.0)
- */
- public User(String username, String password, boolean enabled,
- boolean accountNonExpired, boolean credentialsNonExpired,
- GrantedAuthority[] authorities) throws IllegalArgumentException {
- this(username, password, enabled, accountNonExpired,
- credentialsNonExpired, true, authorities);
- }
+ private boolean accountNonLocked;
- /**
- * Construct the User
with the details required by {@link
- * DaoAuthenticationProvider}.
- *
- * @param username the username presented to the
- * DaoAuthenticationProvider
- * @param password the password that should be presented to the
- * DaoAuthenticationProvider
- * @param enabled set to true
if the user is enabled
- * @param accountNonExpired set to true
if the account has not
- * expired
- * @param credentialsNonExpired set to true
if the credentials
- * have not expired
- * @param accountNonLocked set to true
if the account is not
- * locked
- * @param authorities the authorities that should be granted to the caller
- * if they presented the correct username and password and the user
- * is enabled
- *
- * @throws IllegalArgumentException if a null
value was passed
- * either as a parameter or as an element in the
- * GrantedAuthority[]
array
- */
- public User(String username, String password, boolean enabled,
- boolean accountNonExpired, boolean credentialsNonExpired,
- boolean accountNonLocked, GrantedAuthority[] authorities)
- throws IllegalArgumentException {
- if (((username == null) || "".equals(username)) || (password == null)) {
- throw new IllegalArgumentException(
- "Cannot pass null or empty values to constructor");
- }
+ private boolean credentialsNonExpired;
- this.username = username;
- this.password = password;
- this.enabled = enabled;
- this.accountNonExpired = accountNonExpired;
- this.credentialsNonExpired = credentialsNonExpired;
- this.accountNonLocked = accountNonLocked;
- setAuthorities(authorities);
- }
+ private boolean enabled;
- //~ Methods ================================================================
+ // ~ Constructors
+ // ===========================================================
- public boolean equals(Object rhs) {
- if (!(rhs instanceof User) || (rhs == null)) {
- return false;
- }
+ protected User() {
+ throw new IllegalArgumentException("Cannot use default constructor");
+ }
- User user = (User) rhs;
+ /**
+ * Construct the User
with the details required by {@link
+ * DaoAuthenticationProvider}.
+ *
+ * @param username
+ * the username presented to the
+ * DaoAuthenticationProvider
+ * @param password
+ * the password that should be presented to the
+ * DaoAuthenticationProvider
+ * @param enabled
+ * set to true
if the user is enabled
+ * @param authorities
+ * the authorities that should be granted to the caller if they
+ * presented the correct username and password and the user is
+ * enabled
+ *
+ * @throws IllegalArgumentException
+ * if a null
value was passed either as a
+ * parameter or as an element in the
+ * GrantedAuthority[]
array
+ *
+ * @deprecated use new constructor with extended properties (this
+ * constructor will be removed from release 1.0.0)
+ */
+ public User(String username, String password, boolean enabled,
+ GrantedAuthority[] authorities) throws IllegalArgumentException {
+ this(username, password, enabled, true, true, authorities);
+ }
- // We rely on constructor to guarantee any User has non-null and >0 authorities
- if (user.getAuthorities().length != this.getAuthorities().length) {
- return false;
- }
+ /**
+ * Construct the User
with the details required by {@link
+ * DaoAuthenticationProvider}.
+ *
+ * @param username
+ * the username presented to the
+ * DaoAuthenticationProvider
+ * @param password
+ * the password that should be presented to the
+ * DaoAuthenticationProvider
+ * @param enabled
+ * set to true
if the user is enabled
+ * @param accountNonExpired
+ * set to true
if the account has not expired
+ * @param credentialsNonExpired
+ * set to true
if the credentials have not expired
+ * @param authorities
+ * the authorities that should be granted to the caller if they
+ * presented the correct username and password and the user is
+ * enabled
+ *
+ * @throws IllegalArgumentException
+ * if a null
value was passed either as a
+ * parameter or as an element in the
+ * GrantedAuthority[]
array
+ *
+ * @deprecated use new constructor with extended properties (this
+ * constructor will be removed from release 1.0.0)
+ */
+ public User(String username, String password, boolean enabled,
+ boolean accountNonExpired, boolean credentialsNonExpired,
+ GrantedAuthority[] authorities) throws IllegalArgumentException {
+ this(username, password, enabled, accountNonExpired,
+ credentialsNonExpired, true, authorities);
+ }
- for (int i = 0; i < this.getAuthorities().length; i++) {
- if (!this.getAuthorities()[i].equals(user.getAuthorities()[i])) {
- return false;
- }
- }
+ /**
+ * Construct the User
with the details required by {@link
+ * DaoAuthenticationProvider}.
+ *
+ * @param username
+ * the username presented to the
+ * DaoAuthenticationProvider
+ * @param password
+ * the password that should be presented to the
+ * DaoAuthenticationProvider
+ * @param enabled
+ * set to true
if the user is enabled
+ * @param accountNonExpired
+ * set to true
if the account has not expired
+ * @param credentialsNonExpired
+ * set to true
if the credentials have not expired
+ * @param accountNonLocked
+ * set to true
if the account is not locked
+ * @param authorities
+ * the authorities that should be granted to the caller if they
+ * presented the correct username and password and the user is
+ * enabled
+ *
+ * @throws IllegalArgumentException
+ * if a null
value was passed either as a
+ * parameter or as an element in the
+ * GrantedAuthority[]
array
+ */
+ public User(String username, String password, boolean enabled,
+ boolean accountNonExpired, boolean credentialsNonExpired,
+ boolean accountNonLocked, GrantedAuthority[] authorities)
+ throws IllegalArgumentException {
+ if (((username == null) || "".equals(username)) || (password == null)) {
+ throw new IllegalArgumentException(
+ "Cannot pass null or empty values to constructor");
+ }
- // We rely on constructor to guarantee non-null username and password
- return (this.getPassword().equals(user.getPassword())
- && this.getUsername().equals(user.getUsername())
- && (this.isAccountNonExpired() == user.isAccountNonExpired())
- && (this.isAccountNonLocked() == user.isAccountNonLocked())
- && (this.isCredentialsNonExpired() == user.isCredentialsNonExpired())
- && (this.isEnabled() == user.isEnabled()));
- }
+ this.username = username;
+ this.password = password;
+ this.enabled = enabled;
+ this.accountNonExpired = accountNonExpired;
+ this.credentialsNonExpired = credentialsNonExpired;
+ this.accountNonLocked = accountNonLocked;
+ setAuthorities(authorities);
+ }
- public GrantedAuthority[] getAuthorities() {
- return authorities;
- }
+ // ~ Methods
+ // ================================================================
- public String getPassword() {
- return password;
- }
+ public boolean equals(Object rhs) {
+ if (!(rhs instanceof User) || (rhs == null)) {
+ return false;
+ }
- public String getUsername() {
- return username;
- }
+ User user = (User) rhs;
- public boolean isAccountNonExpired() {
- return accountNonExpired;
- }
+ // We rely on constructor to guarantee any User has non-null and >0
+ // authorities
+ if (user.getAuthorities().length != this.getAuthorities().length) {
+ return false;
+ }
- public boolean isAccountNonLocked() {
- return this.accountNonLocked;
- }
+ for (int i = 0; i < this.getAuthorities().length; i++) {
+ if (!this.getAuthorities()[i].equals(user.getAuthorities()[i])) {
+ return false;
+ }
+ }
- public boolean isCredentialsNonExpired() {
- return credentialsNonExpired;
- }
+ // We rely on constructor to guarantee non-null username and password
+ return (this.getPassword().equals(user.getPassword())
+ && this.getUsername().equals(user.getUsername())
+ && (this.isAccountNonExpired() == user.isAccountNonExpired())
+ && (this.isAccountNonLocked() == user.isAccountNonLocked())
+ && (this.isCredentialsNonExpired() == user
+ .isCredentialsNonExpired()) && (this.isEnabled() == user
+ .isEnabled()));
+ }
- public boolean isEnabled() {
- return enabled;
- }
+ public GrantedAuthority[] getAuthorities() {
+ return authorities;
+ }
- protected void setAuthorities(GrantedAuthority[] authorities) {
- Assert.notNull(authorities, "Cannot pass a null GrantedAuthority array");
+ public String getPassword() {
+ return password;
+ }
- for (int i = 0; i < authorities.length; i++) {
- Assert.notNull(authorities[i],
- "Granted authority element " + i
- + " is null - GrantedAuthority[] cannot contain any null elements");
- }
+ public String getUsername() {
+ return username;
+ }
- this.authorities = authorities;
- }
+ public boolean isAccountNonExpired() {
+ return accountNonExpired;
+ }
- public String toString() {
- StringBuffer sb = new StringBuffer();
- sb.append(super.toString() + ": ");
- sb.append("Username: " + this.username + "; ");
- sb.append("Password: [PROTECTED]; ");
- sb.append("Enabled: " + this.enabled + "; ");
- sb.append("AccountNonExpired: " + this.accountNonExpired + "; ");
- sb.append("credentialsNonExpired: " + this.credentialsNonExpired + "; ");
- sb.append("AccountNonLocked: " + this.accountNonLocked + "; ");
+ public boolean isAccountNonLocked() {
+ return this.accountNonLocked;
+ }
- if (this.getAuthorities() != null) {
- sb.append("Granted Authorities: ");
+ public boolean isCredentialsNonExpired() {
+ return credentialsNonExpired;
+ }
- for (int i = 0; i < this.getAuthorities().length; i++) {
- if (i > 0) {
- sb.append(", ");
- }
+ public boolean isEnabled() {
+ return enabled;
+ }
- sb.append(this.getAuthorities()[i].toString());
- }
- } else {
- sb.append("Not granted any authorities");
- }
+ protected void setAuthorities(GrantedAuthority[] authorities) {
+ Assert
+ .notNull(authorities,
+ "Cannot pass a null GrantedAuthority array");
- return sb.toString();
- }
+ for (int i = 0; i < authorities.length; i++) {
+ Assert
+ .notNull(
+ authorities[i],
+ "Granted authority element "
+ + i
+ + " is null - GrantedAuthority[] cannot contain any null elements");
+ }
+
+ this.authorities = authorities;
+ }
+
+ public String toString() {
+ StringBuffer sb = new StringBuffer();
+ sb.append(super.toString() + ": ");
+ sb.append("Username: " + this.username + "; ");
+ sb.append("Password: [PROTECTED]; ");
+ sb.append("Enabled: " + this.enabled + "; ");
+ sb.append("AccountNonExpired: " + this.accountNonExpired + "; ");
+ sb
+ .append("credentialsNonExpired: " + this.credentialsNonExpired
+ + "; ");
+ sb.append("AccountNonLocked: " + this.accountNonLocked + "; ");
+
+ if (this.getAuthorities() != null) {
+ sb.append("Granted Authorities: ");
+
+ for (int i = 0; i < this.getAuthorities().length; i++) {
+ if (i > 0) {
+ sb.append(", ");
+ }
+
+ sb.append(this.getAuthorities()[i].toString());
+ }
+ } else {
+ sb.append("Not granted any authorities");
+ }
+
+ return sb.toString();
+ }
}
diff --git a/core/src/main/java/org/acegisecurity/userdetails/UserDetails.java b/core/src/main/java/org/acegisecurity/userdetails/UserDetails.java
index 7ea72f0804..4e4f0fc1e4 100644
--- a/core/src/main/java/org/acegisecurity/userdetails/UserDetails.java
+++ b/core/src/main/java/org/acegisecurity/userdetails/UserDetails.java
@@ -13,10 +13,13 @@
* limitations under the License.
*/
-package org.acegisecurity;
+package org.acegisecurity.userdetails;
import java.io.Serializable;
+import org.acegisecurity.Authentication;
+import org.acegisecurity.GrantedAuthority;
+
/**
* Provides core user information.
diff --git a/core/src/main/java/org/acegisecurity/userdetails/UserDetailsService.java b/core/src/main/java/org/acegisecurity/userdetails/UserDetailsService.java
index 2849df8327..f01938e463 100644
--- a/core/src/main/java/org/acegisecurity/userdetails/UserDetailsService.java
+++ b/core/src/main/java/org/acegisecurity/userdetails/UserDetailsService.java
@@ -13,10 +13,9 @@
* limitations under the License.
*/
-package org.acegisecurity.providers.dao;
-
-import org.acegisecurity.UserDetails;
+package org.acegisecurity.userdetails;
+import org.acegisecurity.providers.dao.DaoAuthenticationProvider;
import org.springframework.dao.DataAccessException;
@@ -32,7 +31,7 @@ import org.springframework.dao.DataAccessException;
* @author Ben Alex
* @version $Id$
*/
-public interface AuthenticationDao {
+public interface UserDetailsService {
//~ Methods ================================================================
/**
diff --git a/core/src/main/java/org/acegisecurity/providers/dao/UsernameNotFoundException.java b/core/src/main/java/org/acegisecurity/userdetails/UsernameNotFoundException.java
similarity index 92%
rename from core/src/main/java/org/acegisecurity/providers/dao/UsernameNotFoundException.java
rename to core/src/main/java/org/acegisecurity/userdetails/UsernameNotFoundException.java
index fbbbb2b828..9009c97754 100644
--- a/core/src/main/java/org/acegisecurity/providers/dao/UsernameNotFoundException.java
+++ b/core/src/main/java/org/acegisecurity/userdetails/UsernameNotFoundException.java
@@ -13,13 +13,13 @@
* limitations under the License.
*/
-package org.acegisecurity.providers.dao;
+package org.acegisecurity.userdetails;
import org.acegisecurity.BadCredentialsException;
/**
- * Thrown if an {@link AuthenticationDao} implementation cannot locate a {@link
+ * Thrown if an {@link UserDetailsService} implementation cannot locate a {@link
* User} by its username.
*
* @author Ben Alex
diff --git a/core/src/main/java/org/acegisecurity/userdetails/jdbc/JdbcDaoImpl.java b/core/src/main/java/org/acegisecurity/userdetails/jdbc/JdbcDaoImpl.java
index 85a6870949..807248fcad 100644
--- a/core/src/main/java/org/acegisecurity/userdetails/jdbc/JdbcDaoImpl.java
+++ b/core/src/main/java/org/acegisecurity/userdetails/jdbc/JdbcDaoImpl.java
@@ -13,34 +13,29 @@
* limitations under the License.
*/
-package org.acegisecurity.providers.dao.jdbc;
-
-import org.acegisecurity.GrantedAuthority;
-import org.acegisecurity.GrantedAuthorityImpl;
-import org.acegisecurity.UserDetails;
-import org.acegisecurity.providers.dao.AuthenticationDao;
-import org.acegisecurity.providers.dao.User;
-import org.acegisecurity.providers.dao.UsernameNotFoundException;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.springframework.context.ApplicationContextException;
-
-import org.springframework.dao.DataAccessException;
-
-import org.springframework.jdbc.core.SqlParameter;
-import org.springframework.jdbc.core.support.JdbcDaoSupport;
-import org.springframework.jdbc.object.MappingSqlQuery;
+package org.acegisecurity.userdetails.jdbc;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Types;
-
import java.util.List;
import javax.sql.DataSource;
+import org.acegisecurity.GrantedAuthority;
+import org.acegisecurity.GrantedAuthorityImpl;
+import org.acegisecurity.userdetails.User;
+import org.acegisecurity.userdetails.UserDetails;
+import org.acegisecurity.userdetails.UserDetailsService;
+import org.acegisecurity.userdetails.UsernameNotFoundException;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.springframework.context.ApplicationContextException;
+import org.springframework.dao.DataAccessException;
+import org.springframework.jdbc.core.SqlParameter;
+import org.springframework.jdbc.core.support.JdbcDaoSupport;
+import org.springframework.jdbc.object.MappingSqlQuery;
+
/**
* @@ -70,7 +65,7 @@ import javax.sql.DataSource; * @author colin sampaleanu * @version $Id$ */ -public class JdbcDaoImpl extends JdbcDaoSupport implements AuthenticationDao { +public class JdbcDaoImpl extends JdbcDaoSupport implements UserDetailsService { //~ Static fields/initializers ============================================= public static final String DEF_USERS_BY_USERNAME_QUERY = "SELECT username,password,enabled FROM users WHERE username = ?"; diff --git a/core/src/main/java/org/acegisecurity/userdetails/memory/InMemoryDaoImpl.java b/core/src/main/java/org/acegisecurity/userdetails/memory/InMemoryDaoImpl.java index f293ec1ee9..6b06396257 100644 --- a/core/src/main/java/org/acegisecurity/userdetails/memory/InMemoryDaoImpl.java +++ b/core/src/main/java/org/acegisecurity/userdetails/memory/InMemoryDaoImpl.java @@ -13,20 +13,17 @@ * limitations under the License. */ -package org.acegisecurity.providers.dao.memory; - -import org.acegisecurity.UserDetails; -import org.acegisecurity.providers.dao.AuthenticationDao; -import org.acegisecurity.providers.dao.UsernameNotFoundException; - -import org.springframework.beans.factory.InitializingBean; - -import org.springframework.dao.DataAccessException; - -import org.springframework.util.Assert; +package org.acegisecurity.userdetails.memory; import java.util.Properties; +import org.acegisecurity.userdetails.UserDetails; +import org.acegisecurity.userdetails.UserDetailsService; +import org.acegisecurity.userdetails.UsernameNotFoundException; +import org.springframework.beans.factory.InitializingBean; +import org.springframework.dao.DataAccessException; +import org.springframework.util.Assert; + /** * Retrieves user details from an in-memory list created by the bean context. @@ -34,7 +31,7 @@ import java.util.Properties; * @author Ben Alex * @version $Id$ */ -public class InMemoryDaoImpl implements AuthenticationDao, InitializingBean { +public class InMemoryDaoImpl implements UserDetailsService, InitializingBean { //~ Instance fields ======================================================== private UserMap userMap; diff --git a/core/src/main/java/org/acegisecurity/userdetails/memory/UserAttribute.java b/core/src/main/java/org/acegisecurity/userdetails/memory/UserAttribute.java index acfb26b0e3..ce015bdbbf 100644 --- a/core/src/main/java/org/acegisecurity/userdetails/memory/UserAttribute.java +++ b/core/src/main/java/org/acegisecurity/userdetails/memory/UserAttribute.java @@ -13,14 +13,14 @@ * limitations under the License. */ -package org.acegisecurity.providers.dao.memory; - -import org.acegisecurity.GrantedAuthority; -import org.acegisecurity.GrantedAuthorityImpl; +package org.acegisecurity.userdetails.memory; import java.util.List; import java.util.Vector; +import org.acegisecurity.GrantedAuthority; +import org.acegisecurity.GrantedAuthorityImpl; + /** * Used by {@link InMemoryDaoImpl} to temporarily store the attributes diff --git a/core/src/main/java/org/acegisecurity/userdetails/memory/UserAttributeEditor.java b/core/src/main/java/org/acegisecurity/userdetails/memory/UserAttributeEditor.java index a4deda5964..05029322df 100644 --- a/core/src/main/java/org/acegisecurity/userdetails/memory/UserAttributeEditor.java +++ b/core/src/main/java/org/acegisecurity/userdetails/memory/UserAttributeEditor.java @@ -13,14 +13,13 @@ * limitations under the License. */ -package org.acegisecurity.providers.dao.memory; - -import org.acegisecurity.GrantedAuthorityImpl; - -import org.springframework.util.StringUtils; +package org.acegisecurity.userdetails.memory; import java.beans.PropertyEditorSupport; +import org.acegisecurity.GrantedAuthorityImpl; +import org.springframework.util.StringUtils; + /** * Property editor that creates a {@link UserAttribute} from a comma separated diff --git a/core/src/main/java/org/acegisecurity/userdetails/memory/UserMap.java b/core/src/main/java/org/acegisecurity/userdetails/memory/UserMap.java index 1669eb4eb4..0e072f647b 100644 --- a/core/src/main/java/org/acegisecurity/userdetails/memory/UserMap.java +++ b/core/src/main/java/org/acegisecurity/userdetails/memory/UserMap.java @@ -13,19 +13,18 @@ * limitations under the License. */ -package org.acegisecurity.providers.dao.memory; - -import org.acegisecurity.UserDetails; -import org.acegisecurity.providers.dao.User; -import org.acegisecurity.providers.dao.UsernameNotFoundException; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.springframework.util.Assert; +package org.acegisecurity.userdetails.memory; import java.util.HashMap; import java.util.Map; +import org.acegisecurity.userdetails.User; +import org.acegisecurity.userdetails.UserDetails; +import org.acegisecurity.userdetails.UsernameNotFoundException; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.springframework.util.Assert; + /** * Used by {@link InMemoryDaoImpl} to store a list of users and their diff --git a/core/src/main/java/org/acegisecurity/userdetails/memory/UserMapEditor.java b/core/src/main/java/org/acegisecurity/userdetails/memory/UserMapEditor.java index 69c6000bce..b8f3dc6800 100644 --- a/core/src/main/java/org/acegisecurity/userdetails/memory/UserMapEditor.java +++ b/core/src/main/java/org/acegisecurity/userdetails/memory/UserMapEditor.java @@ -13,18 +13,16 @@ * limitations under the License. */ -package org.acegisecurity.providers.dao.memory; - -import org.acegisecurity.UserDetails; -import org.acegisecurity.providers.dao.User; - -import org.springframework.beans.propertyeditors.PropertiesEditor; +package org.acegisecurity.userdetails.memory; import java.beans.PropertyEditorSupport; - import java.util.Iterator; import java.util.Properties; +import org.acegisecurity.userdetails.User; +import org.acegisecurity.userdetails.UserDetails; +import org.springframework.beans.propertyeditors.PropertiesEditor; + /** * Property editor to assist with the setup of a {@link UserMap}. diff --git a/core/src/main/java/org/acegisecurity/vote/RoleVoter.java b/core/src/main/java/org/acegisecurity/vote/RoleVoter.java index b990be47be..7dab5de146 100644 --- a/core/src/main/java/org/acegisecurity/vote/RoleVoter.java +++ b/core/src/main/java/org/acegisecurity/vote/RoleVoter.java @@ -49,7 +49,7 @@ import java.util.Iterator; * some use when using preexisting role names without a prefix, and no ability * exists to prefix them with a role prefix on reading them in, such as * provided for example in {@link - * org.acegisecurity.providers.dao.jdbc.JdbcDaoImpl}. + * org.acegisecurity.userdetails.jdbc.JdbcDaoImpl}. *
* *
diff --git a/core/src/main/java/org/acegisecurity/wrapper/SecurityContextHolderAwareRequestWrapper.java b/core/src/main/java/org/acegisecurity/wrapper/SecurityContextHolderAwareRequestWrapper.java
index 3c210263ed..5447365091 100644
--- a/core/src/main/java/org/acegisecurity/wrapper/SecurityContextHolderAwareRequestWrapper.java
+++ b/core/src/main/java/org/acegisecurity/wrapper/SecurityContextHolderAwareRequestWrapper.java
@@ -18,8 +18,8 @@ package org.acegisecurity.wrapper;
import org.acegisecurity.Authentication;
import org.acegisecurity.AuthenticationTrustResolver;
import org.acegisecurity.AuthenticationTrustResolverImpl;
-import org.acegisecurity.UserDetails;
import org.acegisecurity.context.SecurityContextHolder;
+import org.acegisecurity.userdetails.UserDetails;
import java.security.Principal;
diff --git a/core/src/test/java/org/acegisecurity/acl/basic/GrantedAuthorityEffectiveAclsResolverTests.java b/core/src/test/java/org/acegisecurity/acl/basic/GrantedAuthorityEffectiveAclsResolverTests.java
index 701647d54b..8bc18aa2e2 100644
--- a/core/src/test/java/org/acegisecurity/acl/basic/GrantedAuthorityEffectiveAclsResolverTests.java
+++ b/core/src/test/java/org/acegisecurity/acl/basic/GrantedAuthorityEffectiveAclsResolverTests.java
@@ -21,7 +21,7 @@ import org.acegisecurity.GrantedAuthority;
import org.acegisecurity.GrantedAuthorityImpl;
import org.acegisecurity.acl.AclEntry;
import org.acegisecurity.providers.UsernamePasswordAuthenticationToken;
-import org.acegisecurity.providers.dao.User;
+import org.acegisecurity.userdetails.User;
/**
diff --git a/core/src/test/java/org/acegisecurity/providers/anonymous/AnonymousProcessingFilterTests.java b/core/src/test/java/org/acegisecurity/providers/anonymous/AnonymousProcessingFilterTests.java
index 1e8c3f811f..b4fe83eeed 100644
--- a/core/src/test/java/org/acegisecurity/providers/anonymous/AnonymousProcessingFilterTests.java
+++ b/core/src/test/java/org/acegisecurity/providers/anonymous/AnonymousProcessingFilterTests.java
@@ -23,7 +23,7 @@ import org.acegisecurity.MockFilterConfig;
import org.acegisecurity.context.SecurityContextHolder;
import org.acegisecurity.context.SecurityContextImpl;
import org.acegisecurity.providers.TestingAuthenticationToken;
-import org.acegisecurity.providers.dao.memory.UserAttribute;
+import org.acegisecurity.userdetails.memory.UserAttribute;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;
diff --git a/core/src/test/java/org/acegisecurity/providers/cas/CasAuthenticationProviderTests.java b/core/src/test/java/org/acegisecurity/providers/cas/CasAuthenticationProviderTests.java
index cc0cac2930..8b2ead06ff 100644
--- a/core/src/test/java/org/acegisecurity/providers/cas/CasAuthenticationProviderTests.java
+++ b/core/src/test/java/org/acegisecurity/providers/cas/CasAuthenticationProviderTests.java
@@ -22,12 +22,12 @@ import org.acegisecurity.AuthenticationException;
import org.acegisecurity.BadCredentialsException;
import org.acegisecurity.GrantedAuthority;
import org.acegisecurity.GrantedAuthorityImpl;
-import org.acegisecurity.UserDetails;
import org.acegisecurity.providers.TestingAuthenticationToken;
import org.acegisecurity.providers.UsernamePasswordAuthenticationToken;
import org.acegisecurity.providers.cas.ticketvalidator.AbstractTicketValidator;
-import org.acegisecurity.providers.dao.User;
import org.acegisecurity.ui.cas.CasProcessingFilter;
+import org.acegisecurity.userdetails.User;
+import org.acegisecurity.userdetails.UserDetails;
import org.springframework.context.support.StaticMessageSource;
import java.util.HashMap;
diff --git a/core/src/test/java/org/acegisecurity/providers/cas/CasAuthenticationTokenTests.java b/core/src/test/java/org/acegisecurity/providers/cas/CasAuthenticationTokenTests.java
index 520a46f530..812a62b9d6 100644
--- a/core/src/test/java/org/acegisecurity/providers/cas/CasAuthenticationTokenTests.java
+++ b/core/src/test/java/org/acegisecurity/providers/cas/CasAuthenticationTokenTests.java
@@ -19,9 +19,9 @@ import junit.framework.TestCase;
import org.acegisecurity.GrantedAuthority;
import org.acegisecurity.GrantedAuthorityImpl;
-import org.acegisecurity.UserDetails;
import org.acegisecurity.providers.UsernamePasswordAuthenticationToken;
-import org.acegisecurity.providers.dao.User;
+import org.acegisecurity.userdetails.User;
+import org.acegisecurity.userdetails.UserDetails;
import java.util.List;
import java.util.Vector;
diff --git a/core/src/test/java/org/acegisecurity/providers/cas/cache/EhCacheBasedTicketCacheTests.java b/core/src/test/java/org/acegisecurity/providers/cas/cache/EhCacheBasedTicketCacheTests.java
index 5bfc84712a..ae01599d1b 100644
--- a/core/src/test/java/org/acegisecurity/providers/cas/cache/EhCacheBasedTicketCacheTests.java
+++ b/core/src/test/java/org/acegisecurity/providers/cas/cache/EhCacheBasedTicketCacheTests.java
@@ -21,7 +21,7 @@ import org.acegisecurity.GrantedAuthority;
import org.acegisecurity.GrantedAuthorityImpl;
import org.acegisecurity.MockApplicationContext;
import org.acegisecurity.providers.cas.CasAuthenticationToken;
-import org.acegisecurity.providers.dao.User;
+import org.acegisecurity.userdetails.User;
import net.sf.ehcache.Cache;
diff --git a/core/src/test/java/org/acegisecurity/providers/cas/populator/DaoCasAuthoritiesPopulatorTests.java b/core/src/test/java/org/acegisecurity/providers/cas/populator/DaoCasAuthoritiesPopulatorTests.java
index 0b0c88577a..78abc29540 100644
--- a/core/src/test/java/org/acegisecurity/providers/cas/populator/DaoCasAuthoritiesPopulatorTests.java
+++ b/core/src/test/java/org/acegisecurity/providers/cas/populator/DaoCasAuthoritiesPopulatorTests.java
@@ -19,10 +19,10 @@ import junit.framework.TestCase;
import org.acegisecurity.GrantedAuthority;
import org.acegisecurity.GrantedAuthorityImpl;
-import org.acegisecurity.UserDetails;
-import org.acegisecurity.providers.dao.AuthenticationDao;
-import org.acegisecurity.providers.dao.User;
-import org.acegisecurity.providers.dao.UsernameNotFoundException;
+import org.acegisecurity.userdetails.UserDetailsService;
+import org.acegisecurity.userdetails.User;
+import org.acegisecurity.userdetails.UserDetails;
+import org.acegisecurity.userdetails.UsernameNotFoundException;
import org.springframework.dao.DataAccessException;
import org.springframework.dao.DataRetrievalFailureException;
@@ -111,7 +111,7 @@ public class DaoCasAuthoritiesPopulatorTests extends TestCase {
public void testGettersSetters() {
DaoCasAuthoritiesPopulator populator = new DaoCasAuthoritiesPopulator();
- AuthenticationDao dao = new MockAuthenticationDaoUserMarissa();
+ UserDetailsService dao = new MockAuthenticationDaoUserMarissa();
populator.setAuthenticationDao(dao);
assertEquals(dao, populator.getAuthenticationDao());
}
@@ -119,7 +119,7 @@ public class DaoCasAuthoritiesPopulatorTests extends TestCase {
//~ Inner Classes ==========================================================
private class MockAuthenticationDaoSimulateBackendError
- implements AuthenticationDao {
+ implements UserDetailsService {
public long getRefreshDuration() {
return 0;
}
@@ -131,7 +131,7 @@ public class DaoCasAuthoritiesPopulatorTests extends TestCase {
}
}
- private class MockAuthenticationDaoUserMarissa implements AuthenticationDao {
+ private class MockAuthenticationDaoUserMarissa implements UserDetailsService {
public long getRefreshDuration() {
return 0;
}
diff --git a/core/src/test/java/org/acegisecurity/providers/dao/DaoAuthenticationProviderTests.java b/core/src/test/java/org/acegisecurity/providers/dao/DaoAuthenticationProviderTests.java
index cd0edbc904..c6401477b9 100644
--- a/core/src/test/java/org/acegisecurity/providers/dao/DaoAuthenticationProviderTests.java
+++ b/core/src/test/java/org/acegisecurity/providers/dao/DaoAuthenticationProviderTests.java
@@ -26,13 +26,16 @@ import org.acegisecurity.DisabledException;
import org.acegisecurity.GrantedAuthority;
import org.acegisecurity.GrantedAuthorityImpl;
import org.acegisecurity.LockedException;
-import org.acegisecurity.UserDetails;
import org.acegisecurity.providers.TestingAuthenticationToken;
import org.acegisecurity.providers.UsernamePasswordAuthenticationToken;
import org.acegisecurity.providers.dao.cache.EhCacheBasedUserCache;
import org.acegisecurity.providers.dao.cache.NullUserCache;
import org.acegisecurity.providers.dao.salt.SystemWideSaltSource;
import org.acegisecurity.providers.encoding.ShaPasswordEncoder;
+import org.acegisecurity.userdetails.UserDetailsService;
+import org.acegisecurity.userdetails.User;
+import org.acegisecurity.userdetails.UserDetails;
+import org.acegisecurity.userdetails.UsernameNotFoundException;
import org.springframework.context.support.StaticMessageSource;
import org.springframework.dao.DataAccessException;
@@ -461,7 +464,7 @@ public class DaoAuthenticationProviderTests extends TestCase {
public void testStartupSuccess() throws Exception {
DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
provider.setMessageSource(new StaticMessageSource());
- AuthenticationDao dao = new MockAuthenticationDaoUserMarissa();
+ UserDetailsService dao = new MockAuthenticationDaoUserMarissa();
provider.setAuthenticationDao(dao);
provider.setUserCache(new MockUserCache());
assertEquals(dao, provider.getAuthenticationDao());
@@ -478,7 +481,7 @@ public class DaoAuthenticationProviderTests extends TestCase {
//~ Inner Classes ==========================================================
- private class MockAuthenticationDaoReturnsNull implements AuthenticationDao {
+ private class MockAuthenticationDaoReturnsNull implements UserDetailsService {
public UserDetails loadUserByUsername(String username)
throws UsernameNotFoundException, DataAccessException {
return null;
@@ -486,7 +489,7 @@ public class DaoAuthenticationProviderTests extends TestCase {
}
private class MockAuthenticationDaoSimulateBackendError
- implements AuthenticationDao {
+ implements UserDetailsService {
public UserDetails loadUserByUsername(String username)
throws UsernameNotFoundException, DataAccessException {
throw new DataRetrievalFailureException(
@@ -494,7 +497,7 @@ public class DaoAuthenticationProviderTests extends TestCase {
}
}
- private class MockAuthenticationDaoUserMarissa implements AuthenticationDao {
+ private class MockAuthenticationDaoUserMarissa implements UserDetailsService {
private String password = "koala";
public void setPassword(String password) {
@@ -515,7 +518,7 @@ public class DaoAuthenticationProviderTests extends TestCase {
}
private class MockAuthenticationDaoUserMarissaWithSalt
- implements AuthenticationDao {
+ implements UserDetailsService {
public UserDetails loadUserByUsername(String username)
throws UsernameNotFoundException, DataAccessException {
if ("marissa".equals(username)) {
@@ -530,7 +533,7 @@ public class DaoAuthenticationProviderTests extends TestCase {
}
}
- private class MockAuthenticationDaoUserPeter implements AuthenticationDao {
+ private class MockAuthenticationDaoUserPeter implements UserDetailsService {
public UserDetails loadUserByUsername(String username)
throws UsernameNotFoundException, DataAccessException {
if ("peter".equals(username)) {
@@ -545,7 +548,7 @@ public class DaoAuthenticationProviderTests extends TestCase {
}
private class MockAuthenticationDaoUserPeterAccountExpired
- implements AuthenticationDao {
+ implements UserDetailsService {
public UserDetails loadUserByUsername(String username)
throws UsernameNotFoundException, DataAccessException {
if ("peter".equals(username)) {
@@ -560,7 +563,7 @@ public class DaoAuthenticationProviderTests extends TestCase {
}
private class MockAuthenticationDaoUserPeterAccountLocked
- implements AuthenticationDao {
+ implements UserDetailsService {
public UserDetails loadUserByUsername(String username)
throws UsernameNotFoundException, DataAccessException {
if ("peter".equals(username)) {
@@ -575,7 +578,7 @@ public class DaoAuthenticationProviderTests extends TestCase {
}
private class MockAuthenticationDaoUserPeterCredentialsExpired
- implements AuthenticationDao {
+ implements UserDetailsService {
public UserDetails loadUserByUsername(String username)
throws UsernameNotFoundException, DataAccessException {
if ("peter".equals(username)) {
diff --git a/core/src/test/java/org/acegisecurity/providers/dao/cache/EhCacheBasedUserCacheTests.java b/core/src/test/java/org/acegisecurity/providers/dao/cache/EhCacheBasedUserCacheTests.java
index 4fd9318577..b855716563 100644
--- a/core/src/test/java/org/acegisecurity/providers/dao/cache/EhCacheBasedUserCacheTests.java
+++ b/core/src/test/java/org/acegisecurity/providers/dao/cache/EhCacheBasedUserCacheTests.java
@@ -20,7 +20,7 @@ import junit.framework.TestCase;
import org.acegisecurity.GrantedAuthority;
import org.acegisecurity.GrantedAuthorityImpl;
import org.acegisecurity.MockApplicationContext;
-import org.acegisecurity.providers.dao.User;
+import org.acegisecurity.userdetails.User;
import net.sf.ehcache.Cache;
diff --git a/core/src/test/java/org/acegisecurity/providers/dao/cache/NullUserCacheTests.java b/core/src/test/java/org/acegisecurity/providers/dao/cache/NullUserCacheTests.java
index 83880b4813..488836809d 100644
--- a/core/src/test/java/org/acegisecurity/providers/dao/cache/NullUserCacheTests.java
+++ b/core/src/test/java/org/acegisecurity/providers/dao/cache/NullUserCacheTests.java
@@ -19,7 +19,7 @@ import junit.framework.TestCase;
import org.acegisecurity.GrantedAuthority;
import org.acegisecurity.GrantedAuthorityImpl;
-import org.acegisecurity.providers.dao.User;
+import org.acegisecurity.userdetails.User;
/**
diff --git a/core/src/test/java/org/acegisecurity/providers/dao/salt/ReflectionSaltSourceTests.java b/core/src/test/java/org/acegisecurity/providers/dao/salt/ReflectionSaltSourceTests.java
index 607848f03c..18430d3786 100644
--- a/core/src/test/java/org/acegisecurity/providers/dao/salt/ReflectionSaltSourceTests.java
+++ b/core/src/test/java/org/acegisecurity/providers/dao/salt/ReflectionSaltSourceTests.java
@@ -20,8 +20,8 @@ import junit.framework.TestCase;
import org.acegisecurity.AuthenticationServiceException;
import org.acegisecurity.GrantedAuthority;
import org.acegisecurity.GrantedAuthorityImpl;
-import org.acegisecurity.UserDetails;
-import org.acegisecurity.providers.dao.User;
+import org.acegisecurity.userdetails.User;
+import org.acegisecurity.userdetails.UserDetails;
/**
diff --git a/core/src/test/java/org/acegisecurity/providers/x509/X509AuthenticationProviderTests.java b/core/src/test/java/org/acegisecurity/providers/x509/X509AuthenticationProviderTests.java
index e962e2e158..5a98fc8aff 100644
--- a/core/src/test/java/org/acegisecurity/providers/x509/X509AuthenticationProviderTests.java
+++ b/core/src/test/java/org/acegisecurity/providers/x509/X509AuthenticationProviderTests.java
@@ -19,7 +19,8 @@ import junit.framework.TestCase;
import org.acegisecurity.*;
import org.acegisecurity.providers.UsernamePasswordAuthenticationToken;
-import org.acegisecurity.providers.dao.User;
+import org.acegisecurity.userdetails.User;
+import org.acegisecurity.userdetails.UserDetails;
import org.springframework.context.support.StaticMessageSource;
import java.security.cert.X509Certificate;
diff --git a/core/src/test/java/org/acegisecurity/providers/x509/cache/EhCacheBasedX509UserCacheTests.java b/core/src/test/java/org/acegisecurity/providers/x509/cache/EhCacheBasedX509UserCacheTests.java
index f7c7a2fecd..ce9b3cf059 100644
--- a/core/src/test/java/org/acegisecurity/providers/x509/cache/EhCacheBasedX509UserCacheTests.java
+++ b/core/src/test/java/org/acegisecurity/providers/x509/cache/EhCacheBasedX509UserCacheTests.java
@@ -20,9 +20,9 @@ import junit.framework.TestCase;
import org.acegisecurity.GrantedAuthority;
import org.acegisecurity.GrantedAuthorityImpl;
import org.acegisecurity.MockApplicationContext;
-import org.acegisecurity.UserDetails;
-import org.acegisecurity.providers.dao.User;
import org.acegisecurity.providers.x509.X509TestUtils;
+import org.acegisecurity.userdetails.User;
+import org.acegisecurity.userdetails.UserDetails;
import net.sf.ehcache.Cache;
diff --git a/core/src/test/java/org/acegisecurity/providers/x509/populator/DaoX509AuthoritiesPopulatorTests.java b/core/src/test/java/org/acegisecurity/providers/x509/populator/DaoX509AuthoritiesPopulatorTests.java
index a240a7113f..9b92d1e0fc 100644
--- a/core/src/test/java/org/acegisecurity/providers/x509/populator/DaoX509AuthoritiesPopulatorTests.java
+++ b/core/src/test/java/org/acegisecurity/providers/x509/populator/DaoX509AuthoritiesPopulatorTests.java
@@ -20,11 +20,11 @@ import junit.framework.TestCase;
import org.acegisecurity.BadCredentialsException;
import org.acegisecurity.GrantedAuthority;
import org.acegisecurity.GrantedAuthorityImpl;
-import org.acegisecurity.UserDetails;
-import org.acegisecurity.providers.dao.AuthenticationDao;
-import org.acegisecurity.providers.dao.User;
-import org.acegisecurity.providers.dao.UsernameNotFoundException;
import org.acegisecurity.providers.x509.X509TestUtils;
+import org.acegisecurity.userdetails.UserDetailsService;
+import org.acegisecurity.userdetails.User;
+import org.acegisecurity.userdetails.UserDetails;
+import org.acegisecurity.userdetails.UsernameNotFoundException;
import org.springframework.context.support.StaticMessageSource;
import org.springframework.dao.DataAccessException;
@@ -139,7 +139,7 @@ public class DaoX509AuthoritiesPopulatorTests extends TestCase {
//~ Inner Classes ==========================================================
private class MockAuthenticationDaoMatchesNameOrEmail
- implements AuthenticationDao {
+ implements UserDetailsService {
public UserDetails loadUserByUsername(String username)
throws UsernameNotFoundException, DataAccessException {
if ("Luke Taylor".equals(username)
diff --git a/core/src/test/java/org/acegisecurity/taglibs/authz/AuthenticationTagTests.java b/core/src/test/java/org/acegisecurity/taglibs/authz/AuthenticationTagTests.java
index dd80519acc..f76323d748 100644
--- a/core/src/test/java/org/acegisecurity/taglibs/authz/AuthenticationTagTests.java
+++ b/core/src/test/java/org/acegisecurity/taglibs/authz/AuthenticationTagTests.java
@@ -21,7 +21,7 @@ import org.acegisecurity.Authentication;
import org.acegisecurity.GrantedAuthority;
import org.acegisecurity.context.SecurityContextHolder;
import org.acegisecurity.providers.TestingAuthenticationToken;
-import org.acegisecurity.providers.dao.User;
+import org.acegisecurity.userdetails.User;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.Tag;
diff --git a/core/src/test/java/org/acegisecurity/ui/basicauth/BasicProcessingFilterTests.java b/core/src/test/java/org/acegisecurity/ui/basicauth/BasicProcessingFilterTests.java
index 5f2e8e2782..e205a0a9ff 100644
--- a/core/src/test/java/org/acegisecurity/ui/basicauth/BasicProcessingFilterTests.java
+++ b/core/src/test/java/org/acegisecurity/ui/basicauth/BasicProcessingFilterTests.java
@@ -20,9 +20,9 @@ import junit.framework.TestCase;
import org.acegisecurity.MockAuthenticationEntryPoint;
import org.acegisecurity.MockAuthenticationManager;
import org.acegisecurity.MockFilterConfig;
-import org.acegisecurity.UserDetails;
import org.acegisecurity.context.SecurityContextHolder;
import org.acegisecurity.context.SecurityContextImpl;
+import org.acegisecurity.userdetails.UserDetails;
import org.apache.commons.codec.binary.Base64;
diff --git a/core/src/test/java/org/acegisecurity/ui/digestauth/DigestProcessingFilterTests.java b/core/src/test/java/org/acegisecurity/ui/digestauth/DigestProcessingFilterTests.java
index 98938e027e..158c3f1cbb 100644
--- a/core/src/test/java/org/acegisecurity/ui/digestauth/DigestProcessingFilterTests.java
+++ b/core/src/test/java/org/acegisecurity/ui/digestauth/DigestProcessingFilterTests.java
@@ -19,15 +19,15 @@ import junit.framework.TestCase;
import org.acegisecurity.DisabledException;
import org.acegisecurity.MockFilterConfig;
-import org.acegisecurity.UserDetails;
import org.acegisecurity.context.SecurityContextHolder;
import org.acegisecurity.context.SecurityContextImpl;
-import org.acegisecurity.providers.dao.AuthenticationDao;
import org.acegisecurity.providers.dao.UserCache;
-import org.acegisecurity.providers.dao.UsernameNotFoundException;
+import org.acegisecurity.userdetails.UserDetailsService;
+import org.acegisecurity.userdetails.UserDetails;
+import org.acegisecurity.userdetails.UsernameNotFoundException;
import org.acegisecurity.util.StringSplitUtils;
import org.apache.commons.codec.binary.Base64;
@@ -855,7 +855,7 @@ public class DigestProcessingFilterTests extends TestCase {
//~ Inner Classes ==========================================================
- private class MockAuthenticationDao implements AuthenticationDao {
+ private class MockAuthenticationDao implements UserDetailsService {
public UserDetails loadUserByUsername(String username)
throws UsernameNotFoundException, DataAccessException {
return null;
diff --git a/core/src/test/java/org/acegisecurity/ui/rememberme/TokenBasedRememberMeServicesTests.java b/core/src/test/java/org/acegisecurity/ui/rememberme/TokenBasedRememberMeServicesTests.java
index 1bf3749995..a3ec7322a1 100644
--- a/core/src/test/java/org/acegisecurity/ui/rememberme/TokenBasedRememberMeServicesTests.java
+++ b/core/src/test/java/org/acegisecurity/ui/rememberme/TokenBasedRememberMeServicesTests.java
@@ -22,11 +22,11 @@ import org.acegisecurity.GrantedAuthority;
import org.acegisecurity.GrantedAuthorityImpl;
-import org.acegisecurity.UserDetails;
import org.acegisecurity.providers.TestingAuthenticationToken;
-import org.acegisecurity.providers.dao.AuthenticationDao;
-import org.acegisecurity.providers.dao.User;
-import org.acegisecurity.providers.dao.UsernameNotFoundException;
+import org.acegisecurity.userdetails.UserDetailsService;
+import org.acegisecurity.userdetails.User;
+import org.acegisecurity.userdetails.UserDetails;
+import org.acegisecurity.userdetails.UsernameNotFoundException;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.codec.digest.DigestUtils;
@@ -402,7 +402,7 @@ public class TokenBasedRememberMeServicesTests extends TestCase {
//~ Inner Classes ==========================================================
- private class MockAuthenticationDao implements AuthenticationDao {
+ private class MockAuthenticationDao implements UserDetailsService {
private UserDetails toReturn;
private boolean throwException;
diff --git a/core/src/test/java/org/acegisecurity/ui/switchuser/SwitchUserProcessingFilterTests.java b/core/src/test/java/org/acegisecurity/ui/switchuser/SwitchUserProcessingFilterTests.java
index 2bc7fadec0..4380b0eb77 100644
--- a/core/src/test/java/org/acegisecurity/ui/switchuser/SwitchUserProcessingFilterTests.java
+++ b/core/src/test/java/org/acegisecurity/ui/switchuser/SwitchUserProcessingFilterTests.java
@@ -23,12 +23,12 @@ import org.acegisecurity.CredentialsExpiredException;
import org.acegisecurity.DisabledException;
import org.acegisecurity.GrantedAuthority;
import org.acegisecurity.GrantedAuthorityImpl;
-import org.acegisecurity.UserDetails;
import org.acegisecurity.context.SecurityContextHolder;
import org.acegisecurity.providers.UsernamePasswordAuthenticationToken;
-import org.acegisecurity.providers.dao.AuthenticationDao;
-import org.acegisecurity.providers.dao.User;
-import org.acegisecurity.providers.dao.UsernameNotFoundException;
+import org.acegisecurity.userdetails.UserDetailsService;
+import org.acegisecurity.userdetails.User;
+import org.acegisecurity.userdetails.UserDetails;
+import org.acegisecurity.userdetails.UsernameNotFoundException;
import org.acegisecurity.util.MockFilterChain;
import org.springframework.context.support.StaticMessageSource;
@@ -383,7 +383,7 @@ public class SwitchUserProcessingFilterTests extends TestCase {
//~ Inner Classes ==========================================================
- private class MockAuthenticationDaoUserJackLord implements AuthenticationDao {
+ private class MockAuthenticationDaoUserJackLord implements UserDetailsService {
private String password = "hawaii50";
public void setPassword(String password) {
diff --git a/core/src/test/java/org/acegisecurity/providers/dao/UserTests.java b/core/src/test/java/org/acegisecurity/userdetails/UserTests.java
similarity index 98%
rename from core/src/test/java/org/acegisecurity/providers/dao/UserTests.java
rename to core/src/test/java/org/acegisecurity/userdetails/UserTests.java
index 9f1570290a..32c5740244 100644
--- a/core/src/test/java/org/acegisecurity/providers/dao/UserTests.java
+++ b/core/src/test/java/org/acegisecurity/userdetails/UserTests.java
@@ -13,13 +13,14 @@
* limitations under the License.
*/
-package org.acegisecurity.providers.dao;
+package org.acegisecurity.userdetails;
import junit.framework.TestCase;
import org.acegisecurity.GrantedAuthority;
import org.acegisecurity.GrantedAuthorityImpl;
-import org.acegisecurity.UserDetails;
+import org.acegisecurity.userdetails.User;
+import org.acegisecurity.userdetails.UserDetails;
/**
diff --git a/core/src/test/java/org/acegisecurity/providers/dao/jdbc/JdbcDaoTests.java b/core/src/test/java/org/acegisecurity/userdetails/jdbc/JdbcDaoTests.java
similarity index 96%
rename from core/src/test/java/org/acegisecurity/providers/dao/jdbc/JdbcDaoTests.java
rename to core/src/test/java/org/acegisecurity/userdetails/jdbc/JdbcDaoTests.java
index a22bc67269..a237cd36bc 100644
--- a/core/src/test/java/org/acegisecurity/providers/dao/jdbc/JdbcDaoTests.java
+++ b/core/src/test/java/org/acegisecurity/userdetails/jdbc/JdbcDaoTests.java
@@ -13,13 +13,14 @@
* limitations under the License.
*/
-package org.acegisecurity.providers.dao.jdbc;
+package org.acegisecurity.userdetails.jdbc;
import junit.framework.TestCase;
import org.acegisecurity.PopulatedDatabase;
-import org.acegisecurity.UserDetails;
-import org.acegisecurity.providers.dao.UsernameNotFoundException;
+import org.acegisecurity.userdetails.UserDetails;
+import org.acegisecurity.userdetails.UsernameNotFoundException;
+import org.acegisecurity.userdetails.jdbc.JdbcDaoImpl;
import org.springframework.jdbc.object.MappingSqlQuery;
diff --git a/core/src/test/java/org/acegisecurity/providers/dao/memory/InMemoryDaoTests.java b/core/src/test/java/org/acegisecurity/userdetails/memory/InMemoryDaoTests.java
similarity index 93%
rename from core/src/test/java/org/acegisecurity/providers/dao/memory/InMemoryDaoTests.java
rename to core/src/test/java/org/acegisecurity/userdetails/memory/InMemoryDaoTests.java
index e366772398..760e3eb0df 100644
--- a/core/src/test/java/org/acegisecurity/providers/dao/memory/InMemoryDaoTests.java
+++ b/core/src/test/java/org/acegisecurity/userdetails/memory/InMemoryDaoTests.java
@@ -13,11 +13,14 @@
* limitations under the License.
*/
-package org.acegisecurity.providers.dao.memory;
+package org.acegisecurity.userdetails.memory;
import junit.framework.TestCase;
-import org.acegisecurity.providers.dao.UsernameNotFoundException;
+import org.acegisecurity.userdetails.UsernameNotFoundException;
+import org.acegisecurity.userdetails.memory.InMemoryDaoImpl;
+import org.acegisecurity.userdetails.memory.UserMap;
+import org.acegisecurity.userdetails.memory.UserMapEditor;
import java.util.Properties;
diff --git a/core/src/test/java/org/acegisecurity/providers/dao/memory/UserAttributeEditorTests.java b/core/src/test/java/org/acegisecurity/userdetails/memory/UserAttributeEditorTests.java
similarity index 96%
rename from core/src/test/java/org/acegisecurity/providers/dao/memory/UserAttributeEditorTests.java
rename to core/src/test/java/org/acegisecurity/userdetails/memory/UserAttributeEditorTests.java
index 22c1e75d49..d92e25e666 100644
--- a/core/src/test/java/org/acegisecurity/providers/dao/memory/UserAttributeEditorTests.java
+++ b/core/src/test/java/org/acegisecurity/userdetails/memory/UserAttributeEditorTests.java
@@ -13,7 +13,10 @@
* limitations under the License.
*/
-package org.acegisecurity.providers.dao.memory;
+package org.acegisecurity.userdetails.memory;
+
+import org.acegisecurity.userdetails.memory.UserAttribute;
+import org.acegisecurity.userdetails.memory.UserAttributeEditor;
import junit.framework.TestCase;
diff --git a/core/src/test/java/org/acegisecurity/providers/dao/memory/UserMapEditorTests.java b/core/src/test/java/org/acegisecurity/userdetails/memory/UserMapEditorTests.java
similarity index 95%
rename from core/src/test/java/org/acegisecurity/providers/dao/memory/UserMapEditorTests.java
rename to core/src/test/java/org/acegisecurity/userdetails/memory/UserMapEditorTests.java
index e6f5ae9682..5ff50965d9 100644
--- a/core/src/test/java/org/acegisecurity/providers/dao/memory/UserMapEditorTests.java
+++ b/core/src/test/java/org/acegisecurity/userdetails/memory/UserMapEditorTests.java
@@ -13,7 +13,10 @@
* limitations under the License.
*/
-package org.acegisecurity.providers.dao.memory;
+package org.acegisecurity.userdetails.memory;
+
+import org.acegisecurity.userdetails.memory.UserMap;
+import org.acegisecurity.userdetails.memory.UserMapEditor;
import junit.framework.TestCase;
diff --git a/core/src/test/java/org/acegisecurity/providers/dao/memory/UserMapTests.java b/core/src/test/java/org/acegisecurity/userdetails/memory/UserMapTests.java
similarity index 93%
rename from core/src/test/java/org/acegisecurity/providers/dao/memory/UserMapTests.java
rename to core/src/test/java/org/acegisecurity/userdetails/memory/UserMapTests.java
index e31a05bab0..e985037f07 100644
--- a/core/src/test/java/org/acegisecurity/providers/dao/memory/UserMapTests.java
+++ b/core/src/test/java/org/acegisecurity/userdetails/memory/UserMapTests.java
@@ -13,15 +13,16 @@
* limitations under the License.
*/
-package org.acegisecurity.providers.dao.memory;
+package org.acegisecurity.userdetails.memory;
import junit.framework.TestCase;
import org.acegisecurity.GrantedAuthority;
import org.acegisecurity.GrantedAuthorityImpl;
-import org.acegisecurity.UserDetails;
-import org.acegisecurity.providers.dao.User;
-import org.acegisecurity.providers.dao.UsernameNotFoundException;
+import org.acegisecurity.userdetails.User;
+import org.acegisecurity.userdetails.UserDetails;
+import org.acegisecurity.userdetails.UsernameNotFoundException;
+import org.acegisecurity.userdetails.memory.UserMap;
/**
diff --git a/core/src/test/java/org/acegisecurity/wrapper/SecurityContextHolderAwareRequestWrapperTests.java b/core/src/test/java/org/acegisecurity/wrapper/SecurityContextHolderAwareRequestWrapperTests.java
index 99d608d1e0..cfb815a586 100644
--- a/core/src/test/java/org/acegisecurity/wrapper/SecurityContextHolderAwareRequestWrapperTests.java
+++ b/core/src/test/java/org/acegisecurity/wrapper/SecurityContextHolderAwareRequestWrapperTests.java
@@ -22,7 +22,7 @@ import org.acegisecurity.GrantedAuthority;
import org.acegisecurity.GrantedAuthorityImpl;
import org.acegisecurity.context.SecurityContextHolder;
import org.acegisecurity.providers.TestingAuthenticationToken;
-import org.acegisecurity.providers.dao.User;
+import org.acegisecurity.userdetails.User;
import org.acegisecurity.wrapper.SecurityContextHolderAwareRequestWrapper;
import org.springframework.mock.web.MockHttpServletRequest;
diff --git a/core/src/test/resources/org/acegisecurity/ui/basicauth/filtertest-valid.xml b/core/src/test/resources/org/acegisecurity/ui/basicauth/filtertest-valid.xml
index bb2c2e9c57..8d92940d4a 100644
--- a/core/src/test/resources/org/acegisecurity/ui/basicauth/filtertest-valid.xml
+++ b/core/src/test/resources/org/acegisecurity/ui/basicauth/filtertest-valid.xml
@@ -22,7 +22,7 @@
common
name
(CN) in the certificate. It also allows you to set
your own regular expression to match a different part of the
- subject's distinguished name. An
-