jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1618121 - in /jackrabbit/trunk: jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/user/ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/ jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security...
Date Fri, 15 Aug 2014 09:07:05 GMT
Author: angela
Date: Fri Aug 15 09:07:05 2014
New Revision: 1618121

URL: http://svn.apache.org/r1618121
Log:
JCR-3802 : User Management: API for System Users (add API extensions to jackrabbit-api, add
dummy implementation to jackrabbit-core (feature not yet supported))

Modified:
    jackrabbit/trunk/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/user/User.java
    jackrabbit/trunk/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/user/UserManager.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserManagerImpl.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authentication/SimpleCredentialsAuthenticationTest.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/user/UserImporterTest.java

Modified: jackrabbit/trunk/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/user/User.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/user/User.java?rev=1618121&r1=1618120&r2=1618121&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/user/User.java
(original)
+++ jackrabbit/trunk/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/user/User.java
Fri Aug 15 09:07:05 2014
@@ -34,6 +34,11 @@ public interface User extends Authorizab
     boolean isAdmin();
 
     /**
+     * @return true if the current user represents a system user.
+     */
+    boolean isSystemUser();
+
+    /**
      * Returns the internal <code>Credentials</code> representation for this
      * user. This method is expected to be used for validation during the
      * login process. However, the return value should neither be usable nor

Modified: jackrabbit/trunk/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/user/UserManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/user/UserManager.java?rev=1618121&r1=1618120&r2=1618121&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/user/UserManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/user/UserManager.java
Fri Aug 15 09:07:05 2014
@@ -180,6 +180,31 @@ public interface UserManager {
     User createUser(String userID, String password, Principal principal,
                     String intermediatePath) throws AuthorizableExistsException, RepositoryException;
 
+
+    /**
+     * Create a new system user for the specified {@code userID}. The new authorizable
+     * is required to have the following characteristics:
+     *
+     * <ul>
+     *     <li>{@link org.apache.jackrabbit.api.security.user.User#isSystemUser()}
returns {@code true}.</li>
+     *     <li>The system user doesn't have a password set and doesn't allow change
the password.</li>
+     *     <li>The principal name is generated by the system; it may be the same as
{@code userID}.</li>
+     *     <li>A given implementation may choose to keep system users in a dedicated
+     *     location and thus may impose restrictions on the {@code intermediatePath}.</li>
+     * </ul>
+     *
+     * @param userID A valid userID.
+     * @param intermediatePath An optional intermediate path to create the new
+     * system user. The implemenation may decide to reject intermediate paths
+     * if they violate an implementation specific requirement with respect to
+     * the location where systems users are being held. If the intermediate path
+     * is {@code null} an internal implementation specific structure will be used.
+     * @return The new system user.
+     * @throws AuthorizableExistsException if an Authorizable with this id already exists.
+     * @throws RepositoryException If another error occurs.
+     */
+    User createSystemUser(String userID, String intermediatePath) throws AuthorizableExistsException,
RepositoryException;
+
     /**
      * Creates a Group for the given groupID, which must not be <code>null</code>.
      * <br>

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserImpl.java?rev=1618121&r1=1618120&r2=1618121&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserImpl.java
Fri Aug 15 09:07:05 2014
@@ -79,6 +79,10 @@ public class UserImpl extends Authorizab
         }
     }
 
+    public boolean isSystemUser() {
+        return false;
+    }
+
     /**
      * @see User#getCredentials()
      */

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserManagerImpl.java?rev=1618121&r1=1618120&r2=1618121&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserManagerImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserManagerImpl.java
Fri Aug 15 09:07:05 2014
@@ -594,6 +594,10 @@ public class UserManagerImpl extends Pro
         }
     }
 
+    public User createSystemUser(String userID, String intermediatePath) throws AuthorizableExistsException,
RepositoryException {
+        throw new UnsupportedRepositoryOperationException("Not yet implemented.");
+    }
+
     /**
      * @see UserManager#createGroup(String)
      */
@@ -758,7 +762,6 @@ public class UserManagerImpl extends Pro
         } else {
             pwHash = password;
         }
-        Value v = getSession().getValueFactory().createValue(pwHash);
         setProperty(userNode, P_PASSWORD, getValue(pwHash), userNode.isNew());
     }
 

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authentication/SimpleCredentialsAuthenticationTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authentication/SimpleCredentialsAuthenticationTest.java?rev=1618121&r1=1618120&r2=1618121&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authentication/SimpleCredentialsAuthenticationTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/authentication/SimpleCredentialsAuthenticationTest.java
Fri Aug 15 09:07:05 2014
@@ -123,6 +123,10 @@ public class SimpleCredentialsAuthentica
             return false;
         }
 
+        public boolean isSystemUser() {
+            return false;
+        }
+
         public Credentials getCredentials() throws RepositoryException {
             return creds;
         }

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/user/UserImporterTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/user/UserImporterTest.java?rev=1618121&r1=1618120&r2=1618121&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/user/UserImporterTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/user/UserImporterTest.java
Fri Aug 15 09:07:05 2014
@@ -1621,6 +1621,10 @@ public class UserImporterTest extends Ab
                     return null;
                 }
 
+                public User createSystemUser(String userID, String intermediatePath) throws
AuthorizableExistsException, RepositoryException {
+                    return null;
+                }
+
                 public Group createGroup(String groupID) throws AuthorizableExistsException,
RepositoryException {
                 	return null;
                 }



Mime
View raw message