continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From car...@apache.org
Subject svn commit: r439897 - in /maven/continuum/branches/continuum-acegi: ./ continuum-core/src/main/java/org/apache/maven/continuum/ continuum-core/src/main/java/org/apache/maven/continuum/initialization/ continuum-core/src/main/java/org/apache/maven/contin...
Date Mon, 04 Sep 2006 01:49:04 GMT
Author: carlos
Date: Sun Sep  3 18:48:58 2006
New Revision: 439897

URL: http://svn.apache.org/viewvc?view=rev&rev=439897
Log:
Integrate maven-user in continuum-acegi

Added:
    maven/continuum/branches/continuum-acegi/continuum-model/src/main/java/org/apache/maven/continuum/model/
    maven/continuum/branches/continuum-acegi/continuum-model/src/main/java/org/apache/maven/continuum/model/system/
    maven/continuum/branches/continuum-acegi/continuum-model/src/main/java/org/apache/maven/continuum/model/system/ContinuumUser.java   (with props)
    maven/continuum/branches/continuum-acegi/continuum-model/src/main/java/org/apache/maven/continuum/model/system/Permission.java   (with props)
    maven/continuum/branches/continuum-acegi/continuum-model/src/main/java/org/apache/maven/continuum/model/system/UserGroup.java   (with props)
    maven/continuum/branches/continuum-acegi/continuum-model/src/main/resources/
    maven/continuum/branches/continuum-acegi/continuum-model/src/main/resources/META-INF/
    maven/continuum/branches/continuum-acegi/continuum-model/src/main/resources/META-INF/package.jdo
Removed:
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/mdo/session-models.mdo
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/webapp/addUser.jsp
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/webapp/addUserRole.jsp
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/webapp/deleteUser.jsp
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/webapp/editUser.jsp
Modified:
    maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/initialization/DefaultContinuumInitializer.java
    maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/security/ContinuumAuthenticator.java
    maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/security/DefaultContinuumSecurity.java
    maven/continuum/branches/continuum-acegi/continuum-core/src/main/resources/META-INF/plexus/components.xml
    maven/continuum/branches/continuum-acegi/continuum-model/pom.xml
    maven/continuum/branches/continuum-acegi/continuum-model/src/main/mdo/continuum.mdo
    maven/continuum/branches/continuum-acegi/continuum-security/continuum-security-acegi/src/main/java/org/apache/maven/continuum/security/acegi/ContinuumUserDetailsService.java
    maven/continuum/branches/continuum-acegi/continuum-security/continuum-security-acegi/src/test/java/org/apache/maven/continuum/security/acegi/ContinuumUserDetailsServiceTest.java
    maven/continuum/branches/continuum-acegi/continuum-webapp/pom.xml
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/resources/META-INF/plexus/application.xml
    maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/webapp/configurationEdit.jsp
    maven/continuum/branches/continuum-acegi/pom.xml

Modified: maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?view=diff&rev=439897&r1=439896&r2=439897
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java (original)
+++ maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java Sun Sep  3 18:48:58 2006
@@ -50,6 +50,8 @@
 import org.apache.maven.continuum.utils.PlexusContainerManager;
 import org.apache.maven.continuum.utils.ProjectSorter;
 import org.apache.maven.continuum.utils.WorkingDirectoryService;
+import org.apache.maven.user.model.PasswordRuleViolationException;
+import org.apache.maven.user.model.UserManager;
 import org.codehaus.plexus.PlexusConstants;
 import org.codehaus.plexus.PlexusContainer;
 import org.codehaus.plexus.action.Action;
@@ -105,6 +107,11 @@
      * @plexus.requirement
      */
     private ContinuumStore store;
+    
+    /**
+     * @plexus.requirement
+     */
+    private UserManager userManager;
 
     /**
      * @plexus.requirement
@@ -1791,24 +1798,35 @@
     public List getUsers()
         throws ContinuumException
     {
-        try
-        {
-            return store.getUsers();
-        }
-        catch ( ContinuumStoreException ex )
-        {
-            throw logAndCreateException( "Error while getting users.", ex );
-        }
+//        try
+//        {
+            return userManager.getUsers();
+//        }
+//        catch ( EntityNotFoundException ex )
+//        {
+//            throw logAndCreateException( "Error while getting users.", ex );
+//        }
     }
 
     public void addUser( ContinuumUser user )
         throws ContinuumException
     {
-        if ( StringUtils.isEmpty( user.getHashedPassword() ) )
+        if ( StringUtils.isEmpty( user.getPassword() ) )
         {
             throw new ContinuumException( "Password can't be null" );
         }
-        store.addUser( user );
+        try
+        {
+            userManager.addUser( user );
+        }
+//        catch ( EntityExistsException eee )
+//        {
+//            throw new ContinuumException( "Error adding " + user.getUsername() + ", the user already exists.", eee );
+//        }
+        catch ( PasswordRuleViolationException pre )
+        {
+            throw new ContinuumException( "There was a password rule violation.", pre );
+        }
     }
 
     public void addUser( Map configuration )
@@ -1832,20 +1850,21 @@
     public void updateUser( ContinuumUser user )
         throws ContinuumException
     {
-        if ( StringUtils.isEmpty( user.getHashedPassword() ) )
+        if ( StringUtils.isEmpty( user.getEncodedPassword() ) )
         {
             ContinuumUser u = getUser( user.getAccountId() );
 
-            user.setHashedPassword( u.getHashedPassword() );
+            user.setEncodedPassword( u.getEncodedPassword() );
         }
 
         try
         {
-            store.updateUser( user );
+            userManager.updateUser( user );
         }
-        catch ( ContinuumStoreException ex )
+        catch ( PasswordRuleViolationException pre )
+        // TODO this must be thrown
         {
-            throw logAndCreateException( "Error while storing user.", ex );
+            throw new ContinuumException( "There was a password rule violation.", pre );
         }
     }
 
@@ -1872,7 +1891,7 @@
     {
         try
         {
-            return store.getUser( userId );
+            return ( ContinuumUser ) userManager.getUser( userId );
         }
         catch ( Exception ex )
         {
@@ -1883,9 +1902,7 @@
     public void removeUser( int userId )
         throws ContinuumException
     {
-        ContinuumUser user = getUser( userId );
-
-        store.removeUser( user );
+        userManager.removeUser( userId );
     }
 
     // ----------------------------------------------------------------------
@@ -1895,19 +1912,19 @@
     public List getUserGroups()
         throws ContinuumException
     {
-        try
-        {
-            return store.getUserGroups();
-        }
-        catch ( ContinuumStoreException ex )
-        {
-            throw logAndCreateException( "Error while getting user groups.", ex );
-        }
+//        try
+//        {
+            return userManager.getUserGroups();
+//        }
+//        catch ( EntityNotFoundException ex )
+//        {
+//            throw logAndCreateException( "Error while getting user groups.", ex );
+//        }
     }
 
     public void addUserGroup( UserGroup userGroup )
     {
-        store.addUserGroup( userGroup );
+        userManager.addUserGroup( userGroup );
     }
 
     public void addUserGroup( Map configuration )
@@ -1963,72 +1980,72 @@
 
         if ( convertBoolean( (String) configuration.get( "group.permission.addProject" ) ) )
         {
-            perms.add( store.getPermission( "addProject" ) );
+            perms.add( userManager.getPermission( "addProject" ) );
         }
 
         if ( convertBoolean( (String) configuration.get( "group.permission.editProject" ) ) )
         {
-            perms.add( store.getPermission( "editProject" ) );
+            perms.add( userManager.getPermission( "editProject" ) );
         }
 
         if ( convertBoolean( (String) configuration.get( "group.permission.deleteProject" ) ) )
         {
-            perms.add( store.getPermission( "deleteProject" ) );
+            perms.add( userManager.getPermission( "deleteProject" ) );
         }
 
         if ( convertBoolean( (String) configuration.get( "group.permission.buildProject" ) ) )
         {
-            perms.add( store.getPermission( "buildProject" ) );
+            perms.add( userManager.getPermission( "buildProject" ) );
         }
 
         if ( convertBoolean( (String) configuration.get( "group.permission.showProject" ) ) )
         {
-            perms.add( store.getPermission( "showProject" ) );
+            perms.add( userManager.getPermission( "showProject" ) );
         }
 
-        if ( convertBoolean( (String) configuration.get( "group.permission.addBuildDefinitionToProject" ) ) )
+        if ( convertBoolean( (String) configuration.get( "group.permission.addBuildDefinition" ) ) )
         {
-            perms.add( store.getPermission( "addBuildDefinitionToProject" ) );
+            perms.add( userManager.getPermission( "addBuildDefinition" ) );
         }
 
         if ( convertBoolean( (String) configuration.get( "group.permission.editBuildDefinition" ) ) )
         {
-            perms.add( store.getPermission( "editBuildDefinition" ) );
+            perms.add( userManager.getPermission( "editBuildDefinition" ) );
         }
 
         if ( convertBoolean( (String) configuration.get( "group.permission.deleteBuildDefinition" ) ) )
         {
-            perms.add( store.getPermission( "deleteBuildDefinition" ) );
+            perms.add( userManager.getPermission( "deleteBuildDefinition" ) );
         }
 
         if ( convertBoolean( (String) configuration.get( "group.permission.addNotifier" ) ) )
         {
-            perms.add( store.getPermission( "addNotifier" ) );
+            perms.add( userManager.getPermission( "addNotifier" ) );
         }
 
         if ( convertBoolean( (String) configuration.get( "group.permission.editNotifier" ) ) )
         {
-            perms.add( store.getPermission( "editNotifier" ) );
+            perms.add( userManager.getPermission( "editNotifier" ) );
         }
 
         if ( convertBoolean( (String) configuration.get( "group.permission.deleteNotifier" ) ) )
         {
-            perms.add( store.getPermission( "deleteNotifier" ) );
+            perms.add( userManager.getPermission( "deleteNotifier" ) );
         }
 
         if ( convertBoolean( (String) configuration.get( "group.permission.manageConfiguration" ) ) )
         {
-            perms.add( store.getPermission( "manageConfiguration" ) );
+            perms.add( userManager.getPermission( "manageConfiguration" ) );
         }
 
         if ( convertBoolean( (String) configuration.get( "group.permission.manageSchedule" ) ) )
         {
-            perms.add( store.getPermission( "manageSchedule" ) );
+            perms.add( userManager.getPermission( "manageSchedule" ) );
         }
 
         if ( convertBoolean( (String) configuration.get( "group.permission.manageUsers" ) ) )
         {
-            perms.add( store.getPermission( "manageUsers" ) );
+            perms.add( userManager.getPermission( "manageUsers" ) );
         }
 
         return perms;
@@ -2037,35 +2054,33 @@
     public void updateUserGroup( UserGroup userGroup )
         throws ContinuumException
     {
-        try
-        {
-            store.updateUserGroup( userGroup );
-        }
-        catch ( ContinuumStoreException e )
-        {
-            throw logAndCreateException( "Error while storing user group.", e );
-        }
+//        try
+//        {
+            userManager.updateUserGroup( userGroup );
+//        }
+//        catch ( EntityNotFoundException e )
+//        {
+//            throw logAndCreateException( "Error while storing user group.", e );
+//        }
     }
 
     public UserGroup getUserGroup( int userGroupId )
         throws ContinuumException
     {
-        try
-        {
-            return store.getUserGroup( userGroupId );
-        }
-        catch ( Exception ex )
-        {
-            throw logAndCreateException( "Error while getting user group.", ex );
-        }
+//        try
+//        {
+            return ( UserGroup ) userManager.getUserGroup( userGroupId );
+//        }
+//        catch ( Exception ex )
+//        {
+//            throw logAndCreateException( "Error while getting user group.", ex );
+//        }
     }
 
     public void removeUserGroup( int userGroupId )
         throws ContinuumException
     {
-        UserGroup group = getUserGroup( userGroupId );
-
-        store.removeUserGroup( group );
+        userManager.removeUserGroup( userGroupId );
     }
 
     // ----------------------------------------------------------------------

Modified: maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/initialization/DefaultContinuumInitializer.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/initialization/DefaultContinuumInitializer.java?view=diff&rev=439897&r1=439896&r2=439897
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/initialization/DefaultContinuumInitializer.java (original)
+++ maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/initialization/DefaultContinuumInitializer.java Sun Sep  3 18:48:58 2006
@@ -16,6 +16,9 @@
  * limitations under the License.
  */
 
