[seam-commits] Seam SVN: r10540 - in modules/trunk/security: src/main/java/org/jboss/seam/security and 1 other directories.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Tue Apr 21 01:43:10 EDT 2009


Author: shane.bryzak at jboss.com
Date: 2009-04-21 01:43:10 -0400 (Tue, 21 Apr 2009)
New Revision: 10540

Added:
   modules/trunk/security/pom.xml
   modules/trunk/security/src/main/java/org/jboss/seam/security/Authenticator.java
   modules/trunk/security/src/main/java/org/jboss/seam/security/Secure.java
   modules/trunk/security/src/main/java/org/jboss/seam/security/events/
   modules/trunk/security/src/main/java/org/jboss/seam/security/events/AlreadyLoggedInEvent.java
   modules/trunk/security/src/main/java/org/jboss/seam/security/events/LoggedInEvent.java
   modules/trunk/security/src/main/java/org/jboss/seam/security/events/LoggedOutEvent.java
   modules/trunk/security/src/main/java/org/jboss/seam/security/events/LoginFailedEvent.java
   modules/trunk/security/src/main/java/org/jboss/seam/security/events/NotAuthorizedEvent.java
   modules/trunk/security/src/main/java/org/jboss/seam/security/events/NotLoggedInEvent.java
   modules/trunk/security/src/main/java/org/jboss/seam/security/events/PostAuthenticateEvent.java
   modules/trunk/security/src/main/java/org/jboss/seam/security/events/PreAuthenticateEvent.java
   modules/trunk/security/src/main/java/org/jboss/seam/security/events/QuietLoginEvent.java
Modified:
   modules/trunk/security/
   modules/trunk/security/src/main/java/org/jboss/seam/security/Credentials.java
   modules/trunk/security/src/main/java/org/jboss/seam/security/Identity.java
   modules/trunk/security/src/main/java/org/jboss/seam/security/SecurityInterceptor.java
Log:
start porting security module to jsr-299


Property changes on: modules/trunk/security
___________________________________________________________________
Name: svn:ignore
   + target


Added: modules/trunk/security/pom.xml
===================================================================
--- modules/trunk/security/pom.xml	                        (rev 0)
+++ modules/trunk/security/pom.xml	2009-04-21 05:43:10 UTC (rev 10540)
@@ -0,0 +1,32 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" 
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">   
+   <modelVersion>4.0.0</modelVersion>
+   
+   <groupId>org.jboss.seam</groupId>
+   <artifactId>seam-security</artifactId>
+   <packaging>jar</packaging>
+   <version>3.0.0-SNAPSHOT</version>
+   <name>Seam Security</name>
+         
+   <dependencies>
+      <dependency>
+         <groupId>org.jboss.webbeans</groupId>
+         <artifactId>jsr299-api</artifactId>
+         <version>1.0.0-SNAPSHOT</version>
+      </dependency>              
+      
+   </dependencies>
+   
+   <build>
+      <plugins>  
+         <plugin>
+            <artifactId>maven-compiler-plugin</artifactId>
+            <configuration>
+               <source>1.5</source>
+               <target>1.5</target>
+            </configuration>
+         </plugin>
+      </plugins>
+   </build>   
+</project>

Added: modules/trunk/security/src/main/java/org/jboss/seam/security/Authenticator.java
===================================================================
--- modules/trunk/security/src/main/java/org/jboss/seam/security/Authenticator.java	                        (rev 0)
+++ modules/trunk/security/src/main/java/org/jboss/seam/security/Authenticator.java	2009-04-21 05:43:10 UTC (rev 10540)
@@ -0,0 +1,11 @@
+package org.jboss.seam.security;
+
+/**
+ * Authenticator bean type
+ *  
+ * @author Shane Bryzak
+ */
+public interface Authenticator
+{
+   void authenticate();
+}

Modified: modules/trunk/security/src/main/java/org/jboss/seam/security/Credentials.java
===================================================================
--- modules/trunk/security/src/main/java/org/jboss/seam/security/Credentials.java	2009-04-21 05:12:50 UTC (rev 10539)
+++ modules/trunk/security/src/main/java/org/jboss/seam/security/Credentials.java	2009-04-21 05:43:10 UTC (rev 10540)
@@ -105,7 +105,13 @@
       password = null;
    }
    
