org.codehaus.plexus.redback.system
Class DefaultSecuritySystem

java.lang.Object
  extended by org.codehaus.plexus.redback.system.DefaultSecuritySystem
All Implemented Interfaces:
SecuritySystem

@Service(value="securitySystem")
public class DefaultSecuritySystem
extends java.lang.Object
implements SecuritySystem

DefaultSecuritySystem:


Field Summary
 
Fields inherited from interface org.codehaus.plexus.redback.system.SecuritySystem
ROLE
 
Constructor Summary
DefaultSecuritySystem()
           
 
Method Summary
 SecuritySession authenticate(AuthenticationDataSource source)
          delegate to the authentication system for boolean authentication checks, if the result is authentic then pull the user object from the user manager and add it to the session.
 AuthorizationResult authorize(SecuritySession session, java.lang.Object permission)
           
 AuthorizationResult authorize(SecuritySession session, java.lang.Object permission, java.lang.Object resource)
           
 AuthenticationManager getAuthenticationManager()
           
 java.lang.String getAuthenticatorId()
           
 Authorizer getAuthorizer()
           
 java.lang.String getAuthorizerId()
           
 java.lang.String getKeyManagementId()
           
 KeyManager getKeyManager()
           
 UserSecurityPolicy getPolicy()
           
 java.lang.String getPolicyId()
           
 java.lang.String getUserManagementId()
           
 UserManager getUserManager()
           
 boolean isAuthenticated(AuthenticationDataSource source)
           
 boolean isAuthorized(SecuritySession session, java.lang.Object permission)
           
 boolean isAuthorized(SecuritySession session, java.lang.Object permission, java.lang.Object resource)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultSecuritySystem

public DefaultSecuritySystem()
Method Detail

authenticate

public SecuritySession authenticate(AuthenticationDataSource source)
                             throws AuthenticationException,
                                    UserNotFoundException,
                                    AccountLockedException,
                                    MustChangePasswordException
delegate to the authentication system for boolean authentication checks, if the result is authentic then pull the user object from the user manager and add it to the session. If the result is false return the result in an authenticated session and a null user object.

in the event of a successful authentication and a lack of corresponding user in the usermanager return a null user as well

//todo should this last case create a user in the usermanager?

Specified by:
authenticate in interface SecuritySystem
Parameters:
source -
Returns:
Throws:
AuthenticationException
UserNotFoundException
MustChangePasswordException
AccountLockedException
MustChangePasswordException

isAuthenticated

public boolean isAuthenticated(AuthenticationDataSource source)
                        throws AuthenticationException,
                               UserNotFoundException,
                               AccountLockedException,
                               MustChangePasswordException
Specified by:
isAuthenticated in interface SecuritySystem
Throws:
AuthenticationException
UserNotFoundException
AccountLockedException
MustChangePasswordException

getAuthenticatorId

public java.lang.String getAuthenticatorId()
Specified by:
getAuthenticatorId in interface SecuritySystem

authorize

public AuthorizationResult authorize(SecuritySession session,
                                     java.lang.Object permission)
                              throws AuthorizationException
Specified by:
authorize in interface SecuritySystem
Throws:
AuthorizationException

authorize

public AuthorizationResult authorize(SecuritySession session,
                                     java.lang.Object permission,
                                     java.lang.Object resource)
                              throws AuthorizationException
Specified by:
authorize in interface SecuritySystem
Throws:
AuthorizationException

isAuthorized

public boolean isAuthorized(SecuritySession session,
                            java.lang.Object permission)
                     throws AuthorizationException
Specified by:
isAuthorized in interface SecuritySystem
Throws:
AuthorizationException

isAuthorized

public boolean isAuthorized(SecuritySession session,
                            java.lang.Object permission,
                            java.lang.Object resource)
                     throws AuthorizationException
Specified by:
isAuthorized in interface SecuritySystem
Throws:
AuthorizationException

getAuthorizerId

public java.lang.String getAuthorizerId()
Specified by:
getAuthorizerId in interface SecuritySystem

getUserManager

public UserManager getUserManager()
Specified by:
getUserManager in interface SecuritySystem

getUserManagementId

public java.lang.String getUserManagementId()
Specified by:
getUserManagementId in interface SecuritySystem

getKeyManager

public KeyManager getKeyManager()
Specified by:
getKeyManager in interface SecuritySystem

getKeyManagementId

public java.lang.String getKeyManagementId()

getPolicy

public UserSecurityPolicy getPolicy()
Specified by:
getPolicy in interface SecuritySystem

getPolicyId

public java.lang.String getPolicyId()

getAuthenticationManager

public AuthenticationManager getAuthenticationManager()

getAuthorizer

public Authorizer getAuthorizer()


Copyright © 2006-2009 Codehaus. All Rights Reserved.