+import java.util.ArrayList;
+import java.util.List;
+
 import org.apache.maven.continuum.model.project.Schedule;
 import org.apache.maven.continuum.model.system.ContinuumUser;
 import org.apache.maven.continuum.model.system.Permission;
@@ -65,6 +68,11 @@
      * @plexus.requirement
      */
     private ContinuumStore store;
+    
+    /**
+     * @plexus.requirement
+     */
+    private UserManager userManager;
 
     // ----------------------------------------------------------------------
     //
@@ -74,6 +82,20 @@
         throws ContinuumInitializationException
     {
         getLogger().info( "Continuum initializer running ..." );
+        
+        if ( getLogger().isDebugEnabled() )
+        {
+            getLogger().info( "Dumping JPOX/JDO Schema Details ..." );
+            try
+            {
+                SchemaTool.outputDBInfo( null, true );
+                SchemaTool.outputSchemaInfo( null, true );
+            }
+            catch ( Exception e )
+            {
+                e.printStackTrace( System.err );
+            }
+        }
 
         try
         {
@@ -170,7 +192,7 @@
     private Permission createPermission( String name, String description )
         throws ContinuumStoreException
     {
-        Permission perm = store.getPermission( name );
+        Permission perm = ( Permission ) userManager.getPermission( name );
 
         if ( perm == null )
         {
@@ -180,7 +202,7 @@
 
             perm.setDescription( description );
 
-            perm = store.addPermission( perm );
+            perm = ( Permission ) userManager.addPermission( perm );
         }
 
         return perm;
@@ -190,9 +212,9 @@
         throws ContinuumStoreException
     {
         // Continuum Administrator
-        if ( store.getUserGroup( ContinuumSecurity.ADMIN_GROUP_NAME ) == null )
+        if ( userManager.getUserGroup( ContinuumSecurity.ADMIN_GROUP_NAME ) == null )
         {
-            List adminPermissions = store.getPermissions();
+            List adminPermissions = userManager.getPermissions();
 
             UserGroup adminGroup = new UserGroup();
 
@@ -202,11 +224,11 @@
 
             adminGroup.setPermissions( adminPermissions );
 
-            store.addUserGroup( adminGroup );
+            userManager.addUserGroup( adminGroup );
         }
 
         // Continuum Guest
-        if ( store.getUserGroup( ContinuumSecurity.GUEST_GROUP_NAME ) == null )
+        if ( userManager.getUserGroup( ContinuumSecurity.GUEST_GROUP_NAME ) == null )
         {
             UserGroup guestGroup = new UserGroup();
 
@@ -216,20 +238,20 @@
 
             List guestPermissions = new ArrayList();
 
-            guestPermissions.add( store.getPermission( "buildProject" ) );
+            guestPermissions.add( userManager.getPermission( "buildProject" ) );
 
-            guestPermissions.add( store.getPermission( "showProject" ) );
+            guestPermissions.add( userManager.getPermission( "showProject" ) );
 
             guestGroup.setPermissions( guestPermissions );
 
-            store.addUserGroup( guestGroup );
+            userManager.addUserGroup( guestGroup );
         }
     }
 
     private void createGuestUser()
         throws ContinuumStoreException
     {
-        if ( store.getGuestUser() == null )
+        if ( userManager.getGuestUser() == null )
         {
             ContinuumUser guest = new ContinuumUser();
 
@@ -237,18 +259,30 @@
 
             guest.setFullName( "Anonymous User" );
 
-            guest.setGroup( store.getUserGroup( ContinuumSecurity.GUEST_GROUP_NAME ) );
+            guest.setGroup( userManager.getUserGroup( ContinuumSecurity.GUEST_GROUP_NAME ) );
 
             guest.setGuest( true );
 
-            store.addUser( guest );
+            try
+            {
+                userManager.addUser( guest );
+            }
+// TODO
+//            catch ( EntityExistsException eee )
+//            {
+//                throw new ContinuumStoreException( "Error adding user, the user already exists.", eee );
+//            }
+            catch ( PasswordRuleViolationException pre )
+            {
+                throw new ContinuumStoreException( "There was a password rule violation.", pre );
+            }
         }
     }
 
     private void createAdminUser()
         throws ContinuumStoreException
     {
-        if ( store.getUserByUsername( "admin" ) == null )
+        if ( userManager.getUser( "admin" ) == null )
         {
             ContinuumUser admin = new ContinuumUser();
 
@@ -256,11 +290,23 @@
 
             admin.setFullName( "Administrator" );
 
-            admin.setGroup( store.getUserGroup( ContinuumSecurity.ADMIN_GROUP_NAME ) );
+            admin.setGroup( userManager.getUserGroup( ContinuumSecurity.ADMIN_GROUP_NAME ) );
 
             admin.setPassword( "admin" );
 
-            store.addUser( admin );
+            try
+            {
+                userManager.addUser( admin );
+            }
+// TODO
+//            catch ( EntityExistsException eee )
+//            {
+//                throw new ContinuumStoreException( "The user already exists.", eee );
+//            }
+            catch ( PasswordRuleViolationException pre )
+            {
+                throw new ContinuumStoreException( "There was a password rule violation.", pre );
+            }
         }
     }
 }

Modified: maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/security/ContinuumAuthenticator.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/security/ContinuumAuthenticator.java?view=diff&rev=439897&r1=439896&r2=439897
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/security/ContinuumAuthenticator.java (original)
+++ maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/security/ContinuumAuthenticator.java Sun Sep  3 18:48:58 2006
@@ -20,8 +20,7 @@
 import java.util.Map;
 
 import org.apache.maven.continuum.model.system.ContinuumUser;
-import org.apache.maven.continuum.store.ContinuumStore;
-import org.apache.maven.continuum.store.ContinuumStoreException;
+import org.apache.maven.user.model.UserManager;
 import org.codehaus.plexus.security.Authentication;
 import org.codehaus.plexus.security.Authenticator;
 import org.codehaus.plexus.security.exception.AuthenticationException;
@@ -37,10 +36,11 @@
 public class ContinuumAuthenticator
     implements Authenticator
 {
+    
     /**
      * @plexus.requirement
      */
-    private ContinuumStore store;
+    private UserManager userManager;
 
     // ----------------------------------------------------------------------
     // Authenticator Implementation
@@ -83,13 +83,6 @@
     private ContinuumUser getUser( String username )
         throws AuthenticationException
     {
-        try
-        {
-            return store.getUserByUsername( username );
-        }
-        catch ( ContinuumStoreException e )
-        {
-            throw new AuthenticationException( "Error while retreiving user.", e );
-        }
+        return ( ContinuumUser ) userManager.getUserByUsername( username );
     }
 }

Modified: maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/security/DefaultContinuumSecurity.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/security/DefaultContinuumSecurity.java?view=diff&rev=439897&r1=439896&r2=439897
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/security/DefaultContinuumSecurity.java (original)
+++ maven/continuum/branches/continuum-acegi/continuum-core/src/main/java/org/apache/maven/continuum/security/DefaultContinuumSecurity.java Sun Sep  3 18:48:58 2006
@@ -19,8 +19,7 @@
 import org.apache.maven.continuum.model.system.ContinuumUser;
 import org.apache.maven.continuum.model.system.Permission;
 import org.apache.maven.continuum.model.system.UserGroup;
-import org.apache.maven.continuum.store.ContinuumStore;
-import org.apache.maven.continuum.store.ContinuumStoreException;
+import org.apache.maven.user.model.UserManager;
 
 import java.util.Iterator;
 import java.util.List;
@@ -35,7 +34,7 @@
     /**
      * @plexus.requirement
      */
-    private ContinuumStore store;
+    private UserManager userManager;
 
     public List getPermissions( ContinuumUser user )
         throws ContinuumSecurityException
@@ -47,7 +46,7 @@
             u = getGuestUser();
         }
 
-        return getPermissions( u.getGroup() );
+        return getPermissions( ( UserGroup ) u.getGroup() );
     }
 
     public List getPermissions( UserGroup group )
