jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1486857 - in /jackrabbit/oak/trunk/oak-core/src: main/java/org/apache/jackrabbit/oak/security/user/ main/java/org/apache/jackrabbit/oak/spi/security/user/ test/java/org/apache/jackrabbit/oak/security/user/
Date Tue, 28 May 2013 10:31:25 GMT
Author: angela
Date: Tue May 28 10:31:25 2013
New Revision: 1486857

URL: http://svn.apache.org/r1486857
Log:
OAK-50 : Implement User Management  (wip)

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserInitializer.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/user/UserConstants.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserInitializerTest.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserInitializer.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserInitializer.java?rev=1486857&r1=1486856&r2=1486857&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserInitializer.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserInitializer.java
Tue May 28 10:31:25 2013
@@ -123,7 +123,8 @@ class UserInitializer implements Workspa
             ConfigurationParameters params = userConfiguration.getParameters();
             String adminId = params.getConfigValue(PARAM_ADMIN_ID, DEFAULT_ADMIN_ID);
             if (userManager.getAuthorizable(adminId) == null) {
-                userManager.createUser(adminId, params.getNullableConfigValue(PARAM_ADMIN_PW,
adminId));
+                boolean omitPw = params.getConfigValue(PARAM_OMIT_ADMIN_PW, false);
+                userManager.createUser(adminId, (omitPw) ? null : adminId);
             }
             String anonymousId = params.getConfigValue(PARAM_ANONYMOUS_ID, DEFAULT_ANONYMOUS_ID);
             if (userManager.getAuthorizable(anonymousId) == null) {

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/user/UserConstants.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/user/UserConstants.java?rev=1486857&r1=1486856&r2=1486857&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/user/UserConstants.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/user/UserConstants.java
Tue May 28 10:31:25 2013
@@ -61,9 +61,10 @@ public interface UserConstants {
     String PARAM_ADMIN_ID = "adminId";
 
     /**
-     * Configuration option defining the ID of the administrator user.
+     * Configuration option defining if the admin password should be omitted
+     * upon user creation.
      */
-    String PARAM_ADMIN_PW = "adminPw";
+    String PARAM_OMIT_ADMIN_PW = "omitAdminPw";
 
     /**
      * Default value for {@link #PARAM_ADMIN_ID}

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserInitializerTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserInitializerTest.java?rev=1486857&r1=1486856&r2=1486857&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserInitializerTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/security/user/UserInitializerTest.java
Tue May 28 10:31:25 2013
@@ -133,14 +133,14 @@ public class UserInitializerTest extends
     }
 
     /**
-     * @since OAK 1.0 The configuration defines if and how the password of the
+     * @since OAK 1.0 The configuration defines if the password of the
      * admin user is being set.
      */
     @Test
     public void testAdminConfiguration() throws Exception {
-        Map<String,String> userParams = new HashMap();
+        Map<String,Object> userParams = new HashMap();
         userParams.put(UserConstants.PARAM_ADMIN_ID, "admin");
-        userParams.put(UserConstants.PARAM_ADMIN_PW, null);
+        userParams.put(UserConstants.PARAM_OMIT_ADMIN_PW, true);
 
         ConfigurationParameters params = new ConfigurationParameters(ImmutableMap.of(UserConfiguration.PARAM_USER_OPTIONS,
new ConfigurationParameters(userParams)));
         SecurityProvider sp = new SecurityProviderImpl(params);



Mime
View raw message