You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@turbine.apache.org by tv...@apache.org on 2015/02/08 19:27:19 UTC

svn commit: r1658233 - in /turbine/fulcrum/trunk/security: api/ api/src/java/org/apache/fulcrum/security/authenticator/ api/src/java/org/apache/fulcrum/security/model/basic/entity/impl/ hibernate/

Author: tv
Date: Sun Feb  8 18:27:18 2015
New Revision: 1658233

URL: http://svn.apache.org/r1658233
Log:
Some cleanup

Modified:
    turbine/fulcrum/trunk/security/api/pom.xml
    turbine/fulcrum/trunk/security/api/src/java/org/apache/fulcrum/security/authenticator/CryptoAuthenticator.java
    turbine/fulcrum/trunk/security/api/src/java/org/apache/fulcrum/security/authenticator/NoOpAuthenticator.java
    turbine/fulcrum/trunk/security/api/src/java/org/apache/fulcrum/security/authenticator/TextMatchAuthenticator.java
    turbine/fulcrum/trunk/security/api/src/java/org/apache/fulcrum/security/model/basic/entity/impl/BasicUserImpl.java
    turbine/fulcrum/trunk/security/hibernate/pom.xml

Modified: turbine/fulcrum/trunk/security/api/pom.xml
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/api/pom.xml?rev=1658233&r1=1658232&r2=1658233&view=diff
==============================================================================
--- turbine/fulcrum/trunk/security/api/pom.xml (original)
+++ turbine/fulcrum/trunk/security/api/pom.xml Sun Feb  8 18:27:18 2015
@@ -74,7 +74,6 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-jar-plugin</artifactId>
-                <version>2.2</version>
                 <executions>
                     <execution>
                         <goals>

Modified: turbine/fulcrum/trunk/security/api/src/java/org/apache/fulcrum/security/authenticator/CryptoAuthenticator.java
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/api/src/java/org/apache/fulcrum/security/authenticator/CryptoAuthenticator.java?rev=1658233&r1=1658232&r2=1658233&view=diff
==============================================================================
--- turbine/fulcrum/trunk/security/api/src/java/org/apache/fulcrum/security/authenticator/CryptoAuthenticator.java (original)
+++ turbine/fulcrum/trunk/security/api/src/java/org/apache/fulcrum/security/authenticator/CryptoAuthenticator.java Sun Feb  8 18:27:18 2015
@@ -32,16 +32,15 @@ import org.apache.fulcrum.crypto.CryptoA
 import org.apache.fulcrum.crypto.CryptoService;
 import org.apache.fulcrum.security.entity.User;
 import org.apache.fulcrum.security.util.DataBackendException;
-import org.apache.fulcrum.security.util.UnknownEntityException;
 
 /**
  * This class authenticates using the Fulcrum Crypto service a user and their
  * password
- * 
+ *
  * @author <a href="mailto:epugh@upstate.com">Eric Pugh</a>
  * @version $Id$
  * @avalon.component name="crypto-authenticator"
- * @avalon.service 
+ * @avalon.service
  *                 type="org.apache.fulcrum.security.authenticator.Authenticator"
  */
 public class CryptoAuthenticator extends AbstractLogEnabled implements Authenticator, Serviceable, Disposable, Configurable
@@ -55,16 +54,15 @@ public class CryptoAuthenticator extends
      * Authenticate a user with the specified password. If authentication is
      * successful the method returns true. If it fails, it returns false If
      * there are any problems, an exception is thrown.
-     * 
+     *
      * @param user
      *            a User object.
      * @param password
      *            the user supplied password.
-     * @exception UnknownEntityException
-     *                if the user's account does not exist in the database.
      * @exception DataBackendException
      *                if there is a problem accessing the storage.
      */