@@ -98,13 +97,6 @@
     public ContinuumUser getGuestUser()
         throws ContinuumSecurityException
     {
-        try
-        {
-            return store.getGuestUser();
-        }
-        catch ( ContinuumStoreException e )
-        {
-            throw new ContinuumSecurityException( "Can't obtain guest user.", e );
-        }
+        return ( ContinuumUser ) userManager.getGuestUser();
     }
 }

Modified: maven/continuum/branches/continuum-acegi/continuum-core/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-core/src/main/resources/META-INF/plexus/components.xml?view=diff&rev=439897&r1=439896&r2=439897
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-core/src/main/resources/META-INF/plexus/components.xml (original)
+++ maven/continuum/branches/continuum-acegi/continuum-core/src/main/resources/META-INF/plexus/components.xml Sun Sep  3 18:48:58 2006
@@ -23,6 +23,10 @@
         <requirement>
           <role>org.apache.maven.continuum.build.settings.SchedulesActivator</role>
         </requirement>
+        <requirement>
+          <role>org.apache.maven.user.model.UserManager</role>
+          <field-name>userManager</field-name>
+        </requirement>
         <!-- from core -->
         <requirement>
           <role>org.codehaus.plexus.taskqueue.TaskQueue</role>
@@ -64,7 +68,7 @@
       <implementation>org.apache.maven.continuum.security.DefaultContinuumSecurity</implementation>
       <requirements>
         <requirement>
-          <role>org.apache.maven.continuum.store.ContinuumStore</role>
+          <role>org.apache.maven.user.model.UserManager</role>
         </requirement>
       </requirements>
     </component>
@@ -75,6 +79,9 @@
       <requirements>
         <requirement>
           <role>org.apache.maven.continuum.store.ContinuumStore</role>
+        </requirement>
+        <requirement>
+          <role>org.apache.maven.user.model.UserManager</role>
         </requirement>
       </requirements>
     </component>

Modified: maven/continuum/branches/continuum-acegi/continuum-model/pom.xml
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-model/pom.xml?view=diff&rev=439897&r1=439896&r2=439897
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-model/pom.xml (original)
+++ maven/continuum/branches/continuum-acegi/continuum-model/pom.xml Sun Sep  3 18:48:58 2006
@@ -21,7 +21,6 @@
           <execution>
             <goals>
               <goal>java</goal>
-              <goal>jpox-jdo-mapping</goal>
             </goals>
           </execution>
         </executions>
@@ -45,4 +44,10 @@
       </plugin>
     </plugins>
   </build>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven.shared.user</groupId>
+      <artifactId>maven-user-model</artifactId>
+    </dependency>
+  </dependencies>
 </project>

