SEC-1132: Moved userdetails into core and added core/authority sub-package
This commit is contained in:
+1
-1
@@ -4,8 +4,8 @@ import java.util.Set;
|
||||
|
||||
import org.springframework.security.authentication.AuthenticationTrustResolver;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.AuthorityUtils;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.authority.AuthorityUtils;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ package org.springframework.security.access.hierarchicalroles;
|
||||
|
||||
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.GrantedAuthorityImpl;
|
||||
import org.springframework.security.core.authority.GrantedAuthorityImpl;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
|
||||
+3
-3
@@ -14,9 +14,9 @@
|
||||
|
||||
package org.springframework.security.access.hierarchicalroles;
|
||||
|
||||
import org.springframework.security.userdetails.UserDetails;
|
||||
import org.springframework.security.userdetails.UserDetailsService;
|
||||
import org.springframework.security.userdetails.UsernameNotFoundException;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||
import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
||||
import org.springframework.dao.DataAccessException;
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ package org.springframework.security.access.hierarchicalroles;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.userdetails.UserDetails;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
|
||||
/**
|
||||
* This class wraps Spring Security's <tt>UserDetails</tt> in a way that its <tt>getAuthorities()</tt> method is
|
||||
|
||||
+2
-2
@@ -22,7 +22,7 @@ import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.security.access.ConfigAttribute;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.GrantedAuthorityImpl;
|
||||
import org.springframework.security.core.authority.GrantedAuthorityImpl;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ import org.springframework.util.Assert;
|
||||
* properly discerned based on the prefix, with possible consequences when performing voting and other actions.
|
||||
* However, this option may be of some use when using pre-existing 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.springframework.security.userdetails.jdbc.JdbcDaoImpl}.
|
||||
* {@link org.springframework.security.core.userdetails.jdbc.JdbcDaoImpl}.
|
||||
*
|
||||
* @author Ben Alex
|
||||
* @author colin sampaleanu
|
||||
|
||||
@@ -41,7 +41,7 @@ import org.springframework.security.core.GrantedAuthority;
|
||||
* which do not represent roles. However, this option may be of some use when
|
||||
* using pre-existing 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.springframework.security.userdetails.jdbc.JdbcDaoImpl}.
|
||||
* example in {@link org.springframework.security.core.userdetails.jdbc.JdbcDaoImpl}.
|
||||
* <p>
|
||||
* All comparisons and prefixes are case sensitive.
|
||||
*
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ import java.util.List;
|
||||
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.userdetails.UserDetails;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
package org.springframework.security.authentication;
|
||||
|
||||
import org.springframework.security.core.SpringSecurityMessageSource;
|
||||
import org.springframework.security.userdetails.UserDetailsChecker;
|
||||
import org.springframework.security.userdetails.UserDetails;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.security.core.userdetails.UserDetailsChecker;
|
||||
import org.springframework.context.support.MessageSourceAccessor;
|
||||
|
||||
/**
|
||||
|
||||
@@ -46,7 +46,7 @@ import org.springframework.security.authentication.event.AuthenticationSuccessEv
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.AuthenticationException;
|
||||
import org.springframework.security.core.SpringSecurityMessageSource;
|
||||
import org.springframework.security.userdetails.UsernameNotFoundException;
|
||||
import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -18,8 +18,8 @@ package org.springframework.security.authentication;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.security.core.AuthorityUtils;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.authority.AuthorityUtils;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ package org.springframework.security.authentication.concurrent;
|
||||
|
||||
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.userdetails.UserDetails;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
|
||||
+7
-7
@@ -26,13 +26,13 @@ import org.springframework.security.authentication.UsernamePasswordAuthenticatio
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.AuthenticationException;
|
||||
import org.springframework.security.core.SpringSecurityMessageSource;
|
||||
import org.springframework.security.core.userdetails.UserCache;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.security.core.userdetails.UserDetailsChecker;
|
||||
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||
import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
||||
import org.springframework.security.core.userdetails.cache.NullUserCache;
|
||||
|
||||
import org.springframework.security.userdetails.UserCache;
|
||||
import org.springframework.security.userdetails.UserDetails;
|
||||
import org.springframework.security.userdetails.UserDetailsService;
|
||||
import org.springframework.security.userdetails.UsernameNotFoundException;
|
||||
import org.springframework.security.userdetails.UserDetailsChecker;
|
||||
import org.springframework.security.userdetails.cache.NullUserCache;
|
||||
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
|
||||
@@ -45,7 +45,7 @@ import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* A base {@link AuthenticationProvider} that allows subclasses to override and work with {@link
|
||||
* org.springframework.security.userdetails.UserDetails} objects. The class is designed to respond to {@link
|
||||
* org.springframework.security.core.userdetails.UserDetails} objects. The class is designed to respond to {@link
|
||||
* UsernamePasswordAuthenticationToken} authentication requests.
|
||||
*
|
||||
* <p>
|
||||
|
||||
+2
-2
@@ -22,8 +22,8 @@ import org.springframework.security.authentication.UsernamePasswordAuthenticatio
|
||||
import org.springframework.security.authentication.encoding.PasswordEncoder;
|
||||
import org.springframework.security.authentication.encoding.PlaintextPasswordEncoder;
|
||||
import org.springframework.security.core.AuthenticationException;
|
||||
import org.springframework.security.userdetails.UserDetails;
|
||||
import org.springframework.security.userdetails.UserDetailsService;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||
import org.springframework.dao.DataAccessException;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
package org.springframework.security.authentication.dao;
|
||||
|
||||
import org.springframework.security.userdetails.UserDetails;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
+2
-2
@@ -18,8 +18,8 @@ package org.springframework.security.authentication.dao.salt;
|
||||
|
||||
import org.springframework.security.authentication.AuthenticationServiceException;
|
||||
import org.springframework.security.authentication.dao.SaltSource;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
|
||||
import org.springframework.security.userdetails.UserDetails;
|
||||
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
@@ -31,7 +31,7 @@ import java.beans.PropertyDescriptor;
|
||||
|
||||
|
||||
/**
|
||||
* Obtains a salt from a specified property of the {@link org.springframework.security.userdetails.User} object.
|
||||
* Obtains a salt from a specified property of the {@link org.springframework.security.core.userdetails.User} object.
|
||||
* <p>
|
||||
* This allows you to subclass <code>User</code> and provide an additional bean getter for a salt. You should use a
|
||||
* synthetic value that does not change, such as a database primary key. Do not use <code>username</code> if it is
|
||||
|
||||
+2
-2
@@ -16,15 +16,15 @@
|
||||
package org.springframework.security.authentication.dao.salt;
|
||||
|
||||
import org.springframework.security.authentication.dao.SaltSource;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
|
||||
import org.springframework.security.userdetails.UserDetails;
|
||||
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
|
||||
|
||||
/**
|
||||
* Uses a static system-wide <code>String</code> as the salt.<P>Does not supply a different salt for each {@link
|
||||
* org.springframework.security.userdetails.User}. This means users sharing the same password will still have the same digested
|
||||
* org.springframework.security.core.userdetails.User}. This means users sharing the same password will still have the same digested
|
||||
* password. Of benefit is the digested passwords will at least be more protected than if stored without any salt.</p>
|
||||
*
|
||||
* @author Ben Alex
|
||||
|
||||
+1
-1
@@ -44,8 +44,8 @@ import org.springframework.security.authentication.jaas.event.JaasAuthentication
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.AuthenticationException;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.SessionDestroyedEvent;
|
||||
import org.springframework.security.core.context.SecurityContext;
|
||||
import org.springframework.security.core.session.SessionDestroyedEvent;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
|
||||
package org.springframework.security.authentication.jaas;
|
||||
|
||||
import org.springframework.security.core.GrantedAuthorityImpl;
|
||||
import org.springframework.security.core.authority.GrantedAuthorityImpl;
|
||||
|
||||
import java.security.Principal;
|
||||
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ package org.springframework.security.authentication.jaas;
|
||||
|
||||
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.userdetails.UserDetails;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
|
||||
+3
-3
@@ -9,9 +9,9 @@ import org.springframework.security.authentication.AuthenticationProvider;
|
||||
import org.springframework.security.authentication.BadCredentialsException;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.AuthenticationException;
|
||||
import org.springframework.security.userdetails.AuthenticationUserDetailsService;
|
||||
import org.springframework.security.userdetails.UserDetails;
|
||||
import org.springframework.security.userdetails.UserDetailsChecker;
|
||||
import org.springframework.security.core.userdetails.AuthenticationUserDetailsService;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.security.core.userdetails.UserDetailsChecker;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
|
||||
+4
-4
@@ -4,11 +4,11 @@ import java.util.List;
|
||||
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.AuthenticationException;
|
||||
import org.springframework.security.core.GrantedAuthoritiesContainer;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.userdetails.AuthenticationUserDetailsService;
|
||||
import org.springframework.security.userdetails.UserDetails;
|
||||
import org.springframework.security.userdetails.User;
|
||||
import org.springframework.security.core.authority.GrantedAuthoritiesContainer;
|
||||
import org.springframework.security.core.userdetails.AuthenticationUserDetailsService;
|
||||
import org.springframework.security.core.userdetails.User;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ package org.springframework.security.core;
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.springframework.security.access.AccessDecisionManager;
|
||||
import org.springframework.security.userdetails.UserDetails;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
|
||||
/**
|
||||
* Represents an authority granted to an {@link Authentication} object.
|
||||
|
||||
+3
-1
@@ -1,5 +1,7 @@
|
||||
package org.springframework.security.core;
|
||||
package org.springframework.security.core.authority;
|
||||
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
+3
-1
@@ -1,8 +1,10 @@
|
||||
package org.springframework.security.core;
|
||||
package org.springframework.security.core.authority;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
|
||||
/**
|
||||
* Indicates that a object stores GrantedAuthority objects.
|
||||
* <p>
|
||||
+2
-1
@@ -1,8 +1,9 @@
|
||||
package org.springframework.security.core;
|
||||
package org.springframework.security.core.authority;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
public class GrantedAuthoritiesContainerImpl implements MutableGrantedAuthoritiesContainer {
|
||||
+3
-1
@@ -13,10 +13,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.security.core;
|
||||
package org.springframework.security.core.authority;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
|
||||
+3
-1
@@ -1,7 +1,9 @@
|
||||
package org.springframework.security.core;
|
||||
package org.springframework.security.core.authority;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
|
||||
/**
|
||||
* Indicates that a object can be used to store and retrieve GrantedAuthority objects.
|
||||
* <p>
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package org.springframework.security.core.authoritymapping;
|
||||
package org.springframework.security.core.authority.mapping;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
package org.springframework.security.core.authoritymapping;
|
||||
package org.springframework.security.core.authority.mapping;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
@@ -11,7 +11,7 @@ import java.util.StringTokenizer;
|
||||
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.GrantedAuthorityImpl;
|
||||
import org.springframework.security.core.authority.GrantedAuthorityImpl;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
@@ -144,7 +144,7 @@ public class MapBasedAttributes2GrantedAuthoritiesMapper implements Attributes2G
|
||||
|
||||
/**
|
||||
*
|
||||
* @see org.springframework.security.core.authoritymapping.MappableAttributesRetriever#getMappableAttributes()
|
||||
* @see org.springframework.security.core.authority.mapping.MappableAttributesRetriever#getMappableAttributes()
|
||||
*/
|
||||
public Set<String> getMappableAttributes() {
|
||||
return mappableAttributes;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package org.springframework.security.core.authoritymapping;
|
||||
package org.springframework.security.core.authority.mapping;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
package org.springframework.security.core.authoritymapping;
|
||||
package org.springframework.security.core.authority.mapping;
|
||||
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.GrantedAuthorityImpl;
|
||||
import org.springframework.security.core.authority.GrantedAuthorityImpl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
package org.springframework.security.core.authoritymapping;
|
||||
package org.springframework.security.core.authority.mapping;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
@@ -18,7 +18,7 @@ public class SimpleMappableAttributesRetriever implements MappableAttributesRetr
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.springframework.security.core.authoritymapping.MappableAttributesRetriever#getMappableAttributes()
|
||||
* @see org.springframework.security.core.authority.mapping.MappableAttributesRetriever#getMappableAttributes()
|
||||
*/
|
||||
public Set<String> getMappableAttributes() {
|
||||
return mappableAttributes;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package org.springframework.security.core.authoritymapping;
|
||||
package org.springframework.security.core.authority.mapping;
|
||||
|
||||
import java.io.FilterInputStream;
|
||||
import java.io.IOException;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package org.springframework.security.core;
|
||||
package org.springframework.security.core.session;
|
||||
|
||||
import org.springframework.context.ApplicationEvent;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package org.springframework.security.core;
|
||||
package org.springframework.security.core.session;
|
||||
|
||||
import org.springframework.context.ApplicationEvent;
|
||||
import org.springframework.security.core.context.SecurityContext;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package org.springframework.security.userdetails;
|
||||
package org.springframework.security.core.userdetails;
|
||||
|
||||
import org.springframework.security.core.Authentication;
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.security.userdetails;
|
||||
package org.springframework.security.core.userdetails;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
+1
-1
@@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.security.userdetails;
|
||||
package org.springframework.security.core.userdetails;
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.security.userdetails;
|
||||
package org.springframework.security.core.userdetails;
|
||||
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
@@ -36,7 +36,7 @@ import java.util.List;
|
||||
* <p>
|
||||
* Concrete implementations must take particular care to ensure the non-null
|
||||
* contract detailed for each method is enforced. See
|
||||
* {@link org.springframework.security.userdetails.User} for a
|
||||
* {@link org.springframework.security.core.userdetails.User} for a
|
||||
* reference implementation (which you might like to extend).
|
||||
* </p>
|
||||
*
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package org.springframework.security.userdetails;
|
||||
package org.springframework.security.core.userdetails;
|
||||
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package org.springframework.security.userdetails;
|
||||
package org.springframework.security.core.userdetails;
|
||||
|
||||
/**
|
||||
* Called by classes which make use of a {@link UserDetailsService} to check the status of the loaded
|
||||
+1
-1
@@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.security.userdetails;
|
||||
package org.springframework.security.core.userdetails;
|
||||
|
||||
import org.springframework.security.authentication.dao.DaoAuthenticationProvider;
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.security.userdetails;
|
||||
package org.springframework.security.core.userdetails;
|
||||
|
||||
import org.springframework.security.core.AuthenticationException;
|
||||
|
||||
+3
-3
@@ -13,15 +13,15 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.security.userdetails.cache;
|
||||
package org.springframework.security.core.userdetails.cache;
|
||||
|
||||
import net.sf.ehcache.CacheException;
|
||||
import net.sf.ehcache.Element;
|
||||
import net.sf.ehcache.Ehcache;
|
||||
|
||||
|
||||
import org.springframework.security.userdetails.UserCache;
|
||||
import org.springframework.security.userdetails.UserDetails;
|
||||
import org.springframework.security.core.userdetails.UserCache;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
+3
-3
@@ -13,11 +13,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.security.userdetails.cache;
|
||||
package org.springframework.security.core.userdetails.cache;
|
||||
|
||||
|
||||
import org.springframework.security.userdetails.UserCache;
|
||||
import org.springframework.security.userdetails.UserDetails;
|
||||
import org.springframework.security.core.userdetails.UserCache;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
|
||||
|
||||
/**
|
||||
+7
-7
@@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.security.userdetails.jdbc;
|
||||
package org.springframework.security.core.userdetails.jdbc;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
@@ -27,14 +27,14 @@ import org.springframework.context.support.MessageSourceAccessor;
|
||||
import org.springframework.dao.DataAccessException;
|
||||
import org.springframework.jdbc.core.RowMapper;
|
||||
import org.springframework.jdbc.core.support.JdbcDaoSupport;
|
||||
import org.springframework.security.core.AuthorityUtils;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.GrantedAuthorityImpl;
|
||||
import org.springframework.security.core.SpringSecurityMessageSource;
|
||||
import org.springframework.security.userdetails.User;
|
||||
import org.springframework.security.userdetails.UserDetails;
|
||||
import org.springframework.security.userdetails.UserDetailsService;
|
||||
import org.springframework.security.userdetails.UsernameNotFoundException;
|
||||
import org.springframework.security.core.authority.AuthorityUtils;
|
||||
import org.springframework.security.core.authority.GrantedAuthorityImpl;
|
||||
import org.springframework.security.core.userdetails.User;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||
import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
|
||||
+4
-4
@@ -13,11 +13,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.security.userdetails.memory;
|
||||
package org.springframework.security.core.userdetails.memory;
|
||||
|
||||
import org.springframework.security.userdetails.UserDetails;
|
||||
import org.springframework.security.userdetails.UserDetailsService;
|
||||
import org.springframework.security.userdetails.UsernameNotFoundException;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||
import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
||||
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
|
||||
+2
-2
@@ -13,14 +13,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.security.userdetails.memory;
|
||||
package org.springframework.security.core.userdetails.memory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Vector;
|
||||
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.GrantedAuthorityImpl;
|
||||
import org.springframework.security.core.authority.GrantedAuthorityImpl;
|
||||
|
||||
|
||||
/**
|
||||
+1
-1
@@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.security.userdetails.memory;
|
||||
package org.springframework.security.core.userdetails.memory;
|
||||
|
||||
import java.beans.PropertyEditorSupport;
|
||||
import java.util.ArrayList;
|
||||
+3
-3
@@ -13,13 +13,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.security.userdetails.memory;
|
||||
package org.springframework.security.core.userdetails.memory;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.security.userdetails.UserDetails;
|
||||
import org.springframework.security.userdetails.UsernameNotFoundException;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.util.Assert;
|
||||
+3
-3
@@ -13,10 +13,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.security.userdetails.memory;
|
||||
package org.springframework.security.core.userdetails.memory;
|
||||
|
||||
import org.springframework.security.userdetails.User;
|
||||
import org.springframework.security.userdetails.UserDetails;
|
||||
import org.springframework.security.core.userdetails.User;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
|
||||
import org.springframework.beans.propertyeditors.PropertiesEditor;
|
||||
|
||||
+6
-6
@@ -5,14 +5,14 @@ import org.springframework.security.authentication.AuthenticationManager;
|
||||
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.AuthenticationException;
|
||||
import org.springframework.security.core.AuthorityUtils;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.GrantedAuthorityImpl;
|
||||
import org.springframework.security.core.authority.AuthorityUtils;
|
||||
import org.springframework.security.core.authority.GrantedAuthorityImpl;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import org.springframework.security.userdetails.UserCache;
|
||||
import org.springframework.security.userdetails.UserDetails;
|
||||
import org.springframework.security.userdetails.cache.NullUserCache;
|
||||
import org.springframework.security.userdetails.jdbc.JdbcDaoImpl;
|
||||
import org.springframework.security.core.userdetails.UserCache;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.security.core.userdetails.cache.NullUserCache;
|
||||
import org.springframework.security.core.userdetails.jdbc.JdbcDaoImpl;
|
||||
import org.springframework.context.ApplicationContextException;
|
||||
import org.springframework.dao.IncorrectResultSizeDataAccessException;
|
||||
import org.springframework.jdbc.core.PreparedStatementSetter;
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
package org.springframework.security.provisioning;
|
||||
|
||||
import org.springframework.security.userdetails.UserDetails;
|
||||
import org.springframework.security.userdetails.UserDetailsService;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||
|
||||
/**
|
||||
* An extension of the {@link UserDetailsService} which provides the ability
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
package org.springframework.security.util;
|
||||
|
||||
import org.springframework.util.PathMatcher;
|
||||
import org.springframework.util.AntPathMatcher;
|
||||
|
||||
/**
|
||||
* Ant path strategy for URL matching.
|
||||
*
|
||||
* @author Luke Taylor
|
||||
* @version $Id$
|
||||
*/
|
||||
public class AntUrlPathMatcher implements UrlMatcher {
|
||||
private boolean requiresLowerCaseUrl = true;
|
||||
private PathMatcher pathMatcher = new AntPathMatcher();
|
||||
|
||||
public AntUrlPathMatcher() {
|
||||
this(true);
|
||||
}
|
||||
|
||||
public AntUrlPathMatcher(boolean requiresLowerCaseUrl) {
|
||||
this.requiresLowerCaseUrl = requiresLowerCaseUrl;
|
||||
}
|
||||
|
||||
public Object compile(String path) {
|
||||
if (requiresLowerCaseUrl) {
|
||||
return path.toLowerCase();
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
public void setRequiresLowerCaseUrl(boolean requiresLowerCaseUrl) {
|
||||
this.requiresLowerCaseUrl = requiresLowerCaseUrl;
|
||||
}
|
||||
|
||||
public boolean pathMatchesUrl(Object path, String url) {
|
||||
return pathMatcher.match((String)path, url);
|
||||
}
|
||||
|
||||
public String getUniversalMatchPattern() {
|
||||
return "/**";
|
||||
}
|
||||
|
||||
public boolean requiresLowerCaseUrl() {
|
||||
return requiresLowerCaseUrl;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return getClass().getName() + "[requiresLowerCase='" + requiresLowerCaseUrl + "']";
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
package org.springframework.security.util;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* @author Luke Taylor
|
||||
* @version $Id$
|
||||
*/
|
||||
public class RegexUrlPathMatcher implements UrlMatcher {
|
||||
private boolean requiresLowerCaseUrl = false;
|
||||
|
||||
public Object compile(String path) {
|
||||
return Pattern.compile(path);
|
||||
}
|
||||
|
||||
public void setRequiresLowerCaseUrl(boolean requiresLowerCaseUrl) {
|
||||
this.requiresLowerCaseUrl = requiresLowerCaseUrl;
|
||||
}
|
||||
|
||||
public boolean pathMatchesUrl(Object compiledPath, String url) {
|
||||
Pattern pattern = (Pattern)compiledPath;
|
||||
|
||||
return pattern.matcher(url).matches();
|
||||
}
|
||||
|
||||
public String getUniversalMatchPattern() {
|
||||
return "/.*";
|
||||
}
|
||||
|
||||
public boolean requiresLowerCaseUrl() {
|
||||
return requiresLowerCaseUrl;
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package org.springframework.security.util;
|
||||
|
||||
/**
|
||||
* Strategy for deciding whether configured path matches a submitted candidate URL.
|
||||
*
|
||||
* @author Luke Taylor
|
||||
* @version $Id$
|
||||
* @since 2.0
|
||||
*/
|
||||
public interface UrlMatcher {
|
||||
|
||||
Object compile(String urlPattern);
|
||||
|
||||
boolean pathMatchesUrl(Object compiledUrlPattern, String url);
|
||||
|
||||
/** Returns the path which matches every URL */
|
||||
String getUniversalMatchPattern();
|
||||
|
||||
/**
|
||||
* Returns true if the matcher expects the URL to be converted to lower case before
|
||||
* calling {@link #pathMatchesUrl(Object, String)}.
|
||||
*/
|
||||
boolean requiresLowerCaseUrl();
|
||||
}
|
||||
@@ -22,7 +22,7 @@
|
||||
<beans>
|
||||
|
||||
<!-- Data access object which stores authentication information -->
|
||||
<bean id="inMemoryDaoImpl" class="org.springframework.security.userdetails.memory.InMemoryDaoImpl">
|
||||
<bean id="inMemoryDaoImpl" class="org.springframework.security.core.userdetails.memory.InMemoryDaoImpl">
|
||||
<property name="userMap">
|
||||
<value>
|
||||
rod=koala,ROLE_TELLER,ROLE_SUPERVISOR
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@
|
||||
<beans>
|
||||
|
||||
<!-- Data access object which stores authentication information -->
|
||||
<bean id="inMemoryDaoImpl" class="org.springframework.security.userdetails.memory.InMemoryDaoImpl">
|
||||
<bean id="inMemoryDaoImpl" class="org.springframework.security.core.userdetails.memory.InMemoryDaoImpl">
|
||||
<property name="userMap">
|
||||
<value>
|
||||
rod=koala,ROLE_TELLER,ROLE_SUPERVISOR
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<beans>
|
||||
|
||||
<!-- Data access object which stores authentication information -->
|
||||
<bean id="inMemoryDaoImpl" class="org.springframework.security.userdetails.memory.InMemoryDaoImpl">
|
||||
<bean id="inMemoryDaoImpl" class="org.springframework.security.core.userdetails.memory.InMemoryDaoImpl">
|
||||
<property name="userMap">
|
||||
<value>
|
||||
rod=koala,ROLE_TELLER,ROLE_SUPERVISOR
|
||||
|
||||
Reference in New Issue
Block a user