+    @Override
     public boolean authenticate(User user, String password) throws DataBackendException
     {
         try
@@ -88,6 +86,7 @@ public class CryptoAuthenticator extends
     /**
      * Avalon component lifecycle method
      */
+    @Override
     public void configure(Configuration conf) throws ConfigurationException
     {
         algorithm = conf.getChild("algorithm").getValue();
@@ -97,6 +96,7 @@ public class CryptoAuthenticator extends
     /**
      * Avalon component lifecycle method
      */
+    @Override
     public void service(ServiceManager manager) throws ServiceException
     {
         this.cryptoService = (CryptoService) manager.lookup(CryptoService.ROLE);
@@ -105,6 +105,7 @@ public class CryptoAuthenticator extends
     /**
      * Avalon component lifecycle method
      */
+    @Override
     public void dispose()
     {
         cryptoService = null;

Modified: turbine/fulcrum/trunk/security/api/src/java/org/apache/fulcrum/security/authenticator/NoOpAuthenticator.java
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/api/src/java/org/apache/fulcrum/security/authenticator/NoOpAuthenticator.java?rev=1658233&r1=1658232&r2=1658233&view=diff
==============================================================================
--- turbine/fulcrum/trunk/security/api/src/java/org/apache/fulcrum/security/authenticator/NoOpAuthenticator.java (original)
+++ turbine/fulcrum/trunk/security/api/src/java/org/apache/fulcrum/security/authenticator/NoOpAuthenticator.java Sun Feb  8 18:27:18 2015
@@ -21,16 +21,15 @@ package org.apache.fulcrum.security.auth
 import org.apache.avalon.framework.logger.AbstractLogEnabled;
 import org.apache.fulcrum.security.entity.User;
 import org.apache.fulcrum.security.util.DataBackendException;
-import org.apache.fulcrum.security.util.UnknownEntityException;
 
 /**
  * This class authenticates by returning TRUE always. Regardless of the user and
  * password data.
- * 
+ *
  * @author <a href="mailto:epugh@upstate.com">Eric Pugh</a>
  * @version $Id$
  * @avalon.component name="noop-authenticator"
- * @avalon.service 
+ * @avalon.service
  *                 type="org.apache.fulcrum.security.authenticator.Authenticator"
  */
 public class NoOpAuthenticator extends AbstractLogEnabled implements Authenticator
@@ -38,17 +37,16 @@ public class NoOpAuthenticator extends A
     /**
      * Authenticate an username with the specified password. Always returns
      * true.
-     * 
-     * 
+     *
+     *
      * @param user
      *            object
      * @param password
      *            the user supplied password.
-     * @exception UnknownEntityException
-     *                if the user's account does not exist in the database.
      * @exception DataBackendException
      *                if there is a problem accessing the storage.
      */
+    @Override
     public boolean authenticate(User user, String password) throws DataBackendException
     {
         return true;

Modified: turbine/fulcrum/trunk/security/api/src/java/org/apache/fulcrum/security/authenticator/TextMatchAuthenticator.java
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/api/src/java/org/apache/fulcrum/security/authenticator/TextMatchAuthenticator.java?rev=1658233&r1=1658232&r2=1658233&view=diff
==============================================================================
--- turbine/fulcrum/trunk/security/api/src/java/org/apache/fulcrum/security/authenticator/TextMatchAuthenticator.java (original)
+++ turbine/fulcrum/trunk/security/api/src/java/org/apache/fulcrum/security/authenticator/TextMatchAuthenticator.java Sun Feb  8 18:27:18 2015
@@ -21,16 +21,15 @@ package org.apache.fulcrum.security.auth
 import org.apache.avalon.framework.logger.AbstractLogEnabled;
 import org.apache.fulcrum.security.entity.User;
 import org.apache.fulcrum.security.util.DataBackendException;
-import org.apache.fulcrum.security.util.UnknownEntityException;
 
 /**
  * This class authenticates by doing a plain text match of the user's passwords.
  * Very insecure!
- * 
+ *
  * @author <a href="mailto:epugh@upstate.com">Eric Pugh</a>
  * @version $Id$
  * @avalon.component name="textmatch-authenticator"
- * @avalon.service 
+ * @avalon.service
  *                 type="org.apache.fulcrum.security.authenticator.Authenticator"
  */
 public class TextMatchAuthenticator extends AbstractLogEnabled implements Authenticator
@@ -38,17 +37,16 @@ public class TextMatchAuthenticator exte
     /**
      * Authenticate an username with the specified password. Returns true if the
      * user password plain text matches the passed in password.
-     * 
-     * 
+     *
+     *
      * @param user
      *            object
      * @param password
      *            the user supplied password.
-     * @exception UnknownEntityException
-     *                if the user's account does not exist in the database.
      * @exception DataBackendException
      *                if there is a problem accessing the storage.
      */
+    @Override
     public boolean authenticate(User user, String password) throws DataBackendException
     {
         if (user == null)

Modified: turbine/fulcrum/trunk/security/api/src/java/org/apache/fulcrum/security/model/basic/entity/impl/BasicUserImpl.java
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/api/src/java/org/apache/fulcrum/security/model/basic/entity/impl/BasicUserImpl.java?rev=1658233&r1=1658232&r2=1658233&view=diff
==============================================================================
--- turbine/fulcrum/trunk/security/api/src/java/org/apache/fulcrum/security/model/basic/entity/impl/BasicUserImpl.java (original)
+++ turbine/fulcrum/trunk/security/api/src/java/org/apache/fulcrum/security/model/basic/entity/impl/BasicUserImpl.java Sun Feb  8 18:27:18 2015
@@ -23,7 +23,6 @@ import java.util.Set;
 
 import org.apache.commons.lang.builder.HashCodeBuilder;
 import org.apache.fulcrum.security.entity.Group;
-import org.apache.fulcrum.security.entity.User;
 import org.apache.fulcrum.security.entity.impl.SecurityEntityImpl;
 import org.apache.fulcrum.security.model.basic.entity.BasicUser;
 import org.apache.fulcrum.security.util.GroupSet;
@@ -31,7 +30,7 @@ import org.apache.fulcrum.security.util.
 /**
  * Represents the "basic" model where users can be part of multiple groups
  * directly, with no roles or permissions.
- * 
+ *
  * @author <a href="mailto:epugh@upstate.com">Eric Pugh</a>
  * @version $Id: BasicUser.java 437451 2006-08-27 20:20:44Z tv $
  */
@@ -58,9 +57,10 @@ public class BasicUserImpl extends Secur
      * controller) to validate it. See also
      * {@link org.apache.fulcrum.security.UserManager#authenticate(User,String)}
      * .
-     * 
+     *
      * @return A String with the password for the user.
      */
+    @Override
     public String getPassword()
     {
         return password;
@@ -71,10 +71,11 @@ public class BasicUserImpl extends Secur
      * {@link #getPassword()}. See also
      * {@link org.apache.fulcrum.security.UserManager#changePassword(User,String,String)}
      * .
-     * 
+     *
      * @param password
      *            The new password.
      */
+    @Override
     public void setPassword(String password)
     {
         this.password = password;
@@ -82,9 +83,10 @@ public class BasicUserImpl extends Secur
 
     /**
      * Get the groups this user is part of
-     * 
+     *
      * @return a set of groups
      */
+    @Override
     public GroupSet getGroups()
     {
         if (groupSet instanceof GroupSet)
@@ -100,10 +102,11 @@ public class BasicUserImpl extends Secur
 
     /**
      * Set the groups this user is part of
-     * 
+     *
      * @param groups
      *            the set of groups
      */
+    @Override
     public void setGroups(GroupSet groups)
     {
         if (groups != null)
@@ -118,10 +121,11 @@ public class BasicUserImpl extends Secur
 
     /**
      * Remove the group from the list of groups
-     * 
+     *
      * @param group
      *            the group to remove
      */
+    @Override
     public void removeGroup(Group group)
     {
         getGroups().remove(group);
@@ -129,10 +133,11 @@ public class BasicUserImpl extends Secur
 
     /**
      * Add the group to the list of groups
-     * 
+     *
      * @param group
      *            the group to add
      */
+    @Override
     public void addGroup(Group group)
     {
         getGroups().add(group);
@@ -140,10 +145,11 @@ public class BasicUserImpl extends Secur
 
     /**
      * Set the groups this user is part of as a Set
-     * 
+     *
      * @param groups
      *            the set of groups
      */
+    @Override
     public <T extends Group> void setGroupsAsSet(Set<T> groups)
     {
         this.groupSet = groups;
@@ -151,9 +157,10 @@ public class BasicUserImpl extends Secur
 
     /**
      * Get the groups this user is part of as a Set
-     * 
+     *
      * @return a set of groups
      */
+    @Override
     @SuppressWarnings("unchecked")
     public <T extends Group> Set<T> getGroupsAsSet()
     {
@@ -162,7 +169,7 @@ public class BasicUserImpl extends Secur
 
     /**
      * Calculate a hash code for this object
-     * 
+     *
      * @see org.apache.fulcrum.security.entity.impl.SecurityEntityImpl#hashCode()
      */
     @Override

Modified: turbine/fulcrum/trunk/security/hibernate/pom.xml
URL: http://svn.apache.org/viewvc/turbine/fulcrum/trunk/security/hibernate/pom.xml?rev=1658233&r1=1658232&r2=1658233&view=diff
==============================================================================
--- turbine/fulcrum/trunk/security/hibernate/pom.xml (original)
+++ turbine/fulcrum/trunk/security/hibernate/pom.xml Sun Feb  8 18:27:18 2015
@@ -57,7 +57,6 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
-                <version>2.4.3</version>
                 <configuration>
                     <forkMode>perTest</forkMode>
                     <includes>