Added: maven/continuum/branches/continuum-acegi/continuum-model/src/main/java/org/apache/maven/continuum/model/system/ContinuumUser.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-model/src/main/java/org/apache/maven/continuum/model/system/ContinuumUser.java?view=auto&rev=439897
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-model/src/main/java/org/apache/maven/continuum/model/system/ContinuumUser.java (added)
+++ maven/continuum/branches/continuum-acegi/continuum-model/src/main/java/org/apache/maven/continuum/model/system/ContinuumUser.java Sun Sep  3 18:48:58 2006
@@ -0,0 +1,106 @@
+package org.apache.maven.continuum.model.system;
+
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.util.Date;
+
+import org.apache.maven.user.model.User;
+
+/**
+ * @author Henry Isidro
+ * @version $Id$
+ */
+public class ContinuumUser
+    extends User
+{
+    /*
+    public String getPassword()
+    {
+        return super.getPassword();
+    }
+
+    public void setPassword( String password )
+    {
+        setEncodedPassword( crypt( password ) );
+    }
+    */
+    
+    public boolean equalsPassword( String password )
+    {
+        if ( getEncodedPassword() == null && password == null )
+        {
+            return true;
+        }
+
+        if ( ( getEncodedPassword() == null && password != null ) || ( getEncodedPassword() == null && password != null ) )
+        {
+            return false;
+        }
+
+        return getEncodedPassword().equals( crypt( password ) );
+    }
+
+    private String crypt( String data )
+    {
+        try
+        {
+            java.security.MessageDigest digester = java.security.MessageDigest.getInstance( "SHA-1" );
+            digester.reset();
+            digester.update( data.getBytes() );
+            return encode( digester.digest() );
+        }
+        catch( Exception e )
+        {
+            return data;
+        }
+    }
+
+    /**
+     * Encodes a 128 bit or 160-bit byte array into a String.
+     *
+     * @param binaryData Array containing the digest
+     * @return Encoded hex string, or null if encoding failed
+     */
+    
+    private String encode( byte[] binaryData )
+    {
+        if ( binaryData.length != 16 && binaryData.length != 20 )
+        {
+            int bitLength = binaryData.length * 8;
+            throw new IllegalArgumentException( "Unrecognised length for binary data: " + bitLength + " bits" );
+        }
+
+        String retValue = "";
+
+        for ( int i = 0; i < binaryData.length; i++ )
+        {
+            String t = Integer.toHexString( binaryData[i] & 0xff );
+
+            if ( t.length() == 1 )
+            {
+                retValue += ( "0" + t );
+            }
+            else
+            {
+                retValue += t;
+            }
+        }
+
+        return retValue.trim();
+    }
+        
+}

Propchange: maven/continuum/branches/continuum-acegi/continuum-model/src/main/java/org/apache/maven/continuum/model/system/ContinuumUser.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/branches/continuum-acegi/continuum-model/src/main/java/org/apache/maven/continuum/model/system/ContinuumUser.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/continuum/branches/continuum-acegi/continuum-model/src/main/java/org/apache/maven/continuum/model/system/Permission.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-model/src/main/java/org/apache/maven/continuum/model/system/Permission.java?view=auto&rev=439897
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-model/src/main/java/org/apache/maven/continuum/model/system/Permission.java (added)
+++ maven/continuum/branches/continuum-acegi/continuum-model/src/main/java/org/apache/maven/continuum/model/system/Permission.java Sun Sep  3 18:48:58 2006
@@ -0,0 +1,27 @@
+package org.apache.maven.continuum.model.system;
+
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @author Henry Isidro
+ * @version $Id$
+ */
+public class Permission
+    extends org.apache.maven.user.model.Permission
+{
+
+}

Propchange: maven/continuum/branches/continuum-acegi/continuum-model/src/main/java/org/apache/maven/continuum/model/system/Permission.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/branches/continuum-acegi/continuum-model/src/main/java/org/apache/maven/continuum/model/system/Permission.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/continuum/branches/continuum-acegi/continuum-model/src/main/java/org/apache/maven/continuum/model/system/UserGroup.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-model/src/main/java/org/apache/maven/continuum/model/system/UserGroup.java?view=auto&rev=439897
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-model/src/main/java/org/apache/maven/continuum/model/system/UserGroup.java (added)
+++ maven/continuum/branches/continuum-acegi/continuum-model/src/main/java/org/apache/maven/continuum/model/system/UserGroup.java Sun Sep  3 18:48:58 2006
@@ -0,0 +1,27 @@
+package org.apache.maven.continuum.model.system;
+
+/*
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @author Henry Isidro
+ * @version $Id$
+ */
+public class UserGroup
+    extends org.apache.maven.user.model.UserGroup
+{
+
+}

Propchange: maven/continuum/branches/continuum-acegi/continuum-model/src/main/java/org/apache/maven/continuum/model/system/UserGroup.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/branches/continuum-acegi/continuum-model/src/main/java/org/apache/maven/continuum/model/system/UserGroup.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: maven/continuum/branches/continuum-acegi/continuum-model/src/main/mdo/continuum.mdo
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-model/src/main/mdo/continuum.mdo?view=diff&rev=439897&r1=439896&r2=439897
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-model/src/main/mdo/continuum.mdo (original)
+++ maven/continuum/branches/continuum-acegi/continuum-model/src/main/mdo/continuum.mdo Sun Sep  3 18:48:58 2006
@@ -956,195 +956,6 @@
     </class>
 
     <class>
-      <name>UserGroup</name>
-      <packageName>org.apache.maven.continuum.model.system</packageName>
-      <version>1.0.0+</version>
-      <fields>
-        <field>
-          <name>id</name>
-          <identifier>true</identifier>
-          <version>1.0.0+</version>
-          <type>int</type>
-        </field>
-        <field>
-          <name>name</name>
-          <version>1.0.0+</version>
-          <type>String</type>
-        </field>
-        <field>
-          <name>description</name>
-          <version>1.0.0+</version>
-          <type>String</type>
-        </field>
-        <field>
-          <name>permissions</name>
-          <version>1.0.0+</version>
-          <association stash.part="true" jpox.dependent="false">
-            <type>Permission</type>
-            <multiplicity>*</multiplicity>
-          </association>
-        </field>
-      </fields>
-    </class>
-    <class>
-      <name>ContinuumUser</name>
-      <packageName>org.apache.maven.continuum.model.system</packageName>
-      <version>1.0.0+</version>
-      <fields>
-        <field>
-          <name>accountId</name>
-          <version>1.0.0+</version>
-          <type>int</type>
-          <identifier>true</identifier>
-        </field>
-        <field>
-          <name>username</name>
-          <version>1.0.0+</version>
-          <type>String</type>
-        </field>
-        <field>
-          <name>guest</name>
-          <version>1.0.0+</version>
-          <type>boolean</type>
-          <defaultValue>false</defaultValue>
-        </field>
-        <field>
-          <name>hashedPassword</name>
-          <version>1.0.0+</version>
-          <type>String</type>
-        </field>
-        <field>
-          <name>fullName</name>
-          <version>1.0.0+</version>
-          <type>String</type>
-        </field>
-        <field>
-          <name>email</name>
-          <version>1.0.0+</version>
-          <type>String</type>
-        </field>
-        <field>
-          <name>group</name>
-          <version>1.0.0+</version>
-          <association stash.part="true" jpox.dependent="false">
-            <type>UserGroup</type>
-          </association>
-        </field>
-        <field>
-          <name>notificationAddresses</name>
-          <version>1.0.0+</version>
-          <association stash.part="true" >
-            <type>NotificationAddress</type>
-            <multiplicity>*</multiplicity>
-          </association>
-        </field>
-      </fields>
-      <codeSegments>
-        <codeSegment>
-          <version>1.0.0+</version>
-          <code><![CDATA[
-            public String getPassword()
-            {
-                return "";
-            }
-
-            public void setPassword( String password )
-            {
-                setHashedPassword( crypt( password ) );
-            }
-
-            public boolean equalsPassword( String password )
-            {
-                if ( hashedPassword == null && password == null )
-                {
-                    return true;
-                }
-
-                if ( ( hashedPassword == null && password != null ) || ( hashedPassword == null && password != null ) )
-                {
-                    return false;
-                }
-
-                return hashedPassword.equals( crypt( password ) );
-            }
-
-            private String crypt( String data )
-            {
-                try
-                {
-                    java.security.MessageDigest digester = java.security.MessageDigest.getInstance( "SHA-1" );
-                    digester.reset();
-                    digester.update( data.getBytes() );
-                    return encode( digester.digest() );
-                }
-                catch( Exception e )
-                {
-                    return data;
-                }
-            }
-
-            /**
-             * Encodes a 128 bit or 160-bit byte array into a String.
-             *
-             * @param binaryData Array containing the digest
-             * @return Encoded hex string, or null if encoding failed
-             */
-            private String encode( byte[] binaryData )
-            {
-                if ( binaryData.length != 16 && binaryData.length != 20 )
-                {
-                    int bitLength = binaryData.length * 8;
-                    throw new IllegalArgumentException( "Unrecognised length for binary data: " + bitLength + " bits" );
-                }
-
-                String retValue = "";
-
-                for ( int i = 0; i < binaryData.length; i++ )
-                {
-                    String t = Integer.toHexString( binaryData[i] & 0xff );
-        
-                    if ( t.length() == 1 )
-                    {
-                        retValue += ( "0" + t );
-                    }
-                    else
-                    {
-                        retValue += t;
-                    }
-                }
-
-                return retValue.trim();
-            }
-          ]]></code>
-        </codeSegment>
-      </codeSegments>
-    </class>
-
-    <class>
-      <name>Permission</name>
-      <packageName>org.apache.maven.continuum.model.system</packageName>
-      <version>1.0.0+</version>
-      <fields>
-        <field>
-          <name>id</name>
-          <identifier>true</identifier>
-          <version>1.0.0+</version>
-          <type>int</type>
-        </field>
-        <field>
-          <name>name</name>
-          <version>1.0.0+</version>
-          <type>String</type>
-        </field>
-        <field>
-          <name>description</name>
-          <version>1.0.0+</version>
-          <type>String</type>
-        </field>
-      </fields>
-    </class>
-
-    <class>
       <name>NotificationAddress</name>
       <version>1.0.0+</version>
       <packageName>org.apache.maven.continuum.model.system</packageName>