+   @Override
+   public String toString()
+   {
+      return "Credentials[" + username + "]";
+   }
    
+   
    /**
     * Creates a callback handler that can handle a standard username/password
     * callback, using the username and password properties.

Modified: modules/trunk/security/src/main/java/org/jboss/seam/security/Identity.java
===================================================================
--- modules/trunk/security/src/main/java/org/jboss/seam/security/Identity.java	2009-04-21 05:12:50 UTC (rev 10539)
+++ modules/trunk/security/src/main/java/org/jboss/seam/security/Identity.java	2009-04-21 05:43:10 UTC (rev 10540)
@@ -1,8 +1,5 @@
 package org.jboss.seam.security;
 
-import static org.jboss.seam.ScopeType.SESSION;
-import static org.jboss.seam.annotations.Install.BUILT_IN;
-
 import java.io.Serializable;
 import java.security.Principal;
 import java.security.acl.Group;
@@ -11,39 +8,36 @@
 import java.util.Enumeration;
 import java.util.List;
 
+import javax.annotation.Named;
+import javax.context.Context;
+import javax.context.ContextNotActiveException;
+import javax.context.RequestScoped;
+import javax.context.SessionScoped;
+import javax.inject.Current;
+import javax.inject.Initializer;
+import javax.inject.manager.Manager;
 import javax.security.auth.Subject;
 import javax.security.auth.login.LoginContext;
 import javax.security.auth.login.LoginException;
 
-import org.jboss.seam.Component;
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.Create;
-import org.jboss.seam.annotations.Install;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.annotations.Startup;
-import org.jboss.seam.annotations.intercept.BypassInterceptors;
-import org.jboss.seam.contexts.Contexts;
-import org.jboss.seam.core.Events;
-import org.jboss.seam.core.Expressions;
-import org.jboss.seam.core.Expressions.MethodExpression;
-import org.jboss.seam.log.LogProvider;
-import org.jboss.seam.log.Logging;
+import org.jboss.seam.security.events.AlreadyLoggedInEvent;
+import org.jboss.seam.security.events.LoggedInEvent;
+import org.jboss.seam.security.events.LoggedOutEvent;
+import org.jboss.seam.security.events.LoginFailedEvent;
+import org.jboss.seam.security.events.NotAuthorizedEvent;
+import org.jboss.seam.security.events.NotLoggedInEvent;
+import org.jboss.seam.security.events.PostAuthenticateEvent;
+import org.jboss.seam.security.events.PreAuthenticateEvent;
+import org.jboss.seam.security.events.QuietLoginEvent;
 import org.jboss.seam.security.permission.PermissionMapper;
-import org.jboss.seam.web.Session;
 
 /**
- * API for authorization and authentication via Seam security. This base 
- * implementation supports role-based authorization only. Subclasses may add 
- * more sophisticated permissioning mechanisms.
+ * API for authorization and authentication via Seam security. 
  * 
  * @author Shane Bryzak
  */
