SEC-1132: Moved access-control/authorization specific code to org.sf.security.access package. Created provisioning package for user management classes to remove cyclical deps. Some other moving of classes to remove code tangles. Restructuring of portlet module under org.sf.security.portlet

This commit is contained in:
Luke Taylor
2009-04-12 12:23:23 +00:00
parent 7c4d54f356
commit 9efb5a7007
288 changed files with 773 additions and 705 deletions

View File

@@ -17,6 +17,7 @@ package org.springframework.security;
import java.io.Serializable;
import org.springframework.security.access.AccessDecisionManager;
import org.springframework.security.userdetails.UserDetails;
/**

View File

@@ -17,7 +17,7 @@ package org.springframework.security;
/**
* Thrown if an authentication request is rejected because the credentials are not sufficiently trusted.<p>{{@link
* org.springframework.security.vote.AccessDecisionVoter}s will typically throw this exception if they are dissatisfied with the
* org.springframework.security.access.vote.AccessDecisionVoter}s will typically throw this exception if they are dissatisfied with the
* level of the authentication, such as if performed using a remember-me mechanism or anonymously. The commonly used
* {@link org.springframework.security.ui.ExceptionTranslationFilter} will thus cause the <code>AuthenticationEntryPoint</code>
* to be called, allowing the principal to authenticate with a stronger level of authentication.}</p>

View File

@@ -19,8 +19,10 @@ import org.springframework.core.NestedRuntimeException;
/**
* Abstract superclass for all exceptions thrown in the security package and subpackages.<p>Note that this is a
* runtime (unchecked) exception. Security exceptions are usually fatal; there is no reason for them to be checked.</p>
* Abstract superclass for all exceptions thrown in the security package and subpackages.
* <p>
* Note that this is a runtime (unchecked) exception. Security exceptions are usually fatal; there is no reason for
* them to be checked.
*
* @author Ben Alex
* @version $Id$

View File

@@ -13,7 +13,7 @@
* limitations under the License.
*/
package org.springframework.security.event.authorization;
package org.springframework.security.access;
import org.springframework.context.ApplicationEvent;
@@ -27,7 +27,7 @@ import org.springframework.context.ApplicationEvent;
public abstract class AbstractAuthorizationEvent extends ApplicationEvent {
//~ Constructors ===================================================================================================
/**
/**
* Construct the event, passing in the secure object being intercepted.
*
* @param secureObject the secure object

View File

@@ -13,10 +13,13 @@
* limitations under the License.
*/
package org.springframework.security;
package org.springframework.security.access;
import java.util.List;
import org.springframework.security.Authentication;
import org.springframework.security.InsufficientAuthenticationException;
/**
* Makes a final access control (authorization) decision.
*

View File

@@ -13,7 +13,10 @@
* limitations under the License.
*/
package org.springframework.security;
package org.springframework.security.access;
import org.springframework.security.Authentication;
import org.springframework.security.SpringSecurityException;
/**
* Thrown if an {@link Authentication} object does not hold a required authority.

View File

@@ -13,12 +13,11 @@
* limitations under the License.
*/
package org.springframework.security.event.authorization;
package org.springframework.security.access;
import java.util.List;
import org.springframework.security.AuthenticationCredentialsNotFoundException;
import org.springframework.security.ConfigAttribute;
/**

View File

@@ -13,13 +13,11 @@
* limitations under the License.
*/
package org.springframework.security.event.authorization;
package org.springframework.security.access;
import java.util.List;
import org.springframework.security.AccessDeniedException;
import org.springframework.security.Authentication;
import org.springframework.security.ConfigAttribute;
/**
@@ -27,8 +25,8 @@ import org.springframework.security.ConfigAttribute;
* be authorized for the request.
*
* <p>This event might be thrown as a result of either an
* {@link org.springframework.security.AccessDecisionManager AccessDecisionManager} or an
* {@link org.springframework.security.AfterInvocationManager AfterInvocationManager}.
* {@link org.springframework.security.access.AccessDecisionManager AccessDecisionManager} or an
* {@link org.springframework.security.access.intercept.AfterInvocationManager AfterInvocationManager}.
*
* @author Ben Alex
* @version $Id$

View File

@@ -13,11 +13,13 @@
* limitations under the License.
*/
package org.springframework.security;
package org.springframework.security.access;
/**
* Thrown if an authorization request could not be processed due to a system problem.<p>This might be thrown if an
* <code>AccessDecisionManager</code> implementation could not locate a required method argument, for example.</p>
* Thrown if an authorization request could not be processed due to a system problem.
* <p>
* This might be thrown if an <code>AccessDecisionManager</code> implementation could not locate a required method
* argument, for example.
*
* @author Ben Alex
* @version $Id$
@@ -25,7 +27,7 @@ package org.springframework.security;
public class AuthorizationServiceException extends AccessDeniedException {
//~ Constructors ===================================================================================================
/**
/**
* Constructs an <code>AuthorizationServiceException</code> with the
* specified message.
*
@@ -35,7 +37,7 @@ public class AuthorizationServiceException extends AccessDeniedException {
super(msg);
}
/**
/**
* Constructs an <code>AuthorizationServiceException</code> with the
* specified message and root cause.
*

View File

@@ -13,12 +13,11 @@
* limitations under the License.
*/
package org.springframework.security.event.authorization;
package org.springframework.security.access;
import java.util.List;
import org.springframework.security.Authentication;
import org.springframework.security.ConfigAttribute;
/**

View File

@@ -13,16 +13,18 @@
* limitations under the License.
*/
package org.springframework.security;
package org.springframework.security.access;
import java.io.Serializable;
import org.springframework.security.access.intercept.RunAsManager;
/**
* Stores a security system related configuration attribute.
*
* <p>
* When an {@link org.springframework.security.intercept.AbstractSecurityInterceptor}
* When an {@link org.springframework.security.access.intercept.AbstractSecurityInterceptor}
* is set up, a list of configuration attributes is defined for secure object
* patterns. These configuration attributes have special meaning to a {@link RunAsManager},
* {@link AccessDecisionManager} or <code>AccessDecisionManager</code> delegate.

View File

@@ -13,7 +13,7 @@
* limitations under the License.
*/
package org.springframework.security;
package org.springframework.security.access;
import org.springframework.util.StringUtils;

View File

@@ -13,7 +13,7 @@
* limitations under the License.
*/
package org.springframework.security.event.authorization;
package org.springframework.security.access;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

View File

@@ -13,7 +13,7 @@
* limitations under the License.
*/
package org.springframework.security.event.authorization;
package org.springframework.security.access;
/**
* Event that is generated whenever a public secure object is invoked.<p>A public secure object is a secure object

View File

@@ -13,7 +13,7 @@
* limitations under the License.
*/
package org.springframework.security;
package org.springframework.security.access;
import java.util.ArrayList;
import java.util.List;

View File

@@ -13,7 +13,7 @@
* limitations under the License.
*/
package org.springframework.security.annotation;
package org.springframework.security.access.annotation;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
@@ -26,8 +26,8 @@ import javax.annotation.security.PermitAll;
import javax.annotation.security.RolesAllowed;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.security.ConfigAttribute;
import org.springframework.security.intercept.method.AbstractFallbackMethodSecurityMetadataSource;
import org.springframework.security.access.ConfigAttribute;
import org.springframework.security.access.intercept.method.AbstractFallbackMethodSecurityMetadataSource;
/**

View File

@@ -1,6 +1,6 @@
package org.springframework.security.annotation;
package org.springframework.security.access.annotation;
import org.springframework.security.SecurityConfig;
import org.springframework.security.access.SecurityConfig;
import javax.annotation.security.PermitAll;
import javax.annotation.security.DenyAll;

View File

@@ -1,11 +1,11 @@
package org.springframework.security.annotation;
package org.springframework.security.access.annotation;
import java.util.List;
import org.springframework.security.Authentication;
import org.springframework.security.ConfigAttribute;
import org.springframework.security.GrantedAuthority;
import org.springframework.security.vote.AccessDecisionVoter;
import org.springframework.security.access.ConfigAttribute;
import org.springframework.security.access.vote.AccessDecisionVoter;
/**
* Voter on JSR-250 configuration attributes.

View File

@@ -13,7 +13,7 @@
* limitations under the License.
*/
package org.springframework.security.annotation;
package org.springframework.security.access.annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;

View File

@@ -13,7 +13,7 @@
* limitations under the License.
*/
package org.springframework.security.annotation;
package org.springframework.security.access.annotation;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
@@ -22,9 +22,9 @@ import java.util.Collection;
import java.util.List;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.security.ConfigAttribute;
import org.springframework.security.SecurityConfig;
import org.springframework.security.intercept.method.AbstractFallbackMethodSecurityMetadataSource;
import org.springframework.security.access.ConfigAttribute;
import org.springframework.security.access.SecurityConfig;
import org.springframework.security.access.intercept.method.AbstractFallbackMethodSecurityMetadataSource;
/**

View File

@@ -1,4 +1,4 @@
package org.springframework.security.authoritymapping;
package org.springframework.security.access.authoritymapping;
import java.util.Collection;
import java.util.List;

View File

@@ -1,4 +1,4 @@
package org.springframework.security.authoritymapping;
package org.springframework.security.access.authoritymapping;
import java.util.ArrayList;
import java.util.Collection;
@@ -144,7 +144,7 @@ public class MapBasedAttributes2GrantedAuthoritiesMapper implements Attributes2G
/**
*
* @see org.springframework.security.authoritymapping.MappableAttributesRetriever#getMappableAttributes()
* @see org.springframework.security.access.authoritymapping.MappableAttributesRetriever#getMappableAttributes()
*/
public Set<String> getMappableAttributes() {
return mappableAttributes;

View File

@@ -1,4 +1,4 @@
package org.springframework.security.authoritymapping;
package org.springframework.security.access.authoritymapping;
import java.util.Set;

View File

@@ -1,4 +1,4 @@
package org.springframework.security.authoritymapping;
package org.springframework.security.access.authoritymapping;
import org.springframework.security.GrantedAuthority;
import org.springframework.security.GrantedAuthorityImpl;

View File

@@ -1,4 +1,4 @@
package org.springframework.security.authoritymapping;
package org.springframework.security.access.authoritymapping;
import java.util.Collections;
import java.util.HashSet;
@@ -18,7 +18,7 @@ public class SimpleMappableAttributesRetriever implements MappableAttributesRetr
/*
* (non-Javadoc)
*
* @see org.springframework.security.authoritymapping.MappableAttributesRetriever#getMappableAttributes()
* @see org.springframework.security.access.authoritymapping.MappableAttributesRetriever#getMappableAttributes()
*/
public Set<String> getMappableAttributes() {
return mappableAttributes;

View File

@@ -1,4 +1,4 @@
package org.springframework.security.authoritymapping;
package org.springframework.security.access.authoritymapping;
import java.io.FilterInputStream;
import java.io.IOException;

View File

@@ -1,4 +1,4 @@
package org.springframework.security.expression;
package org.springframework.security.access.expression;
import org.springframework.expression.EvaluationContext;
import org.springframework.expression.EvaluationException;

View File

@@ -1,4 +1,4 @@
package org.springframework.security.expression;
package org.springframework.security.access.expression;
import org.aopalliance.intercept.MethodInvocation;
import org.springframework.expression.EvaluationContext;

View File

@@ -1,4 +1,4 @@
package org.springframework.security.expression;
package org.springframework.security.access.expression;
import java.io.Serializable;

View File

@@ -1,4 +1,4 @@
package org.springframework.security.expression.annotation;
package org.springframework.security.access.expression.annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;

View File

@@ -1,4 +1,4 @@
package org.springframework.security.expression.annotation;
package org.springframework.security.access.expression.annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;

View File

@@ -1,4 +1,4 @@
package org.springframework.security.expression.annotation;
package org.springframework.security.access.expression.annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;

View File

@@ -1,4 +1,4 @@
package org.springframework.security.expression.annotation;
package org.springframework.security.access.expression.annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;

View File

@@ -1,9 +1,9 @@
package org.springframework.security.expression.method;
package org.springframework.security.access.expression.method;
import org.springframework.expression.Expression;
import org.springframework.expression.ParseException;
import org.springframework.expression.spel.antlr.SpelAntlrExpressionParser;
import org.springframework.security.ConfigAttribute;
import org.springframework.security.access.ConfigAttribute;
import org.springframework.util.Assert;
/**

View File

@@ -1,4 +1,4 @@
package org.springframework.security.expression.method;
package org.springframework.security.access.expression.method;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
@@ -11,13 +11,13 @@ import org.springframework.expression.Expression;
import org.springframework.expression.ExpressionParser;
import org.springframework.expression.ParseException;
import org.springframework.expression.spel.antlr.SpelAntlrExpressionParser;
import org.springframework.security.ConfigAttribute;
import org.springframework.security.expression.MethodSecurityExpressionHandler;
import org.springframework.security.expression.annotation.PostAuthorize;
import org.springframework.security.expression.annotation.PostFilter;
import org.springframework.security.expression.annotation.PreAuthorize;
import org.springframework.security.expression.annotation.PreFilter;
import org.springframework.security.intercept.method.AbstractMethodSecurityMetadataSource;
import org.springframework.security.access.ConfigAttribute;
import org.springframework.security.access.expression.MethodSecurityExpressionHandler;
import org.springframework.security.access.expression.annotation.PostAuthorize;
import org.springframework.security.access.expression.annotation.PostFilter;
import org.springframework.security.access.expression.annotation.PreAuthorize;
import org.springframework.security.access.expression.annotation.PreFilter;
import org.springframework.security.access.intercept.method.AbstractMethodSecurityMetadataSource;
import org.springframework.util.ClassUtils;
/**
@@ -75,7 +75,7 @@ public class ExpressionAnnotationMethodSecurityMetadataSource extends AbstractMe
}
/**
* See {@link org.springframework.security.intercept.method.AbstractFallbackMethodSecurityMetadataSource#getAttributes(Method, Class)}
* See {@link org.springframework.security.access.intercept.method.AbstractFallbackMethodSecurityMetadataSource#getAttributes(Method, Class)}
* for the logic of this method. The ordering here is slightly different in that we consider method-specific
* annotations on an interface before class-level ones.
*/

View File

@@ -1,4 +1,4 @@
package org.springframework.security.expression.method;
package org.springframework.security.access.expression.method;
import java.util.List;
@@ -7,13 +7,13 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.expression.EvaluationContext;
import org.springframework.expression.Expression;
import org.springframework.security.AccessDeniedException;
import org.springframework.security.Authentication;
import org.springframework.security.ConfigAttribute;
import org.springframework.security.afterinvocation.AfterInvocationProvider;
import org.springframework.security.expression.ExpressionUtils;
import org.springframework.security.expression.MethodSecurityExpressionHandler;
import org.springframework.security.expression.support.DefaultMethodSecurityExpressionHandler;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.access.ConfigAttribute;
import org.springframework.security.access.expression.ExpressionUtils;
import org.springframework.security.access.expression.MethodSecurityExpressionHandler;
import org.springframework.security.access.expression.support.DefaultMethodSecurityExpressionHandler;
import org.springframework.security.access.intercept.AfterInvocationProvider;
/**
* AfterInvocationProvider which handles the @PostAuthorize and @PostFilter annotation expressions.

View File

@@ -1,4 +1,4 @@
package org.springframework.security.expression.method;
package org.springframework.security.access.expression.method;
import java.util.Collection;
import java.util.List;
@@ -9,11 +9,11 @@ import org.apache.commons.logging.LogFactory;
import org.springframework.expression.EvaluationContext;
import org.springframework.expression.Expression;
import org.springframework.security.Authentication;
import org.springframework.security.ConfigAttribute;
import org.springframework.security.expression.ExpressionUtils;
import org.springframework.security.expression.MethodSecurityExpressionHandler;
import org.springframework.security.expression.support.DefaultMethodSecurityExpressionHandler;
import org.springframework.security.vote.AccessDecisionVoter;
import org.springframework.security.access.ConfigAttribute;
import org.springframework.security.access.expression.ExpressionUtils;
import org.springframework.security.access.expression.MethodSecurityExpressionHandler;
import org.springframework.security.access.expression.support.DefaultMethodSecurityExpressionHandler;
import org.springframework.security.access.vote.AccessDecisionVoter;
/**
* Voter which performs the actions for @PreFilter and @PostAuthorize annotations.

View File

@@ -1,4 +1,4 @@
package org.springframework.security.expression.method;
package org.springframework.security.access.expression.method;
import org.springframework.expression.Expression;
import org.springframework.expression.ParseException;

View File

@@ -1,4 +1,4 @@
package org.springframework.security.expression.method;
package org.springframework.security.access.expression.method;
import org.springframework.expression.Expression;
import org.springframework.expression.ParseException;

View File

@@ -0,0 +1,5 @@
package org.springframework.security.access.expression.support;
public class AbstractSecurityExpressionHandler {
}

View File

@@ -1,4 +1,4 @@
package org.springframework.security.expression.support;
package org.springframework.security.access.expression.support;
import java.lang.reflect.Array;
import java.util.ArrayList;
@@ -17,9 +17,9 @@ import org.springframework.expression.spel.antlr.SpelAntlrExpressionParser;
import org.springframework.security.Authentication;
import org.springframework.security.AuthenticationTrustResolver;
import org.springframework.security.AuthenticationTrustResolverImpl;
import org.springframework.security.expression.ExpressionUtils;
import org.springframework.security.expression.PermissionEvaluator;
import org.springframework.security.expression.MethodSecurityExpressionHandler;
import org.springframework.security.access.expression.ExpressionUtils;
import org.springframework.security.access.expression.MethodSecurityExpressionHandler;
import org.springframework.security.access.expression.PermissionEvaluator;
/**
* The standard implementation of <tt>SecurityExpressionHandler</tt>.

View File

@@ -1,11 +1,11 @@
package org.springframework.security.expression.support;
package org.springframework.security.access.expression.support;
import java.io.Serializable;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.security.Authentication;
import org.springframework.security.expression.PermissionEvaluator;
import org.springframework.security.access.expression.PermissionEvaluator;
/**
* A null PermissionEvaluator which denies all access. Used by default for situations when permission

View File

@@ -1,4 +1,4 @@
package org.springframework.security.expression.support;
package org.springframework.security.access.expression.support;
import java.lang.reflect.Method;

View File

@@ -1,9 +1,9 @@
package org.springframework.security.expression.support;
package org.springframework.security.access.expression.support;
import java.io.Serializable;
import org.springframework.security.Authentication;
import org.springframework.security.expression.PermissionEvaluator;
import org.springframework.security.access.expression.PermissionEvaluator;
/**

View File

@@ -1,4 +1,4 @@
package org.springframework.security.expression.support;
package org.springframework.security.access.expression.support;
import java.util.Set;

View File

@@ -12,7 +12,7 @@
* limitations under the License.
*/
package org.springframework.security.userdetails.hierarchicalroles;
package org.springframework.security.access.hierarchicalroles;
/**
* Exception that is thrown because of a cycle in the role hierarchy definition

View File

@@ -12,7 +12,7 @@
* limitations under the License.
*/
package org.springframework.security.userdetails.hierarchicalroles;
package org.springframework.security.access.hierarchicalroles;
import java.util.List;

View File

@@ -12,7 +12,7 @@
* limitations under the License.
*/
package org.springframework.security.userdetails.hierarchicalroles;
package org.springframework.security.access.hierarchicalroles;
import org.springframework.security.GrantedAuthority;

View File

@@ -12,7 +12,7 @@
* limitations under the License.
*/
package org.springframework.security.userdetails.hierarchicalroles;
package org.springframework.security.access.hierarchicalroles;
import org.springframework.security.userdetails.UserDetails;
import org.springframework.security.userdetails.UserDetailsService;

View File

@@ -12,7 +12,7 @@
* limitations under the License.
*/
package org.springframework.security.userdetails.hierarchicalroles;
package org.springframework.security.access.hierarchicalroles;
import java.util.List;

View File

@@ -13,7 +13,7 @@
* limitations under the License.
*/
package org.springframework.security.intercept;
package org.springframework.security.access.intercept;
import java.util.Collection;
import java.util.HashSet;
@@ -29,21 +29,18 @@ import org.springframework.context.ApplicationEventPublisherAware;
import org.springframework.context.MessageSource;
import org.springframework.context.MessageSourceAware;
import org.springframework.context.support.MessageSourceAccessor;
import org.springframework.security.AccessDecisionManager;
import org.springframework.security.AccessDeniedException;
import org.springframework.security.AfterInvocationManager;
import org.springframework.security.Authentication;
import org.springframework.security.AuthenticationCredentialsNotFoundException;
import org.springframework.security.AuthenticationManager;
import org.springframework.security.ConfigAttribute;
import org.springframework.security.RunAsManager;
import org.springframework.security.SpringSecurityMessageSource;
import org.springframework.security.access.AccessDecisionManager;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.access.AuthenticationCredentialsNotFoundEvent;
import org.springframework.security.access.AuthorizationFailureEvent;
import org.springframework.security.access.AuthorizedEvent;
import org.springframework.security.access.ConfigAttribute;
import org.springframework.security.access.PublicInvocationEvent;
import org.springframework.security.context.SecurityContextHolder;
import org.springframework.security.event.authorization.AuthenticationCredentialsNotFoundEvent;
import org.springframework.security.event.authorization.AuthorizationFailureEvent;
import org.springframework.security.event.authorization.AuthorizedEvent;
import org.springframework.security.event.authorization.PublicInvocationEvent;
import org.springframework.security.runas.NullRunAsManager;
import org.springframework.util.Assert;
/**

View File

@@ -13,10 +13,14 @@
* limitations under the License.
*/
package org.springframework.security;
package org.springframework.security.access.intercept;
import java.util.List;
import org.springframework.security.Authentication;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.access.ConfigAttribute;
/**
* Reviews the <code>Object</code> returned from a secure object invocation,
* being able to modify the <code>Object</code> or throw an {@link

View File

@@ -13,13 +13,13 @@
* limitations under the License.
*/
package org.springframework.security.afterinvocation;
package org.springframework.security.access.intercept;
import java.util.List;
import org.springframework.security.AccessDeniedException;
import org.springframework.security.Authentication;
import org.springframework.security.ConfigAttribute;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.access.ConfigAttribute;
/**

View File

@@ -13,7 +13,7 @@
* limitations under the License.
*/
package org.springframework.security.afterinvocation;
package org.springframework.security.access.intercept;
import java.util.ArrayList;
import java.util.List;
@@ -21,10 +21,9 @@ import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.security.AccessDeniedException;
import org.springframework.security.AfterInvocationManager;
import org.springframework.security.Authentication;
import org.springframework.security.ConfigAttribute;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.access.ConfigAttribute;
import org.springframework.util.Assert;

View File

@@ -13,19 +13,19 @@
* limitations under the License.
*/
package org.springframework.security.intercept;
package org.springframework.security.access.intercept;
import java.util.List;
import org.springframework.security.Authentication;
import org.springframework.security.ConfigAttribute;
import org.springframework.security.access.ConfigAttribute;
/**
* A return object received by {@link AbstractSecurityInterceptor} subclasses.
* <p>
* This class reflects the status of the security interception, so that the final call to
* {@link org.springframework.security.intercept.AbstractSecurityInterceptor#afterInvocation(InterceptorStatusToken, Object)}
* {@link org.springframework.security.access.intercept.AbstractSecurityInterceptor#afterInvocation(InterceptorStatusToken, Object)}
* can tidy up correctly.
*
* @author Ben Alex

View File

@@ -13,13 +13,12 @@
* limitations under the License.
*/
package org.springframework.security.runas;
package org.springframework.security.access.intercept;
import java.util.List;
import org.springframework.security.Authentication;
import org.springframework.security.ConfigAttribute;
import org.springframework.security.RunAsManager;
import org.springframework.security.access.ConfigAttribute;
/**
@@ -30,7 +29,7 @@ import org.springframework.security.RunAsManager;
* @author Ben Alex
* @version $Id$
*/
public class NullRunAsManager implements RunAsManager {
final class NullRunAsManager implements RunAsManager {
//~ Methods ========================================================================================================
public Authentication buildRunAs(Authentication authentication, Object object, List<ConfigAttribute> config) {

View File

@@ -13,7 +13,7 @@
* limitations under the License.
*/
package org.springframework.security.runas;
package org.springframework.security.access.intercept;
import org.springframework.security.SpringSecurityMessageSource;
import org.springframework.security.Authentication;

View File

@@ -13,10 +13,13 @@
* limitations under the License.
*/
package org.springframework.security;
package org.springframework.security.access.intercept;
import java.util.List;
import org.springframework.security.Authentication;
import org.springframework.security.access.ConfigAttribute;
/**
* Creates a new temporary {@link Authentication} object for the current secure
* object invocation only.
@@ -25,7 +28,7 @@ import java.util.List;
* This interface permits implementations to replace the
* <code>Authentication</code> object that applies to the current secure
* object invocation only. The {@link
* org.springframework.security.intercept.AbstractSecurityInterceptor} will replace
* org.springframework.security.access.intercept.AbstractSecurityInterceptor} will replace
* the <code>Authentication</code> object held in the
* {@link org.springframework.security.context.SecurityContext SecurityContext}
* for the duration of the secure object callback only, returning it to

View File

@@ -13,17 +13,16 @@
* limitations under the License.
*/
package org.springframework.security.runas;
package org.springframework.security.access.intercept;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.security.Authentication;
import org.springframework.security.ConfigAttribute;
import org.springframework.security.GrantedAuthority;
import org.springframework.security.GrantedAuthorityImpl;
import org.springframework.security.RunAsManager;
import org.springframework.security.access.ConfigAttribute;
import org.springframework.util.Assert;

View File

@@ -13,7 +13,7 @@
* limitations under the License.
*/
package org.springframework.security.runas;
package org.springframework.security.access.intercept;
import java.util.Arrays;
import java.util.List;

View File

@@ -13,12 +13,12 @@
* limitations under the License.
*/
package org.springframework.security.intercept;
package org.springframework.security.access.intercept;
import java.util.Collection;
import java.util.List;
import org.springframework.security.ConfigAttribute;
import org.springframework.security.access.ConfigAttribute;
/**

View File

@@ -1,9 +1,9 @@
package org.springframework.security.intercept.method;
package org.springframework.security.access.intercept.method;
import java.lang.reflect.Method;
import java.util.List;
import org.springframework.security.ConfigAttribute;
import org.springframework.security.access.ConfigAttribute;
import org.springframework.util.ClassUtils;
/**

View File

@@ -13,9 +13,9 @@
* limitations under the License.
*/
package org.springframework.security.intercept.method;
package org.springframework.security.access.intercept.method;
import org.springframework.security.ConfigAttribute;
import org.springframework.security.access.ConfigAttribute;
import org.aopalliance.intercept.MethodInvocation;

View File

@@ -1,4 +1,4 @@
package org.springframework.security.intercept.method;
package org.springframework.security.access.intercept.method;
import java.lang.reflect.Method;
import java.util.Collection;
@@ -10,7 +10,7 @@ import java.util.Map;
import java.util.Set;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.security.ConfigAttribute;
import org.springframework.security.access.ConfigAttribute;
import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;

View File

@@ -13,7 +13,7 @@
* limitations under the License.
*/
package org.springframework.security.intercept.method;
package org.springframework.security.access.intercept.method;
import java.lang.reflect.Method;
import java.util.ArrayList;
@@ -25,7 +25,7 @@ import java.util.Map;
import java.util.Set;
import org.springframework.beans.factory.BeanClassLoaderAware;
import org.springframework.security.ConfigAttribute;
import org.springframework.security.access.ConfigAttribute;
import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;

View File

@@ -13,7 +13,7 @@
* limitations under the License.
*/
package org.springframework.security.intercept.method;
package org.springframework.security.access.intercept.method;
import java.util.List;
@@ -21,17 +21,17 @@ import org.aopalliance.intercept.MethodInvocation;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.security.AccessDeniedException;
import org.springframework.security.Authentication;
import org.springframework.security.ConfigAttribute;
import org.springframework.security.intercept.AbstractSecurityInterceptor;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.access.ConfigAttribute;
import org.springframework.security.access.intercept.AbstractSecurityInterceptor;
import org.springframework.util.Assert;
/**
* Allows users to determine whether they have "before invocation" privileges for a given method invocation.
* <p>
* Of course, if an {@link org.springframework.security.AfterInvocationManager} is used to authorize the
* Of course, if an {@link org.springframework.security.access.intercept.AfterInvocationManager} is used to authorize the
* <em>result</em> of a method invocation, this class cannot assist determine whether or not the
* <code>AfterInvocationManager</code> will enable
* access. Instead this class aims to allow applications to determine whether or not the current principal would be

View File

@@ -13,13 +13,13 @@
* limitations under the License.
*/
package org.springframework.security.intercept.method;
package org.springframework.security.access.intercept.method;
import java.lang.reflect.Method;
import java.util.List;
import org.springframework.security.ConfigAttribute;
import org.springframework.security.intercept.SecurityMetadataSource;
import org.springframework.security.access.ConfigAttribute;
import org.springframework.security.access.intercept.SecurityMetadataSource;
/**

View File

@@ -13,7 +13,7 @@
* limitations under the License.
*/
package org.springframework.security.intercept.method;
package org.springframework.security.access.intercept.method;
import java.beans.PropertyEditorSupport;
import java.util.ArrayList;
@@ -24,8 +24,8 @@ import java.util.Map;
import java.util.Properties;
import org.springframework.beans.propertyeditors.PropertiesEditor;
import org.springframework.security.ConfigAttribute;
import org.springframework.security.SecurityConfig;
import org.springframework.security.access.ConfigAttribute;
import org.springframework.security.access.SecurityConfig;
import org.springframework.util.StringUtils;

View File

@@ -1,4 +1,4 @@
package org.springframework.security.intercept.method;
package org.springframework.security.access.intercept.method;
import java.lang.reflect.Method;
import java.util.HashSet;
@@ -14,8 +14,8 @@ import org.aspectj.weaver.tools.PointcutParser;
import org.aspectj.weaver.tools.PointcutPrimitive;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.security.ConfigAttribute;
import org.springframework.security.intercept.method.aopalliance.MethodSecurityMetadataSourceAdvisor;
import org.springframework.security.access.ConfigAttribute;
import org.springframework.security.access.intercept.method.aopalliance.MethodSecurityMetadataSourceAdvisor;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;

View File

@@ -13,12 +13,12 @@
* limitations under the License.
*/
package org.springframework.security.intercept.method.aopalliance;
package org.springframework.security.access.intercept.method.aopalliance;
import org.springframework.security.intercept.AbstractSecurityInterceptor;
import org.springframework.security.intercept.InterceptorStatusToken;
import org.springframework.security.intercept.SecurityMetadataSource;
import org.springframework.security.intercept.method.MethodSecurityMetadataSource;
import org.springframework.security.access.intercept.AbstractSecurityInterceptor;
import org.springframework.security.access.intercept.InterceptorStatusToken;
import org.springframework.security.access.intercept.SecurityMetadataSource;
import org.springframework.security.access.intercept.method.MethodSecurityMetadataSource;
import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

View File

@@ -13,7 +13,7 @@
* limitations under the License.
*/
package org.springframework.security.intercept.method.aopalliance;
package org.springframework.security.access.intercept.method.aopalliance;
import java.lang.reflect.AccessibleObject;
import java.lang.reflect.Method;
@@ -26,7 +26,7 @@ import org.springframework.aop.support.StaticMethodMatcherPointcut;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.security.intercept.method.MethodSecurityMetadataSource;
import org.springframework.security.access.intercept.method.MethodSecurityMetadataSource;
import org.springframework.util.Assert;
/**

View File

@@ -1,4 +1,4 @@
package org.springframework.security.intercept.method.aspectj;
package org.springframework.security.access.intercept.method.aspectj;
/**

View File

@@ -1,9 +1,9 @@
package org.springframework.security.intercept.method.aspectj;
package org.springframework.security.access.intercept.method.aspectj;
import org.springframework.security.intercept.AbstractSecurityInterceptor;
import org.springframework.security.intercept.InterceptorStatusToken;
import org.springframework.security.intercept.SecurityMetadataSource;
import org.springframework.security.intercept.method.MethodSecurityMetadataSource;
import org.springframework.security.access.intercept.AbstractSecurityInterceptor;
import org.springframework.security.access.intercept.InterceptorStatusToken;
import org.springframework.security.access.intercept.SecurityMetadataSource;
import org.springframework.security.access.intercept.method.MethodSecurityMetadataSource;
import org.aspectj.lang.JoinPoint;

View File

@@ -13,7 +13,7 @@
* limitations under the License.
*/
package org.springframework.security.intercept.method.aspectj;
package org.springframework.security.access.intercept.method.aspectj;
/**
* Called by the {@link AspectJSecurityInterceptor} when it wishes for the

View File

@@ -13,12 +13,12 @@
* limitations under the License.
*/
package org.springframework.security.intercept.method.aspectj;
package org.springframework.security.access.intercept.method.aspectj;
import org.springframework.security.intercept.AbstractSecurityInterceptor;
import org.springframework.security.intercept.InterceptorStatusToken;
import org.springframework.security.intercept.SecurityMetadataSource;
import org.springframework.security.intercept.method.MethodSecurityMetadataSource;
import org.springframework.security.access.intercept.AbstractSecurityInterceptor;
import org.springframework.security.access.intercept.InterceptorStatusToken;
import org.springframework.security.access.intercept.SecurityMetadataSource;
import org.springframework.security.access.intercept.method.MethodSecurityMetadataSource;
import org.aspectj.lang.JoinPoint;

View File

@@ -17,8 +17,8 @@ objects or HTTP request URLs.
<P>Each secure object typically has its
own <code>org.springframwork.security.intercept</code> package.
Each package usually includes a concrete security interceptor (which
subclasses {@link org.springframework.security.intercept.AbstractSecurityInterceptor},
an appropriate {@link org.springframework.security.intercept.ObjectDefinitionSource}
subclasses {@link org.springframework.security.access.intercept.AbstractSecurityInterceptor},
an appropriate {@link org.springframework.security.access.intercept.ObjectDefinitionSource}
for the type of resources the secure object represents, and a property editor
to populate the <code>ObjectDefinitionSource</code>.

View File

@@ -0,0 +1,11 @@
<html>
<body>
Core access-control related code, including
<ul>
<li>security metadata related classes</li>
<li>interception code</li>
<li>Security access control annotations</li>
<li>Voter-based AccessDecisionManager implementations</li>
</ul>
</body>
</html>

View File

@@ -13,17 +13,17 @@
* limitations under the License.
*/
package org.springframework.security.vote;
package org.springframework.security.access.vote;
import java.util.Iterator;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.security.AccessDecisionManager;
import org.springframework.security.AccessDeniedException;
import org.springframework.security.SpringSecurityMessageSource;
import org.springframework.security.ConfigAttribute;
import org.springframework.security.access.AccessDecisionManager;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.access.ConfigAttribute;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.MessageSource;
import org.springframework.context.MessageSourceAware;

View File

@@ -12,9 +12,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.security.vote;
package org.springframework.security.access.vote;
import org.springframework.security.AuthorizationServiceException;
import org.springframework.security.access.AuthorizationServiceException;
import org.aopalliance.intercept.MethodInvocation;

View File

@@ -13,12 +13,12 @@
* limitations under the License.
*/
package org.springframework.security.vote;
package org.springframework.security.access.vote;
import java.util.List;
import org.springframework.security.Authentication;
import org.springframework.security.ConfigAttribute;
import org.springframework.security.access.ConfigAttribute;
/**
@@ -27,7 +27,7 @@ import org.springframework.security.ConfigAttribute;
* <p>
* The coordination of voting (ie polling <code>AccessDecisionVoter</code>s,
* tallying their responses, and making the final authorization decision) is
* performed by an {@link org.springframework.security.AccessDecisionManager}.
* performed by an {@link org.springframework.security.access.AccessDecisionManager}.
* </p>
*
* @author Ben Alex
@@ -70,7 +70,7 @@ public interface AccessDecisionVoter {
* <p>The decision must be affirmative (<code>ACCESS_GRANTED</code>), negative (<code>ACCESS_DENIED</code>)
* or the <code>AccessDecisionVoter</code> can abstain (<code>ACCESS_ABSTAIN</code>) from voting.
* Under no circumstances should implementing classes return any other value. If a weighting of results is desired,
* this should be handled in a custom {@link org.springframework.security.AccessDecisionManager} instead.
* this should be handled in a custom {@link org.springframework.security.access.AccessDecisionManager} instead.
* </p>
* <p>Unless an <code>AccessDecisionVoter</code> is specifically intended to vote on an access control
* decision due to a passed method invocation or configuration attribute parameter, it must return

View File

@@ -13,17 +13,17 @@
* limitations under the License.
*/
package org.springframework.security.vote;
package org.springframework.security.access.vote;
import java.util.List;
import org.springframework.security.AccessDeniedException;
import org.springframework.security.Authentication;
import org.springframework.security.ConfigAttribute;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.access.ConfigAttribute;
/**
* Simple concrete implementation of {@link org.springframework.security.AccessDecisionManager} that grants access if any
* Simple concrete implementation of {@link org.springframework.security.access.AccessDecisionManager} that grants access if any
* <code>AccessDecisionVoter</code> returns an affirmative response.
*/
public class AffirmativeBased extends AbstractAccessDecisionManager {

View File

@@ -13,14 +13,14 @@
* limitations under the License.
*/
package org.springframework.security.vote;
package org.springframework.security.access.vote;
import java.util.List;
import org.springframework.security.Authentication;
import org.springframework.security.AuthenticationTrustResolver;
import org.springframework.security.AuthenticationTrustResolverImpl;
import org.springframework.security.ConfigAttribute;
import org.springframework.security.access.ConfigAttribute;
import org.springframework.util.Assert;

View File

@@ -13,16 +13,16 @@
* limitations under the License.
*/
package org.springframework.security.vote;
package org.springframework.security.access.vote;
import java.util.List;
import org.springframework.security.AccessDeniedException;
import org.springframework.security.Authentication;
import org.springframework.security.ConfigAttribute;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.access.ConfigAttribute;
/**
* Simple concrete implementation of {@link org.springframework.security.AccessDecisionManager} that uses a
* Simple concrete implementation of {@link org.springframework.security.access.AccessDecisionManager} that uses a
* consensus-based approach.
* <p>
* "Consensus" here means majority-rule (ignoring abstains) rather than unanimous agreement (ignoring abstains).

View File

@@ -13,7 +13,7 @@
* limitations under the License.
*/
package org.springframework.security.vote;
package org.springframework.security.access.vote;
import java.lang.reflect.Method;

View File

@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.security.vote;
package org.springframework.security.access.vote;
import java.util.ArrayList;
import java.util.List;
@@ -22,7 +22,7 @@ import org.aopalliance.intercept.MethodInvocation;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.security.Authentication;
import org.springframework.security.ConfigAttribute;
import org.springframework.security.access.ConfigAttribute;
import org.springframework.util.Assert;
@@ -43,7 +43,7 @@ import org.springframework.util.Assert;
* @author Greg Turnquist
* @version $Id$
*
* @see org.springframework.security.intercept.method.aopalliance.MethodSecurityInterceptor
* @see org.springframework.security.access.intercept.method.aopalliance.MethodSecurityInterceptor
* @deprecated Use new spring-security-acl module instead
*/
public class LabelBasedAclVoter extends AbstractAclVoter {
@@ -86,12 +86,12 @@ public class LabelBasedAclVoter extends AbstractAclVoter {
* labels. An example application context configuration of a <tt>labelMap</tt>:
*
* <pre>
* &lt;bean id="accessDecisionManager" class="org.springframework.security.vote.UnanimousBased"&gt;
* &lt;bean id="accessDecisionManager" class="org.springframework.security.access.vote.UnanimousBased"&gt;
* &lt;property name="allowIfAllAbstainDecisions"&gt;&lt;value&gt;false&lt;/value&gt;&lt;/property&gt;
* &lt;property name="decisionVoters"&gt;
* &lt;list&gt;
* &lt;bean class="org.springframework.security.vote.RoleVoter"/&gt;
* &lt;bean class="org.springframework.security.vote.LabelBasedAclVoter"&gt;
* &lt;bean class="org.springframework.security.access.vote.RoleVoter"/&gt;
* &lt;bean class="org.springframework.security.access.vote.LabelBasedAclVoter"&gt;
* &lt;property name="attributeIndicatingLabeledOperation"&gt;
* &lt;value&gt;LABELED_OPERATION&lt;/value&gt;
* &lt;/property&gt;
@@ -140,8 +140,8 @@ public class LabelBasedAclVoter extends AbstractAclVoter {
* This acl voter will only evaluate labeled methods if they are marked in the security interceptor's
* configuration with the attribute stored in attributeIndicatingLabeledOperation.
*
* @see org.springframework.security.vote.AbstractAclVoter
* @see org.springframework.security.intercept.method.aopalliance.MethodSecurityInterceptor
* @see org.springframework.security.access.vote.AbstractAclVoter
* @see org.springframework.security.access.intercept.method.aopalliance.MethodSecurityInterceptor
*/
public boolean supports(ConfigAttribute attribute) {
if (attribute.getAttribute().equals(attributeIndicatingLabeledOperation)) {

View File

@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.security.vote;
package org.springframework.security.access.vote;
import java.lang.reflect.Method;

View File

@@ -13,7 +13,7 @@
* limitations under the License.
*/
package org.springframework.security.vote;
package org.springframework.security.access.vote;
/**
* This interface indicates data objects that carry a label. The purpose is to support

View File

@@ -1,10 +1,10 @@
package org.springframework.security.vote;
package org.springframework.security.access.vote;
import java.util.List;
import org.springframework.security.Authentication;
import org.springframework.security.GrantedAuthority;
import org.springframework.security.userdetails.hierarchicalroles.RoleHierarchy;
import org.springframework.security.access.hierarchicalroles.RoleHierarchy;
import org.springframework.util.Assert;
/**

View File

@@ -13,13 +13,13 @@
* limitations under the License.
*/
package org.springframework.security.vote;
package org.springframework.security.access.vote;
import java.util.List;
import org.springframework.security.Authentication;
import org.springframework.security.ConfigAttribute;
import org.springframework.security.GrantedAuthority;
import org.springframework.security.access.ConfigAttribute;
/**
* Votes if any {@link ConfigAttribute#getAttribute()} starts with a prefix

View File

@@ -13,18 +13,18 @@
* limitations under the License.
*/
package org.springframework.security.vote;
package org.springframework.security.access.vote;
import java.util.ArrayList;
import java.util.List;
import org.springframework.security.AccessDeniedException;
import org.springframework.security.Authentication;
import org.springframework.security.ConfigAttribute;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.access.ConfigAttribute;
/**
* Simple concrete implementation of {@link org.springframework.security.AccessDecisionManager} that requires all
* Simple concrete implementation of {@link org.springframework.security.access.AccessDecisionManager} that requires all
* voters to abstain or grant access.
*/
public class UnanimousBased extends AbstractAccessDecisionManager {

View File

@@ -1,5 +0,0 @@
<html>
<body>
Used for post-processing of an object returned from a secure object invocation.
</body>
</html>

View File

@@ -1,5 +0,0 @@
<html>
<body>
Provides support objects for security event interception (ie authorization).
</body>
</html>

View File

@@ -1,5 +0,0 @@
package org.springframework.security.expression.support;
public class AbstractSecurityExpressionHandler {
}

View File

@@ -1,4 +1,4 @@
package org.springframework.security.userdetails.checker;
package org.springframework.security.providers;
import org.springframework.security.userdetails.UserDetailsChecker;
import org.springframework.security.userdetails.UserDetails;

View File

@@ -7,11 +7,11 @@ import org.springframework.core.Ordered;
import org.springframework.security.Authentication;
import org.springframework.security.AuthenticationException;
import org.springframework.security.BadCredentialsException;
import org.springframework.security.providers.AccountStatusUserDetailsChecker;
import org.springframework.security.providers.AuthenticationProvider;
import org.springframework.security.userdetails.AuthenticationUserDetailsService;
import org.springframework.security.userdetails.UserDetails;
import org.springframework.security.userdetails.UserDetailsChecker;
import org.springframework.security.userdetails.checker.AccountStatusUserDetailsChecker;
import org.springframework.util.Assert;
/**

View File

@@ -1,4 +1,4 @@
package org.springframework.security.userdetails;
package org.springframework.security.provisioning;
import java.util.List;

Some files were not shown because too many files have changed in this diff Show More