Added: maven/continuum/branches/continuum-acegi/continuum-model/src/main/resources/META-INF/package.jdo
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-model/src/main/resources/META-INF/package.jdo?view=auto&rev=439897
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-model/src/main/resources/META-INF/package.jdo (added)
+++ maven/continuum/branches/continuum-acegi/continuum-model/src/main/resources/META-INF/package.jdo Sun Sep  3 18:48:58 2006
@@ -0,0 +1,306 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE jdo PUBLIC
+  "-//Sun Microsystems, Inc.//DTD Java Data Objects Metadata 2.0//EN"
+  "http://java.sun.com/dtd/jdo_2_0.dtd">
+
+<jdo>
+  <package name="org.apache.maven.continuum.model.project">
+    <class name="ProjectGroup" detachable="true" identity-type="application" objectid-class="javax.jdo.identity.IntIdentity">
+      <field name="id" primary-key="true" value-strategy="native"/>
+      <field name="groupId"/>
+      <field name="name"/>
+      <field name="description">
+        <column length="8192"/>
+      </field>
+      <field name="projects" mapped-by="projectGroup">
+        <collection element-type="Project" dependent-element="true"/>
+      </field>
+      <field name="notifiers">
+        <collection element-type="ProjectNotifier" dependent-element="true"/>
+        <join/>
+      </field>
+      <field name="buildDefinitions">
+        <collection element-type="BuildDefinition" dependent-element="true"/>
+        <join/>
+      </field>
+      <fetch-group name="ProjectGroup_detail">
+        <field name="projects"/>
+        <field name="notifiers"/>
+        <field name="buildDefinitions"/>
+      </fetch-group>
+      <fetch-group name="project-build-details">
+        <field name="projects"/>
+        <field name="notifiers"/>
+        <field name="buildDefinitions"/>
+      </fetch-group>
+      <fetch-group name="projectgroup-projects">
+        <field name="projects"/>
+      </fetch-group>
+    </class>
+    <class name="Project" detachable="true" identity-type="application" objectid-class="javax.jdo.identity.IntIdentity">
+      <field name="id" null-value="exception" primary-key="true" value-strategy="native"/>
+      <field name="groupId"/>
+      <field name="artifactId"/>
+      <field name="executorId"/>
+      <field name="name"/>
+      <field name="description">
+        <column length="8192"/>
+      </field>
+      <field name="url">
+        <column length="256"/>
+      </field>
+      <field name="scmUrl">
+        <column length="256"/>
+      </field>
+      <field name="scmTag"/>
+      <field name="scmUsername"/>
+      <field name="scmPassword"/>
+      <field name="version"/>
+      <field name="state"/>
+      <field name="oldState"/>
+      <field name="latestBuildId"/>
+      <field name="buildNumber"/>
+      <field name="workingDirectory">
+        <column length="256"/>
+      </field>
+      <field name="buildResults" mapped-by="project">
+        <collection element-type="BuildResult" dependent-element="true"/>
+      </field>
+      <field name="checkoutResult" dependent="true"/>
+      <field name="developers">
+        <collection element-type="ProjectDeveloper" dependent-element="true"/>
+      </field>
+      <field name="parent" dependent="true"/>
+      <field name="dependencies">
+        <collection element-type="ProjectDependency" dependent-element="true"/>
+      </field>
+      <field name="projectGroup" null-value="exception" default-fetch-group="true"/>
+      <field name="notifiers">
+        <collection element-type="ProjectNotifier" dependent-element="true"/>
+        <join/>
+      </field>
+      <field name="buildDefinitions">
+        <collection element-type="BuildDefinition" dependent-element="true"/>
+        <join/>
+      </field>
+      <fetch-group name="Project_detail">
+        <field name="buildResults"/>
+        <field name="checkoutResult"/>
+        <field name="developers"/>
+        <field name="parent"/>
+        <field name="dependencies"/>
+        <field name="notifiers"/>
+        <field name="buildDefinitions"/>
+      </fetch-group>
+      <fetch-group name="project-all-details">
+        <field name="developers"/>
+        <field name="parent"/>
+        <field name="dependencies"/>
+        <field name="notifiers"/>
+        <field name="buildDefinitions"/>
+      </fetch-group>
+      <fetch-group name="project-build-details">
+        <field name="notifiers"/>
+        <field name="buildDefinitions"/>
+      </fetch-group>
+      <fetch-group name="project-with-builds">
+        <field name="buildResults"/>
+      </fetch-group>
+      <fetch-group name="project-dependencies">
+        <field name="parent"/>
+        <field name="dependencies"/>
+      </fetch-group>
+      <fetch-group name="project-with-checkout-result">
+        <field name="checkoutResult"/>
+      </fetch-group>
+    </class>
+    <class name="ProjectNotifier" detachable="true" identity-type="application" objectid-class="javax.jdo.identity.IntIdentity">
+      <field name="id" null-value="exception" primary-key="true" value-strategy="native"/>
+      <field name="type"/>
+      <field name="from"/>
+      <field name="enabled"/>
+      <field name="recipientType"/>
+      <field name="sendOnSuccess"/>
+      <field name="sendOnFailure"/>
+      <field name="sendOnError"/>
+      <field name="sendOnWarning"/>
+      <field name="configuration" default-fetch-group="true">
+        <map key-type="java.lang.String" value-type="java.lang.String" dependent-key="true" dependent-value="true"/>
+        <join/>
+      </field>
+    </class>
+    <class name="ProjectDeveloper" detachable="true">
+      <field name="scmId"/>
+      <field name="name"/>
+      <field name="email"/>
+      <field name="continuumId"/>
+    </class>
+    <class name="ProjectDependency" detachable="true">
+      <field name="groupId"/>
+      <field name="artifactId"/>
+      <field name="version"/>
+    </class>
+    <class name="BuildResult" detachable="true" identity-type="application" objectid-class="javax.jdo.identity.IntIdentity">
+      <field name="project" default-fetch-group="true"/>
+      <field name="id" primary-key="true" value-strategy="native"/>
+      <field name="buildNumber"/>
+      <field name="state"/>
+      <field name="trigger"/>
+      <field name="startTime"/>
+      <field name="endTime"/>
+      <field name="error">
+        <column length="8192"/>
+      </field>
+      <field name="success"/>
+      <field name="exitCode"/>
+      <field name="scmResult" dependent="true"/>
+      <fetch-group name="BuildResult_detail">
+        <field name="scmResult"/>
+      </fetch-group>
+      <fetch-group name="build-result-with-details">
+        <field name="scmResult"/>
+      </fetch-group>
+    </class>
+    <class name="BuildDefinition" detachable="true" identity-type="application" objectid-class="javax.jdo.identity.IntIdentity">
+      <field name="id" null-value="exception" primary-key="true" value-strategy="native"/>
+      <field name="defaultForProject"/>
+      <field name="goals"/>
+      <field name="arguments"/>
+      <field name="buildFile"/>
+      <field name="schedule" default-fetch-group="true"/>
+      <field name="profile" default-fetch-group="true"/>
+      <field name="latestBuildId" null-value="default">
+        <column default-value="0"/>
+      </field>
+    </class>
+    <class name="Schedule" detachable="true" identity-type="application" objectid-class="javax.jdo.identity.IntIdentity">
+      <field name="id" primary-key="true" value-strategy="native"/>
+      <field name="active"/>
+      <field name="name"/>
+      <field name="description"/>
+      <field name="delay"/>
+      <field name="cronExpression"/>
+    </class>
+    <class name="Profile" detachable="true" identity-type="application" objectid-class="javax.jdo.identity.IntIdentity">
+      <field name="id" primary-key="true" value-strategy="native"/>
+      <field name="active"/>
+      <field name="name"/>
+      <field name="description"/>
+      <field name="scmMode"/>
+      <field name="buildWithoutChanges"/>
+      <field name="jdk" default-fetch-group="true"/>
+      <field name="builder" default-fetch-group="true"/>
+    </class>
+  </package>
+
+  <!-- 
+  <package name="org.apache.maven.user.model">
+    <class name="UserGroup" detachable="true" identity-type="application" objectid-class="javax.jdo.identity.IntIdentity">
+      <inheritance strategy="subclass-table"/>
+      <field name="id" primary-key="true" value-strategy="native"/>
+      <field name="name"/>
+      <field name="description"/>
+      <field name="permissions" default-fetch-group="true">
+        <collection element-type="Permission" dependent-element="false"/>
+        <join/>
+      </field>
+    </class>
+    <class name="User" detachable="true" identity-type="application" objectid-class="javax.jdo.identity.IntIdentity">
+      <inheritance strategy="subclass-table"/>
+      <field name="accountId" primary-key="true" value-strategy="native"/>
+      <field name="username"/>
+      <field name="guest"/>
+      <field name="password"/>
+      <field name="fullName"/>
+      <field name="email"/>
+      <field name="group" default-fetch-group="true"/>
+      <field name="previousEncodedPasswords" default-fetch-group="true">
+        <collection element-type="java.lang.String" dependent-element="false"/>
+        <join/>
+      </field>
+    </class>
+    <class name="Permission" detachable="true" identity-type="application" objectid-class="javax.jdo.identity.IntIdentity">
+      <inheritance strategy="subclass-table"/>
+      <field name="id" primary-key="true" value-strategy="native"/>
+      <field name="name"/>
+      <field name="description"/>
+    </class>
+  </package>
+ -->
+  
+  <package name="org.apache.maven.continuum.model.system">
+    <class name="Installation" detachable="true">
+      <field name="version"/>
+      <field name="path"/>
+      <field name="name"/>
+    </class>
+    <class name="SystemConfiguration" detachable="true">
+      <field name="guestAccountEnabled"/>
+      <field name="defaultScheduleDescription"/>
+      <field name="defaultScheduleCronExpression"/>
+      <field name="workingDirectory"/>
+      <field name="buildOutputDirectory"/>
+      <field name="deploymentRepositoryDirectory"/>
+      <field name="baseUrl"/>
+      <field name="companyName"/>
+      <field name="companyLogoUrl"/>
+      <field name="companyUrl"/>
+      <field name="initialized"/>
+    </class>
+    <class name="NotificationAddress" detachable="true">
+      <field name="type"/>
+      <field name="address"/>
+      <field name="configuration" default-fetch-group="true">
+        <map key-type="java.lang.String" value-type="java.lang.String" dependent-key="true" dependent-value="true"/>
+        <join/>
+      </field>
+    </class>
+    
+    <!-- Specify a unique table name that does not conflict with existing maven-user table name -->
+    <class name="UserGroup" table="ContinuumUserGroup" detachable="true" identity-type="application" persistence-capable-superclass="org.apache.maven.user.model.UserGroup">
+      <inheritance strategy="new-table"/>
+    </class>
+    <class name="ContinuumUser" detachable="true" identity-type="application" persistence-capable-superclass="org.apache.maven.user.model.User">
+      <inheritance strategy="new-table"/>
+    </class>
+    <!-- Specify a unique table name that does not conflict with existing maven-user table name -->
+    <class name="Permission" table="ContinuumPermission"  detachable="true" identity-type="application" persistence-capable-superclass="org.apache.maven.user.model.Permission">
+      <inheritance strategy="new-table"/>
+    </class>
+  </package>
+
+  <package name="org.apache.maven.continuum.model.scm">
+    <class name="ScmResult" detachable="true">
+      <field name="success"/>
+      <field name="commandLine"/>
+      <field name="providerMessage">
+        <column length="1024"/>
+      </field>
+      <field name="commandOutput">
+        <column length="1024"/>
+      </field>
+      <field name="exception">
+        <column length="8192"/>
+      </field>
+      <field name="changes" default-fetch-group="true">
+        <collection element-type="ChangeSet" dependent-element="true"/>
+      </field>
+    </class>
+    <class name="ChangeSet" detachable="true">
+      <field name="author"/>
+      <field name="comment">
+        <column length="8192"/>
+      </field>
+      <field name="date"/>
+      <field name="files" default-fetch-group="true">
+        <collection element-type="ChangeFile" dependent-element="true"/>
+      </field>
+    </class>
+    <class name="ChangeFile" detachable="true">
+      <field name="name"/>
+      <field name="revision"/>
+      <field name="status"/>
+    </class>
+  </package>
+</jdo>