- at Name("org.jboss.seam.security.identity")
- at Scope(SESSION)
- at Install(precedence = BUILT_IN)
- at BypassInterceptors
- at Startup
+ at Named
+ at SessionScoped
 public class Identity implements Serializable
 {  
    private static final long serialVersionUID = 3751659008033189259L;
@@ -68,50 +62,30 @@
    private static final String SILENT_LOGIN = "org.jboss.seam.security.silentLogin";
    
    private static final LogProvider log = Logging.getLogProvider(Identity.class);
-   
-   private Credentials credentials;
-   
-   private MethodExpression authenticateMethod;
-
+        
    private Principal principal;   
    private Subject subject;
    
-   private RememberMe rememberMe;
+   @Current private Manager manager;
+   @Current private Credentials credentials;
+   @Current private RememberMe rememberMe;
+   @Current private PermissionMapper permissionMapper;
    
    private transient ThreadLocal<Boolean> systemOp;
    
    private String jaasConfigName = null;
    
-   private List<String> preAuthenticationRoles = new ArrayList<String>();
+   private List<String> preAuthenticationRoles = new ArrayList<String>();      
    
-   private PermissionMapper permissionMapper;
-   
    /**
     * Flag that indicates we are in the process of authenticating
     */
    private boolean authenticating = false;
          
-   @Create
+   @Initializer
    public void create()
    {     
       subject = new Subject();
-      
-      if (Contexts.isApplicationContextActive())
-      {
-         permissionMapper = (PermissionMapper) Component.getInstance(PermissionMapper.class);                 
-      }    
-      
-      if (Contexts.isSessionContextActive())
-      {
-         rememberMe = (RememberMe) Component.getInstance(RememberMe.class, true);      
-         credentials = (Credentials) Component.getInstance(Credentials.class);         
-      }
-      
-      if (credentials == null)
-      {
-         // Must have credentials for unit tests
-         credentials = new Credentials();
-      }
    }
    
    public static boolean isSecurityEnabled()
@@ -126,19 +100,8 @@
 
    public static Identity instance()
    {
-      if ( !Contexts.isSessionContextActive() )
-      {
-         throw new IllegalStateException("No active session context");
-      }
-
-      Identity instance = (Identity) Component.getInstance(Identity.class, ScopeType.SESSION);
-
-      if (instance == null)
-      {
-         throw new IllegalStateException("No Identity could be created");
-      }
-
-      return instance;
+      // TODO - implement
+      return null;
    }
    
    /**
@@ -161,29 +124,28 @@
     */
    public boolean tryLogin()
    {
+      /*Context ctx = null;
+      try
+      {
+         ctx = manager.getContext(RequestScoped.class);
+      }
+      catch (ContextNotActiveException ex)
+      {
+         // Ignore
+      }*/
+      
+      // TODO work out some other way of implementing this, perhaps with a thread local? 
+      /*
       if (!authenticating && getPrincipal() == null && credentials.isSet() &&
-            Contexts.isEventContextActive() &&
-            !Contexts.getEventContext().isSet(LOGIN_TRIED))
-        {
-           Contexts.getEventContext().set(LOGIN_TRIED, true);
+            ctx != null && ctx.isActive() && !ctx.get(contextual)isSet(LOGIN_TRIED))
+      {
+           ctx.set(LOGIN_TRIED, true);
            quietLogin();
-        }     
+      } */    
         
         return isLoggedIn();      
    }
-   
-   @Deprecated
-   public boolean isLoggedIn(boolean attemptLogin)
-   {
-      return attemptLogin ? tryLogin() : isLoggedIn();
-   }
 
-
-    public void acceptExternallyAuthenticatedPrincipal(Principal principal) {
-        getSubject().getPrincipals().add(principal);
-        this.principal = principal;
-    }
-
    public Principal getPrincipal()
    {
       return principal;
@@ -211,14 +173,15 @@
       {
          if ( !isLoggedIn() )
          {           
-            if (Events.exists()) Events.instance().raiseEvent(EVENT_NOT_LOGGED_IN);
+            manager.fireEvent(new NotLoggedInEvent());
+            
             log.debug(String.format(
                "Error evaluating expression [%s] - User not logged in", expr));
             throw new NotLoggedInException();
          }
          else
          {
-            if (Events.exists()) Events.instance().raiseEvent(EVENT_NOT_AUTHORIZED);
+            manager.fireEvent(new NotAuthorizedEvent());
             throw new AuthorizationException(String.format(
                "Authorization check failed for expression [%s]", expr));
          }
@@ -248,11 +211,11 @@
             // and then return.
             if (Contexts.isEventContextActive() && Contexts.getEventContext().isSet(SILENT_LOGIN))
             {
-               if (Events.exists()) Events.instance().raiseEvent(EVENT_LOGIN_SUCCESSFUL);
+               manager.fireEvent(new LoggedInEvent(principal));               
                return "loggedIn";            
             }            
             
-            if (Events.exists()) Events.instance().raiseEvent(EVENT_ALREADY_LOGGED_IN);
+            manager.fireEvent(new AlreadyLoggedInEvent());
             return "loggedIn";           
          }
          
@@ -265,10 +228,10 @@
          
          if ( log.isDebugEnabled() )
          {
-            log.debug("Login successful for: " + getCredentials().getUsername());
+            log.debug("Login successful for: " + credentials);
          }
 
-         if (Events.exists()) Events.instance().raiseEvent(EVENT_LOGIN_SUCCESSFUL);
+         manager.fireEvent(new LoggedInEvent(principal));
          return "loggedIn";
       }
       catch (LoginException ex)
@@ -277,9 +240,10 @@
          
          if ( log.isDebugEnabled() )
          {
-             log.debug("Login failed for: " + getCredentials().getUsername(), ex);
+             log.debug("Login failed for: " + credentials, ex);
          }
-         if (Events.exists()) Events.instance().raiseEvent(EVENT_LOGIN_FAILED, ex);
+         
+         manager.fireEvent(new LoginFailedEvent());
       }
       
       return null;      