Modified: maven/continuum/branches/continuum-acegi/continuum-security/continuum-security-acegi/src/main/java/org/apache/maven/continuum/security/acegi/ContinuumUserDetailsService.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-security/continuum-security-acegi/src/main/java/org/apache/maven/continuum/security/acegi/ContinuumUserDetailsService.java?view=diff&rev=439897&r1=439896&r2=439897
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-security/continuum-security-acegi/src/main/java/org/apache/maven/continuum/security/acegi/ContinuumUserDetailsService.java (original)
+++ maven/continuum/branches/continuum-acegi/continuum-security/continuum-security-acegi/src/main/java/org/apache/maven/continuum/security/acegi/ContinuumUserDetailsService.java Sun Sep  3 18:48:58 2006
@@ -17,6 +17,7 @@
  *
  */
 
+import java.util.Date;
 import java.util.Iterator;
 import java.util.List;
 
@@ -43,42 +44,29 @@
 public class ContinuumUserDetailsService
     implements UserDetailsService
 {
-    /**
+    private static final long MILLISECONDS_PER_DAY = 24 * 60 * 60 * 1000;
+   
+   /**
      * @plexus.requirement
      */
-    private ContinuumStore store;
-
-    public ContinuumUserDetailsService()
-    {
-    }
-
-    public void setStore( ContinuumStore store )
-    {
-        this.store = store;
-    }
+    private UserManager userManager;
 
     /**
-     * {@link ContinuumStore} to load the user from.
-     * 
-     * @return the store
+     * @plexus.configuration default-value="60"
      */
-    public ContinuumStore getStore()
+    private int daysBeforeExpiration;
+
+    public ContinuumUserDetailsService()
     {
-        return store;
     }
 
     public UserDetails loadUserByUsername( String username )
         throws UsernameNotFoundException, DataAccessException
     {
         ContinuumUser user;
-        try
-        {
-            user = getStore().getUserByUsername( username );
-        }
-        catch ( ContinuumStoreException e )
-        {
-            throw new DataAccessResourceFailureException( e.getMessage(), e );
-        }
+
+        user = ( ContinuumUser ) userManager.getUser( username );
+
         if ( user == null )
         {
             throw new UsernameNotFoundException( "Could not find user: " + username );
@@ -106,9 +94,15 @@
             i++;
         }
         String username = user.getUsername();
-        String password = user.getHashedPassword();
+        String password = user.getEncodedPassword();
         boolean enabled = true;
         boolean accountNonExpired = true;
+        
+        if( user.getLastPasswordChange() != null && daysBeforeExpiration > 0 )
+        {
+           accountNonExpired = user.getLastPasswordChange().getTime() + daysBeforeExpiration * MILLISECONDS_PER_DAY > new Date().getTime();
+        }
+        
         boolean credentialsNonExpired = true;
         boolean accountNonLocked = true;
 
@@ -117,7 +111,12 @@
 
         return userDetails;
     }
-
+    
+    protected void setDaysBeforeExpiration( int daysBeforeExpiration )
+    {
+       this.daysBeforeExpiration = daysBeforeExpiration;
+    }
+    
     /**
      * TODO: convert Acegi user into Continuum user?
      */

Modified: maven/continuum/branches/continuum-acegi/continuum-security/continuum-security-acegi/src/test/java/org/apache/maven/continuum/security/acegi/ContinuumUserDetailsServiceTest.java
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-security/continuum-security-acegi/src/test/java/org/apache/maven/continuum/security/acegi/ContinuumUserDetailsServiceTest.java?view=diff&rev=439897&r1=439896&r2=439897
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-security/continuum-security-acegi/src/test/java/org/apache/maven/continuum/security/acegi/ContinuumUserDetailsServiceTest.java (original)
+++ maven/continuum/branches/continuum-acegi/continuum-security/continuum-security-acegi/src/test/java/org/apache/maven/continuum/security/acegi/ContinuumUserDetailsServiceTest.java Sun Sep  3 18:48:58 2006
@@ -16,6 +16,8 @@
  * limitations under the License.
  */
 
+import java.util.Date;
+
 import org.acegisecurity.GrantedAuthority;
 import org.acegisecurity.providers.encoding.ShaPasswordEncoder;
 import org.acegisecurity.userdetails.UserDetails;
@@ -46,6 +48,54 @@
 
     public void testGetUserDetails()
     {
+        ContinuumUser continuumUser = createMockedUser();
+       
+        UserDetails userDetails = userDetailsService.getUserDetails( continuumUser );
+
+        assertEquals( userDetails.getUsername(), continuumUser.getUsername() );
+
+        GrantedAuthority[] authorities = userDetails.getAuthorities();
+        for ( int i = 0; i < authorities.length; i++ )
+        {
+            assertEquals( "ROLE_p" + i, authorities[i].getAuthority() );
+        }
+    }
+
+    public void testPasswordEncoding()
+    {
+        ShaPasswordEncoder passwordEncoder = new ShaPasswordEncoder();
+        String shaPassword = passwordEncoder.encodePassword( "admin", null );
+
+        ContinuumUser continuumUser = new ContinuumUser();
+        continuumUser.setEncodedPassword( shaPassword );
+
+        assertTrue( continuumUser.equalsPassword( "admin" ) );
+    }
+    
+    public void testAccountExpiration()
+    {
+        ContinuumUser continuumUser = createMockedUser();
+       
+        userDetailsService.setDaysBeforeExpiration( 0 );
+        UserDetails userDetails = userDetailsService.getUserDetails( continuumUser );
+        assertTrue(userDetails.isAccountNonExpired());
+        
+        userDetailsService.setDaysBeforeExpiration( -1 );
+        userDetails = userDetailsService.getUserDetails( continuumUser );
+        assertTrue(userDetails.isAccountNonExpired());
+        
+        userDetailsService.setDaysBeforeExpiration( 1 );
+        userDetails = userDetailsService.getUserDetails( continuumUser );
+        assertTrue(userDetails.isAccountNonExpired());
+        
+        Date twoDaysAgo = new Date( System.currentTimeMillis() - 2 * ContinuumUserDetailsService.MILLISECONDS_PER_DAY );
+        continuumUser.setLastPasswordChange( twoDaysAgo );
+        userDetails = userDetailsService.getUserDetails( continuumUser );
+        assertFalse(userDetails.isAccountNonExpired());
+    }
+
+    private ContinuumUser createMockedUser()
+    {
         Permission p0 = new Permission();
         p0.setName( "p0" );
         Permission p1 = new Permission();
@@ -58,34 +108,16 @@
         group.addPermission( p1 );
         group.addPermission( p2 );
 
-        ContinuumUser continuumUser = new ContinuumUser();
-        continuumUser.setUsername( "username" );
-        continuumUser.setPassword( "password" );
-        continuumUser.setGroup( group );
-
         ShaPasswordEncoder passwordEncoder = new ShaPasswordEncoder();
         String shaPassword = passwordEncoder.encodePassword( "password", null );
 
-        UserDetails userDetails = userDetailsService.getUserDetails( continuumUser );
-
-        assertEquals( userDetails.getUsername(), continuumUser.getUsername() );
-        assertEquals( userDetails.getPassword(), shaPassword );
-
-        GrantedAuthority[] authorities = userDetails.getAuthorities();
-        for ( int i = 0; i < authorities.length; i++ )
-        {
-            assertEquals( "ROLE_p" + i, authorities[i].getAuthority() );
-        }
-    }
-
-    public void testPasswordEncoding()
-    {
         ContinuumUser continuumUser = new ContinuumUser();
-        continuumUser.setPassword( "admin" );
+        continuumUser.setUsername( "username" );
+        continuumUser.setEncodedPassword( shaPassword );
+        continuumUser.setGroup( group );
 
-        ShaPasswordEncoder passwordEncoder = new ShaPasswordEncoder();
-        String shaPassword = passwordEncoder.encodePassword( "admin", null );
+        continuumUser.setLastPasswordChange( new Date() );
 
-        assertEquals( continuumUser.getHashedPassword(), shaPassword );
+        return continuumUser;
     }
 }

Modified: maven/continuum/branches/continuum-acegi/continuum-webapp/pom.xml
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-webapp/pom.xml?view=diff&rev=439897&r1=439896&r2=439897
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-webapp/pom.xml (original)
+++ maven/continuum/branches/continuum-acegi/continuum-webapp/pom.xml Sun Sep  3 18:48:58 2006
@@ -60,7 +60,7 @@
         <version>1.0-alpha-8</version>
         <executions>
           <execution>
-            <id>web summary model classes</id>
+            <id>project summary model</id>
             <configuration>
               <model>src/main/mdo/view-models.mdo</model>
               <version>1.0.0</version>
@@ -69,16 +69,6 @@
               <goal>java</goal>         
             </goals>
           </execution>
-          <execution>
-            <id>session model classes</id>
-            <configuration>
-              <model>src/main/mdo/session-models.mdo</model>
-              <version>1.0.0</version>
-            </configuration>
-            <goals>
-              <goal>java</goal>
-            </goals>
-          </execution>
         </executions>
       </plugin>
       <plugin>
@@ -264,6 +254,10 @@
     <dependency>
       <groupId>org.apache.maven.continuum</groupId>
       <artifactId>continuum-security-acegi</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.shared.user</groupId>
+      <artifactId>maven-user-controller</artifactId>
     </dependency>
   </dependencies>
 </project>

Modified: maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/resources/META-INF/plexus/application.xml
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/resources/META-INF/plexus/application.xml?view=diff&rev=439897&r1=439896&r2=439897
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/resources/META-INF/plexus/application.xml (original)
+++ maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/resources/META-INF/plexus/application.xml Sun Sep  3 18:48:58 2006
@@ -353,7 +353,8 @@
       <implementation>org.apache.maven.continuum.security.acegi.ContinuumUserDetailsService</implementation>
       <requirements>
         <requirement>
-          <role>org.apache.maven.continuum.store.ContinuumStore</role>
+          <role>org.apache.maven.user.model.UserManager</role>
+          <field-name>userManager</field-name>
         </requirement>
       </requirements>
     </component>
@@ -791,6 +792,109 @@
           -->
         </levels>
       </configuration>