@@ -294,7 +258,7 @@
    {
       try
       {
-         if (Events.exists()) Events.instance().raiseEvent(EVENT_QUIET_LOGIN);         
+         manager.fireEvent(new QuietLoginEvent());        
           
          // Ensure that we haven't been authenticated as a result of the EVENT_QUIET_LOGIN event
          if (!isLoggedIn())
@@ -314,9 +278,7 @@
          credentials.invalidate();
       }
    }
-   
 
-
    /**
     * 
     * @throws LoginException
@@ -360,7 +322,7 @@
    protected void preAuthenticate()
    {     
       preAuthenticationRoles.clear();      
-      if (Events.exists()) Events.instance().raiseEvent(EVENT_PRE_AUTHENTICATE);
+      manager.fireEvent(new PreAuthenticateEvent());
    }   
    
    /**
@@ -394,7 +356,7 @@
 
       credentials.setPassword(null);
       
-      if (Events.exists()) Events.instance().raiseEvent(EVENT_POST_AUTHENTICATE, this);      
+      manager.fireEvent(new PostAuthenticateEvent());     
    }
    
    /**
@@ -424,9 +386,13 @@
    {
       if (isLoggedIn())
       {
+         LoggedOutEvent loggedOutEvent = new LoggedOutEvent(principal);
          unAuthenticate();
-         Session.instance().invalidate();
-         if (Events.exists()) Events.instance().raiseEvent(EVENT_LOGGED_OUT);
+         
+         // TODO - invalidate the session
+         // Session.instance().invalidate();
+         
+         manager.fireEvent(loggedOutEvent);
       }
    }
 
@@ -498,7 +464,7 @@
       {
          if ( ROLES_GROUP.equals( sg.getName() ) )
          {
-            Enumeration e = sg.members();
+            Enumeration<?> e = sg.members();
             while (e.hasMoreElements())
             {
                Principal member = (Principal) e.nextElement();
@@ -528,48 +494,17 @@
       {
          if ( !isLoggedIn() )
          {           
-            if (Events.exists()) Events.instance().raiseEvent(EVENT_NOT_LOGGED_IN);
+            manager.fireEvent(new NotLoggedInEvent());
             throw new NotLoggedInException();
          }
          else
          {
-            if (Events.exists()) Events.instance().raiseEvent(EVENT_NOT_AUTHORIZED);
+            manager.fireEvent(new NotAuthorizedEvent());
             throw new AuthorizationException(String.format(
                   "Authorization check failed for role [%s]", role));
          }
       }
    }
-
-   /**
-    * Checks that the current authenticated user has permission for
-    * the specified name and action
-    * 
-    * @param name String The permission name
-    * @param action String The permission action
-    * @param arg Object Optional object parameter used to make a permission decision
-    * @throws AuthorizationException if the user does not have the specified permission
-    */
-   public void checkPermission(String name, String action, Object...arg)
-   {
-      if (systemOp != null && Boolean.TRUE.equals(systemOp.get())) return; 
-      
-      tryLogin();
-      
-      if ( !hasPermission(name, action, arg) )
-      {
-         if ( !isLoggedIn() )
-         {
-            if (Events.exists()) Events.instance().raiseEvent(EVENT_NOT_LOGGED_IN);
-            throw new NotLoggedInException();
-         }
-         else
-         {
-            if (Events.exists()) Events.instance().raiseEvent(EVENT_NOT_AUTHORIZED);
-            throw new AuthorizationException(String.format(
-                  "Authorization check failed for permission [%s,%s]", name, action));
-         }
-      }
-   }
    
    public void checkPermission(Object target, String action)
    {
@@ -581,41 +516,17 @@
       {
          if ( !isLoggedIn() )
          {
-            if (Events.exists()) Events.instance().raiseEvent(EVENT_NOT_LOGGED_IN);
+            manager.fireEvent(new NotLoggedInEvent());
             throw new NotLoggedInException();            
          }
          else
          {
-            if (Events.exists()) Events.instance().raiseEvent(EVENT_NOT_AUTHORIZED);
+            manager.fireEvent(new NotAuthorizedEvent());
             throw new AuthorizationException(String.format(
                   "Authorization check failed for permission[%s,%s]", target, action));
          }
       }
    }
-
-   /**
-    * Performs a permission check for the specified name and action
-    * 
-    * @param name String The permission name
-    * @param action String The permission action
-    * @param arg Object Optional object parameter used to make a permission decision
-    * @return boolean True if the user has the specified permission
-    */
-   public boolean hasPermission(String name, String action, Object...arg)
-   {      
-      if (!securityEnabled) return true;
-      if (systemOp != null && Boolean.TRUE.equals(systemOp.get())) return true;   
-      if (permissionMapper == null) return false;
-         
-      if (arg != null)
-      {
-         return permissionMapper.resolvePermission(arg[0], action);
-      }
-      else
-      {
-         return permissionMapper.resolvePermission(name, action);
-      }
-   }   
    
    public void filterByPermission(Collection collection, String action)
    {
@@ -640,79 +551,12 @@
     * @return boolean The result of the expression evaluation
     */
    protected boolean evaluateExpression(String expr) 
-   {         
-      return Expressions.instance().createValueExpression(expr, Boolean.class).getValue();
+   {     
+      // TODO - EL evaluation
+      // return Expressions.instance().createValueExpression(expr, Boolean.class).getValue();
+      return false;
    }   
    
-   /**
-    * @see org.jboss.seam.security.Credentials#getUsername()
-    */
-   @Deprecated
-   public String getUsername()
-   {
-      return credentials.getUsername();
-   }
-
-   /**
-    * @see org.jboss.seam.security.Credentials#setUsername(String)
-    */
-   @Deprecated
-   public void setUsername(String username)
-   {  
-      credentials.setUsername(username);
-   }
-
-   /**
-    * @see org.jboss.seam.security.Credentials#getPassword()
-    */
-   @Deprecated
-   public String getPassword()
-   {
-      return credentials.getPassword();
-   }
-   
-   /**
-    * @see org.jboss.seam.security.Credentials#setPassword(String)
-    */   
-   @Deprecated
-   public void setPassword(String password)
-   {
-      credentials.setPassword(password);
-   }   
-   
-   /**
-    * @see org.jboss.seam.security.RememberMe#isEnabled()
-    */
-   @Deprecated
-   public boolean isRememberMe()
-   {
-      return rememberMe != null ? rememberMe.isEnabled() : false;
-   }
-   
-   /**
-    * @see org.jboss.seam.security.RememberMe#setEnabled(boolean)
-    */
-   @Deprecated
-   public void setRememberMe(boolean remember)
-   {
-      if (rememberMe != null) rememberMe.setEnabled(remember);
-   }   
-   
-   public Credentials getCredentials()
-   {
-      return credentials;
-   }   
-   
-   public MethodExpression getAuthenticateMethod()
-   {
-      return authenticateMethod;
-   }
-   
-   public void setAuthenticateMethod(MethodExpression authMethod)
-   {
-      this.authenticateMethod = authMethod;
-   }
-   
    public String getJaasConfigName()
    {
       return jaasConfigName;

Added: modules/trunk/security/src/main/java/org/jboss/seam/security/Secure.java
===================================================================
--- modules/trunk/security/src/main/java/org/jboss/seam/security/Secure.java	                        (rev 0)
+++ modules/trunk/security/src/main/java/org/jboss/seam/security/Secure.java	2009-04-21 05:43:10 UTC (rev 10540)
@@ -0,0 +1,25 @@
+package org.jboss.seam.security;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.interceptor.InterceptorBindingType;
+
+
+/**
+ * 
+ * @author Shane Bryzak
+ */
+ at Inherited
+ at InterceptorBindingType
+ at Target({TYPE, METHOD})
+ at Retention(RUNTIME)
+public @interface Secure
+{
+
+}

Modified: modules/trunk/security/src/main/java/org/jboss/seam/security/SecurityInterceptor.java
===================================================================
--- modules/trunk/security/src/main/java/org/jboss/seam/security/SecurityInterceptor.java	2009-04-21 05:12:50 UTC (rev 10539)
+++ modules/trunk/security/src/main/java/org/jboss/seam/security/SecurityInterceptor.java	2009-04-21 05:43:10 UTC (rev 10540)
@@ -8,16 +8,11 @@
 import java.util.Map;
 import java.util.Set;
 
-import org.jboss.seam.annotations.intercept.AroundInvoke;
-import org.jboss.seam.annotations.intercept.Interceptor;
-import org.jboss.seam.annotations.intercept.InterceptorType;
+import javax.interceptor.Interceptor;
+
 import org.jboss.seam.annotations.security.PermissionCheck;
 import org.jboss.seam.annotations.security.Restrict;
 import org.jboss.seam.annotations.security.RoleCheck;
-import org.jboss.seam.async.AsynchronousInterceptor;
-import org.jboss.seam.intercept.AbstractInterceptor;
-import org.jboss.seam.intercept.InvocationContext;
-import org.jboss.seam.transaction.RollbackInterceptor;
 import org.jboss.seam.util.Strings;
 
 /**
@@ -25,9 +20,8 @@
  * 
  * @author Shane Bryzak
  */
- at Interceptor(type=InterceptorType.CLIENT, 
-         around=AsynchronousInterceptor.class, within = RollbackInterceptor.class)
-public class SecurityInterceptor extends AbstractInterceptor implements Serializable
+ at Secure @Interceptor      
+public class SecurityInterceptor implements Serializable
 {
    private static final long serialVersionUID = -6567750187000766925L;
    

Added: modules/trunk/security/src/main/java/org/jboss/seam/security/events/AlreadyLoggedInEvent.java
===================================================================
--- modules/trunk/security/src/main/java/org/jboss/seam/security/events/AlreadyLoggedInEvent.java	                        (rev 0)
+++ modules/trunk/security/src/main/java/org/jboss/seam/security/events/AlreadyLoggedInEvent.java	2009-04-21 05:43:10 UTC (rev 10540)
@@ -0,0 +1,11 @@
+package org.jboss.seam.security.events;
+
+/**
+ * This event is fired when an already authenticated user attempts to authenticate again
+ *  
+ * @author Shane Bryzak
+ */
+public class AlreadyLoggedInEvent
+{
+
+}

Added: modules/trunk/security/src/main/java/org/jboss/seam/security/events/LoggedInEvent.java
===================================================================
--- modules/trunk/security/src/main/java/org/jboss/seam/security/events/LoggedInEvent.java	                        (rev 0)
+++ modules/trunk/security/src/main/java/org/jboss/seam/security/events/LoggedInEvent.java	2009-04-21 05:43:10 UTC (rev 10540)
@@ -0,0 +1,23 @@
+package org.jboss.seam.security.events;
+
+import java.security.Principal;
+
+/**
+ * This event is raised when user successfully logs in.
+ *  
+ * @author Shane Bryzak
+ */
+public class LoggedInEvent
+{
+   private Principal principal;
+   
+   public LoggedInEvent(Principal principal)
+   {
+      this.principal = principal;
+   }
+   
+   public Principal getPrincipal()
+   {
+      return principal;
+   }
+}

Added: modules/trunk/security/src/main/java/org/jboss/seam/security/events/LoggedOutEvent.java
===================================================================
--- modules/trunk/security/src/main/java/org/jboss/seam/security/events/LoggedOutEvent.java	                        (rev 0)
+++ modules/trunk/security/src/main/java/org/jboss/seam/security/events/LoggedOutEvent.java	2009-04-21 05:43:10 UTC (rev 10540)
@@ -0,0 +1,23 @@
+package org.jboss.seam.security.events;
+
+import java.security.Principal;
+
+/**
+ * This event is raised just after the user unauthenticates
+ * 
+ * @author Shane Bryzak
+ */
+public class LoggedOutEvent
+{
+   private Principal principal;
+   
+   public LoggedOutEvent(Principal principal)
+   {
+      this.principal = principal;
+   }
+   
+   public Principal getPrincipal()
+   {
+      return principal;
+   }
+}

Added: modules/trunk/security/src/main/java/org/jboss/seam/security/events/LoginFailedEvent.java
===================================================================
--- modules/trunk/security/src/main/java/org/jboss/seam/security/events/LoginFailedEvent.java	                        (rev 0)
+++ modules/trunk/security/src/main/java/org/jboss/seam/security/events/LoginFailedEvent.java	2009-04-21 05:43:10 UTC (rev 10540)
@@ -0,0 +1,11 @@
+package org.jboss.seam.security.events;
+
+/**
+ * This event is fired when an authentication attempt fails
+ *  
+ * @author Shane Bryzak
+ */
+public class LoginFailedEvent
+{
+
+}

Added: modules/trunk/security/src/main/java/org/jboss/seam/security/events/NotAuthorizedEvent.java
===================================================================
--- modules/trunk/security/src/main/java/org/jboss/seam/security/events/NotAuthorizedEvent.java	                        (rev 0)
+++ modules/trunk/security/src/main/java/org/jboss/seam/security/events/NotAuthorizedEvent.java	2009-04-21 05:43:10 UTC (rev 10540)
@@ -0,0 +1,11 @@
+package org.jboss.seam.security.events;
+
+/**
+ * This event is raised when the user is not authorized to perform an operation
+ *  
+ * @author Shane Bryzak
+ */
+public class NotAuthorizedEvent
+{
+
+}

Added: modules/trunk/security/src/main/java/org/jboss/seam/security/events/NotLoggedInEvent.java
===================================================================
--- modules/trunk/security/src/main/java/org/jboss/seam/security/events/NotLoggedInEvent.java	                        (rev 0)
+++ modules/trunk/security/src/main/java/org/jboss/seam/security/events/NotLoggedInEvent.java	2009-04-21 05:43:10 UTC (rev 10540)
@@ -0,0 +1,11 @@
+package org.jboss.seam.security.events;
+
+/**
+ * This event is raised when an unauthenticated user attempts to performed a privileged operation
+ * 
+ * @author Shane Bryzak
+ */
+public class NotLoggedInEvent
+{
+
+}

Added: modules/trunk/security/src/main/java/org/jboss/seam/security/events/PostAuthenticateEvent.java
===================================================================
--- modules/trunk/security/src/main/java/org/jboss/seam/security/events/PostAuthenticateEvent.java	                        (rev 0)
+++ modules/trunk/security/src/main/java/org/jboss/seam/security/events/PostAuthenticateEvent.java	2009-04-21 05:43:10 UTC (rev 10540)
@@ -0,0 +1,11 @@
+package org.jboss.seam.security.events;
+
+/**
+ * This event is raised just after authentication
+ *  
+ * @author Shane Bryzak
+ */
+public class PostAuthenticateEvent
+{
+
+}

Added: modules/trunk/security/src/main/java/org/jboss/seam/security/events/PreAuthenticateEvent.java
===================================================================
--- modules/trunk/security/src/main/java/org/jboss/seam/security/events/PreAuthenticateEvent.java	                        (rev 0)
+++ modules/trunk/security/src/main/java/org/jboss/seam/security/events/PreAuthenticateEvent.java	2009-04-21 05:43:10 UTC (rev 10540)
@@ -0,0 +1,11 @@
+package org.jboss.seam.security.events;
+
+/**
+ * This event is raised just before authentication.
+ *  
+ * @author Shane Bryzak
+ */
+public class PreAuthenticateEvent
+{
+
+}

Added: modules/trunk/security/src/main/java/org/jboss/seam/security/events/QuietLoginEvent.java
===================================================================
--- modules/trunk/security/src/main/java/org/jboss/seam/security/events/QuietLoginEvent.java	                        (rev 0)
+++ modules/trunk/security/src/main/java/org/jboss/seam/security/events/QuietLoginEvent.java	2009-04-21 05:43:10 UTC (rev 10540)
@@ -0,0 +1,11 @@
+package org.jboss.seam.security.events;
+
+/**
+ * This event is raised when the user performs a quiet login
+ *  
+ * @author Shane Bryzak
+ */
+public class QuietLoginEvent
+{
+
+}




More information about the seam-commits mailing list