+    </component>
+    <component>
+      <role>org.apache.maven.user.model.UserManager</role>
+      <implementation>org.apache.maven.user.model.impl.DefaultUserManager</implementation>
+      <requirements>
+        <requirement>
+          <role>org.apache.maven.user.model.store.UserStore</role>
+          <field-name>userStore</field-name>
+        </requirement>
+        <requirement>
+          <role>org.apache.maven.user.model.UserSecurityPolicy</role>
+          <field-name>securityPolicy</field-name>
+        </requirement>
+      </requirements>
+    </component>
+    
+    <component>
+      <role>org.apache.maven.user.model.store.UserStore</role>
+      <implementation>org.apache.maven.user.model.store.impl.DefaultUserStore</implementation>
+      <requirements>
+        <requirement>
+          <role>org.codehaus.plexus.jdo.JdoFactory</role>
+          <field-name>jdoFactory</field-name>
+        </requirement>
+      </requirements>
+    </component>
+    
+    <component>
+      <role>org.apache.maven.user.model.UserSecurityPolicy</role>
+      <implementation>org.apache.maven.user.model.impl.DefaultUserSecurityPolicy</implementation>
+      <requirements>
+        <requirement>
+          <role>org.apache.maven.user.model.PasswordEncoder</role>
+          <role-hint>sha256</role-hint>
+          <field-name>passwordEncoder</field-name>
+        </requirement>
+      </requirements>
+      <configuration>
+        <allowedLoginAttempts>3</allowedLoginAttempts>
+        <previousPasswordsCount>6</previousPasswordsCount>
+        <systemSalt>Step doog ekam Skravdraa</systemSalt>
+      </configuration>
+    </component>
+    
+    <component>
+      <role>com.opensymphony.xwork.Action</role>
+      <role-hint>users</role-hint>
+      <implementation>org.apache.maven.user.controller.action.UsersAction</implementation>
+      <instantiation-strategy>per-lookup</instantiation-strategy>
+      <description></description>
+      <requirements>
+        <requirement>
+          <role>org.apache.maven.user.model.UserManager</role>
+          <field-name>userManager</field-name>
+        </requirement>
+      </requirements>
+    </component>
+    <component>
+      <role>com.opensymphony.xwork.Action</role>
+      <role-hint>editUser</role-hint>
+      <implementation>org.apache.maven.user.controller.action.EditUserAction</implementation>
+      <instantiation-strategy>per-lookup</instantiation-strategy>
+      <description></description>
+      <requirements>
+        <requirement>
+          <role>org.apache.maven.user.model.UserManager</role>
+          <field-name>userManager</field-name>
+        </requirement>
+      </requirements>
+    </component>
+    <component>
+      <role>com.opensymphony.xwork.Action</role>
+      <role-hint>deleteUser</role-hint>
+      <implementation>org.apache.maven.user.controller.action.DeleteUserAction</implementation>
+      <instantiation-strategy>per-lookup</instantiation-strategy>
+      <description></description>
+      <requirements>
+        <requirement>
+          <role>org.apache.maven.user.model.UserManager</role>
+          <field-name>userManager</field-name>
+        </requirement>
+      </requirements>
+    </component>
+    
+    <component>
+      <role>org.apache.maven.continuum.initialization.ContinuumInitializer</role>
+      <implementation>org.apache.maven.continuum.initialization.DefaultContinuumInitializer</implementation>
+      <requirements>
+        <requirement>
+          <role>org.apache.maven.continuum.store.ContinuumStore</role>
+          <field-name>store</field-name>
+        </requirement>
+        <requirement>
+          <role>org.apache.maven.user.model.UserManager</role>
+          <field-name>userManager</field-name>
+        </requirement>
+      </requirements>
+    </component>
+    
+    <component>
+      <role>org.apache.maven.user.model.PasswordEncoder</role>
+      <role-hint>sha256</role-hint>
+      <implementation>org.apache.maven.user.model.impl.SHA256PasswordEncoder</implementation>
     </component>
   </components>
 

Modified: maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/webapp/configurationEdit.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/webapp/configurationEdit.jsp?view=diff&rev=439897&r1=439896&r2=439897
==============================================================================
--- maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/webapp/configurationEdit.jsp (original)
+++ maven/continuum/branches/continuum-acegi/continuum-webapp/src/main/webapp/configurationEdit.jsp Sun Sep  3 18:48:58 2006
@@ -1,49 +1,33 @@
 <%@ taglib uri="/webwork" prefix="ww" %>
 <%@ taglib uri="continuum" prefix="c1" %>
 <html>
-<ww:i18n name="localization.Continuum">
-  <head>
-    <title><ww:text name="configuration.page.title"/></title>
-  </head>
+  <ww:i18n name="localization.Continuum">
+    <head>
+        <title><ww:text name="configuration.page.title"/></title>
+    </head>
+    <body>
+      <div id="axial" class="h3">
+        <h3><ww:text name="configuration.section.title"/></h3>
 
-  <body>
-  <div id="axial" class="h3">
-    <h3><ww:text name="configuration.section.title"/></h3>
-    <ww:form action="configuration.action" method="post">
-
-      <div class="axial">
-        <table border="1" cellspacing="2" cellpadding="3" width="100%">
-          <ww:textfield label="Username" name="username"/>
-          <ww:textfield label="Full Name" name="fullName"/>
-          <ww:textfield label="Email" name="email"/>
-          <ww:textfield label="Password" name="password"/>
-          <ww:textfield label="Password(again)" name="passwordTwo"/>
-        </table>
-      </div>
-
-      <div class="axial">
-
-        <table>
-          <tbody>
-            <ww:checkbox label="%{getText('configuration.guest.label')}" name="guestAccountEnabled"
-                         value="guestAccountEnabled" fieldValue="true"/>
-            <ww:textfield label="%{getText('configuration.workingDirectory.label')}" name="workingDirectory"
-                          required="true"/>
-            <ww:textfield label="%{getText('configuration.buildOutputDirectory.label')}" name="buildOutputDirectory"
-                          required="true"/>
-            <ww:textfield label="%{getText('configuration.baseUrl.label')}" name="baseUrl" required="true"/>
-            <ww:textfield label="%{getText('configuration.companyName.label')}" name="companyName"/>
-            <ww:textfield label="%{getText('configuration.companyLogo.label')}" name="companyLogo"/>
-            <ww:textfield label="%{getText('configuration.companyUrl.label')}" name="companyUrl"/>
-          </tbody>
-        </table>
-        <div class="functnbar3">
-          <c1:submitcancel value="%{getText('save')}" cancel="%{getText('cancel')}"/>
+        <div class="axial">
+          <ww:form action="configuration.action" method="post">
+            <table>
+              <tbody>
+                <ww:checkbox label="%{getText('configuration.guest.label')}" name="guestAccountEnabled" value="guestAccountEnabled" fieldValue="true"/>
+                <ww:textfield label="%{getText('configuration.workingDirectory.label')}" name="workingDirectory" required="true"/>
+                <ww:textfield label="%{getText('configuration.buildOutputDirectory.label')}" name="buildOutputDirectory" required="true"/>
+                <ww:textfield label="%{getText('configuration.baseUrl.label')}" name="baseUrl" required="true"/>
+                <ww:textfield label="%{getText('configuration.companyName.label')}" name="companyName"/>
+                <ww:textfield label="%{getText('configuration.companyLogo.label')}" name="companyLogo"/>
+                <ww:textfield label="%{getText('configuration.companyUrl.label')}" name="companyUrl"/>
+              </tbody>
+            </table>
+            <div class="functnbar3">
+              <c1:submitcancel value="%{getText('save')}" cancel="%{getText('cancel')}"/>
+            </div>
+          </ww:form>
         </div>
-
       </div>
-    </ww:form>
-  </div>
-  </body>
-</ww:i18n>
+    </body>
+  </ww:i18n>
 </html>

Modified: maven/continuum/branches/continuum-acegi/pom.xml
URL: http://svn.apache.org/viewvc/maven/continuum/branches/continuum-acegi/pom.xml?view=diff&rev=439897&r1=439896&r2=439897
==============================================================================
--- maven/continuum/branches/continuum-acegi/pom.xml (original)
+++ maven/continuum/branches/continuum-acegi/pom.xml Sun Sep  3 18:48:58 2006
@@ -412,6 +412,16 @@
         <version>1.0-alpha-3</version>
       </dependency>
       <dependency>
+        <groupId>org.apache.maven.shared.user</groupId>
+        <artifactId>maven-user-model</artifactId>
+        <version>1.0-SNAPSHOT</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven.shared.user</groupId>
+        <artifactId>maven-user-controller</artifactId>
+        <version>1.0-SNAPSHOT</version>
+      </dependency>
+      <dependency>
         <groupId>commons-dbcp</groupId>
         <artifactId>commons-dbcp</artifactId>
         <version>1.2.1</version>



Mime
View raw message