You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/11/07 09:50:24 UTC

[sling-org-apache-sling-jcr-repoinit] annotated tag org.apache.sling.jcr.repoinit-1.1.4 created (now d77c730)

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a change to annotated tag org.apache.sling.jcr.repoinit-1.1.4
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-repoinit.git.


      at d77c730  (tag)
 tagging 6e7ed063056a8b4b0d72da9823d8478d6b6a4817 (commit)
      by Oliver Lietz
      on Thu Mar 9 18:07:45 2017 +0000

- Log -----------------------------------------------------------------
org.apache.sling.jcr.repoinit-1.1.4
-----------------------------------------------------------------------

This annotated tag includes the following new commits:

     new ae75f44  SLING-5355 - jcr module added, work in progress
     new eabeb26  SLING-5355 - rename jcr to oak-jcr
     new 4b89959  SLING-5355 - test with multiple users
     new d20da33  SLING-5355 - factor our TestUtil
     new d7a5f83  SLING-5355 - AclOperationVisitor partially implemented, and webconsole plugin added
     new a52d167  SLING-5355 - cleanup tests
     new 909608b  SLING-5355 - better error reporting
     new de7c980  SLING-5355 - parser service
     new 1d0ac30  SLING-5355 - it's ok for service user to already exist
     new 1bc8999  SLING-5355 - AclSetupComponent, work in progress
     new 8791efe  SLING-5355 - fail if Principal not found
     new 32f8cf8  SLING-5355 - test ACL definitions in provisioning model
     new 15ca220  Switch to parent pom 26
     new 77ca4b9  SLING-5449 - rename the modules to 'jcrinit'
     new 462ba19  SLING-5449 - the name is 'repoinit' instead as the parser is not JCR-specific
     new 6bc3f85  SLING-5449 - the name is 'repoinit' instead as the parser is not JCR-specific
     new 8296d7d  SLING-5449 - rename packages to repoinit
     new 22a05d6  SLING-5449 - remove AclSetup component and adapt integration tests
     new 7790424  SLING-5449 - rename the remaining things from ACL to 'repoinit'
     new 8a6aec6  SLING-5449 - rename one more thing from ACL to 'repoinit'
     new 9bd6e4b  SLING-5449 - remove console plugin, we don't want this module to be Sling specific
     new 2752857  SLING-5449 - move repoinit under commons
     new f8873b8  repoinit: fix SCM urls after move
     new 5e4f40b  repoinit/oak-jcr: second attempt to fix the scm urls
     new 70c5d7b  SLING-5449 - initial base tree creation language, see test-20.txt for examples
     new 7af1acb  SLING-5449 - Implement CreatePath in oak-jcr module
     new 5938771  SLING-5449 - move the repoinit modules under extensions, they do contain Sling-specific stuff
     new e5e302e  SLING-5449 - fix scm strings
     new e87acee  SLING-5355 - RepositoryInitializer created, reads from provisioning model, WIP:ProvisioningModelIT fails for now
     new 4fc1e21  SLING-5355 - ProvisioningModelIT passes
     new 029bbe3  SLING-5800 - remove unnecessary snapshots and use current jcr.api snapshot
     new 7b78070  SLING-5800 - depend on related releases while releasing this module
     new 3663d69  [maven-release-plugin] prepare release org.apache.sling.repoinit.oak-jcr-1.0.0
     new 60f5b7b  [maven-release-plugin] prepare for next development iteration
     new 7dff12f  SLING-5800 - back to current snapshots after releases
     new 713d36f  Rename o.a.s.repoinit.oak-jcr to o.a.s.jcr.repoinit
     new 1a15e86  SLING-5819 - jcr.repoinit bundle should only export what's strictly needed
     new 4273f56  Remove unused source files and folders
     new 92c4254  SLING-5819 - rename repoinit.jcr package to jcr.repoinit
     new 533713a  Remove unused source code folders
     new 014d655  Prepare for release
     new bb14f7d  [maven-release-plugin] prepare release org.apache.sling.jcr.repoinit-1.0.0
     new 370808a  [maven-release-plugin] prepare for next development iteration
     new fa4b8d9  SLING-5819 - move jcr.repoinit module under jcr folder
     new 2c3076e  SLING-5843 - add 'register namespace' statement to repoinit parser
     new 0eb0707  SLING-5842 - add 'register nodetypes' statement to repoinit parser
     new 552a131  SLING-5842, SLING-5843 - implement the register namespace and nodetype operations in the jcr.repoinit module
     new 71c098a  SLING-5902 RepositoryInitializer uses name component property instead of label
     new 2ea4d7f  SLING-5917 parseRawText flag in getRepoInitText() is ambiguous
     new 35302c8  SLING-5917 - add RepositoryInitializer tests
     new 177001a  SLING-5917 - fix 'null section' test
     new 4bb31e7  SLING-5923 - Support <RAW> marker in model.section.name config param, same meaning as empty string
     new 31b0cec  SLING-5923 - clarify description
     new 3581dbb  SLING-5943 - support explicit format in RepositoryInitializer configuration
     new ed70824  SLING-5943 - better config metadata + logging
     new 3fa0bab  SLING-5943 - support multiple model/raw references in RepositoryInitializer configuration
     new b233c66  Prepare to release parser + this module
     new 83ea12f  [maven-release-plugin] prepare release org.apache.sling.jcr.repoinit-1.0.2
     new 3c7f77c  [maven-release-plugin] prepare for next development iteration
     new c7c4c20  Back to snapshots after release
     new 697158d  SLING-6171 Unable to set up ACLs for the 'everyone' principal
     new 64abc92  use Sling parent 29 and adjust some dependencies
     new b953651  add logging for ACL operations
     new 9a17a98  SLING-6179 Remove default value for property references from RepositoryInitializer
     new 14e35d0  SLING-6219 - reponit grammar support for create/delete user
     new b0edce3  SLING-6219 : Move ACL handling into separate visitor
     new 0456e0d  SLING-6219 : Allow to create users with repoinit
     new e569605  SLING-6219 : Allow to create users with repoinit
     new 9afa129  SLING-6219 - reponit grammar support for create/delete user
     new 7e3df05  Update to parent pom 29
     new 17fb7fc  Fix javadoc generation
     new 6082cba  Use repoinit parser 1.1.0
     new 5dc6a49  [maven-release-plugin] prepare release org.apache.sling.jcr.repoinit-1.1.0
     new c4603b9  [maven-release-plugin] prepare for next development iteration
     new 0bc31a8  Switch to parser 1.1.1-SNAPSHOT during release vote
     new 0556772  Fix NPE in activate
     new 5873b64  Use repoinit parser 1.1.0 for release
     new 3328d5a  [maven-release-plugin] prepare release org.apache.sling.jcr.repoinit-1.1.0
     new 59415e9  [maven-release-plugin] prepare for next development iteration
     new af9eb9b  Switch back to 1.1.1-SNAPSHOT for parser during release
     new c63140f  Fix NPE in processing
     new ba7aa48  Require configuration
     new 9c21077  Switch to repo init parser 1.1.0
     new b4485b9  [maven-release-plugin] prepare release org.apache.sling.jcr.repoinit-1.1.0
     new 6804b4b  [maven-release-plugin] prepare for next development iteration
     new 749016d  Switch to repo init parser 1.1.1-SNAPSHOT
     new 91804c1  Use released repoinit parser 1.1.0
     new e68a508  Make name consistent with module name
     new c29c1f8  SLING-6219 - warn if creating users with cleartext passwords
     new d043d8c  SLING-6368 - Repoinit should not attempt to create access control entries when no changes are needed
     new 9781bfd  [maven-release-plugin] prepare release org.apache.sling.jcr.repoinit-1.1.2
     new 9c224d1  [maven-release-plugin] prepare for next development iteration
     new a9db699  Update slingstart maven plugin to 1.7.0 in all projects to avoid build problems using the reactor
     new 80890cc  SLING-6423 - GeneralAclTest, including tests that fail until ACLOptions are implemented here - contributed by Nitin Nizhawan, thanks!
     new 07b875e  SLING-6423 - @Ignore GeneralAclTest tests that do not pass yet
     new 606b240  SLING-6182 - add ManyServiceUsersTest
     new 41bcdd9  SLING-6182 - use a distinct session to set ACLs, test still passes
     new 6a01525  use Sling Parent 30
     new 2311ca1  improve readability and fix method name
     new 837d364  SLING-6182 repoinit fails to set ACL on previously created principal
     new 93c5cb0  SLING-6182 repoinit fails to set ACL on previously created principal
     new 7620d65  SLING-6629 UserUtil reports user is not existing when user is system user
     new 2fc91e7  add missing scopes
     new 1dff75f  [maven-release-plugin] prepare release org.apache.sling.jcr.repoinit-1.1.4
     new 6e7ed06  [maven-release-plugin] copy for tag org.apache.sling.jcr.repoinit-1.1.4

The 105 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


-- 
To stop receiving notification emails like this one, please contact
['"commits@sling.apache.org" <co...@sling.apache.org>'].

[sling-org-apache-sling-jcr-repoinit] 11/14: SLING-6629 UserUtil reports user is not existing when user is system user

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.repoinit-1.1.4
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-repoinit.git

commit 7620d65a00711f6a9d4de0f72752954ce118a704
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Thu Mar 9 17:54:20 2017 +0000

    SLING-6629 UserUtil reports user is not existing when user is system user
    
    improve and straighten user handling
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/repoinit@1786208 13f79535-47bb-0310-9956-ffa450edef68
---
 .../org/apache/sling/jcr/repoinit/impl/UserUtil.java   | 18 +++++-------------
 .../apache/sling/jcr/repoinit/impl/UserVisitor.java    |  9 ++++++---
 2 files changed, 11 insertions(+), 16 deletions(-)

diff --git a/src/main/java/org/apache/sling/jcr/repoinit/impl/UserUtil.java b/src/main/java/org/apache/sling/jcr/repoinit/impl/UserUtil.java
index 513d5cb..801a2e7 100644
--- a/src/main/java/org/apache/sling/jcr/repoinit/impl/UserUtil.java
+++ b/src/main/java/org/apache/sling/jcr/repoinit/impl/UserUtil.java
@@ -44,11 +44,11 @@ public class UserUtil {
     }
 
     /** True if specified service user exists */
-    public static boolean serviceUserExists(Session session, String username) throws RepositoryException {
+    public static boolean isServiceUser(Session session, String id) throws RepositoryException {
         boolean result = false;
-        final Authorizable authorizable = getAuthorizable(session, username);
-        if(authorizable != null) {
-            final User user = (User)authorizable;
+        final Authorizable authorizable = getAuthorizable(session, id);
+        if (authorizable != null && !authorizable.isGroup()) {
+            final User user = (User) authorizable;
             result = user.isSystemUser();
         }
         return result;
@@ -72,17 +72,9 @@ public class UserUtil {
         boolean result = false;
         final Authorizable authorizable = getAuthorizable(session, id);
         if (authorizable != null) {
-            final User user = (User)authorizable;
-            result = !user.isSystemUser(); // TODO
+            result = !authorizable.isGroup();
         }
         return result;
     }
 
-    public static void deleteServiceUser(Session s, String username) throws RepositoryException {
-        final Authorizable authorizable = getUserManager(s).getAuthorizable(username);
-        if(authorizable == null) {
-            throw new IllegalStateException("Authorizable not found:" + username);
-        }
-        authorizable.remove();
-    }
 }
diff --git a/src/main/java/org/apache/sling/jcr/repoinit/impl/UserVisitor.java b/src/main/java/org/apache/sling/jcr/repoinit/impl/UserVisitor.java
index cd7ac9a..a245f80 100644
--- a/src/main/java/org/apache/sling/jcr/repoinit/impl/UserVisitor.java
+++ b/src/main/java/org/apache/sling/jcr/repoinit/impl/UserVisitor.java
@@ -41,11 +41,14 @@ class UserVisitor extends DoNothingVisitor {
     public void visitCreateServiceUser(CreateServiceUser s) {
         final String username = s.getUsername();
         try {
-            if(!UserUtil.serviceUserExists(session, username)) {
+            if (!UserUtil.userExists(session, username)) {
                 log.info("Creating service user {}", username);
                 UserUtil.createServiceUser(session, username);
+            } else if (UserUtil.isServiceUser(session, username)) {
+                log.info("Service user {} already exists, no changes made.", username);
             } else {
-                log.info("Service user {} already exists, no changes made", username);
+                final String message = String.format("Existing user %s is not a service user.", username);
+                throw new RuntimeException(message);
             }
         } catch(Exception e) {
             report(e, "Unable to create service user [" + username + "]:" + e);
@@ -57,7 +60,7 @@ class UserVisitor extends DoNothingVisitor {
         final String username = s.getUsername();
         log.info("Deleting service user {}", username);
         try {
-            UserUtil.deleteServiceUser(session, username);
+            UserUtil.deleteUser(session, username);
         } catch(Exception e) {
             report(e, "Unable to delete service user [" + username + "]:" + e);
         }

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-repoinit] 03/14: SLING-6423 - GeneralAclTest, including tests that fail until ACLOptions are implemented here - contributed by Nitin Nizhawan, thanks!

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.repoinit-1.1.4
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-repoinit.git

commit 80890cc3957d01f8e40ccec926839711a171da00
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Mon Jan 16 10:49:27 2017 +0000

    SLING-6423 - GeneralAclTest, including tests that fail until ACLOptions are implemented here - contributed by Nitin Nizhawan, thanks!
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/repoinit@1779005 13f79535-47bb-0310-9956-ffa450edef68
---
 .../apache/sling/jcr/repoinit/GeneralAclTest.java  | 257 +++++++++++++++++++++
 1 file changed, 257 insertions(+)

diff --git a/src/test/java/org/apache/sling/jcr/repoinit/GeneralAclTest.java b/src/test/java/org/apache/sling/jcr/repoinit/GeneralAclTest.java
index 764fa10..8799937 100644
--- a/src/test/java/org/apache/sling/jcr/repoinit/GeneralAclTest.java
+++ b/src/test/java/org/apache/sling/jcr/repoinit/GeneralAclTest.java
@@ -42,12 +42,20 @@ public class GeneralAclTest {
     public final SlingContext context = new SlingContext(ResourceResolverType.JCR_OAK);
     
     private TestUtil U;
+    private String userA;
+    private String userB;
+
     private Session s;
     
     @Before
     public void setup() throws RepositoryException, RepoInitParsingException {
         U = new TestUtil(context);
+        userA = "userA_" + U.id;
+        userB = "userB_" + U.id;
         U.parseAndExecute("create service user " + U.username);
+        U.parseAndExecute("create service user " + userA);
+        U.parseAndExecute("create service user " + userB);
+
         s = U.loginService(U.username);
     }
 
@@ -136,4 +144,253 @@ public class GeneralAclTest {
             s.logout();
         }
     }
+
+
+    /**
+     * Verifies success/failure of adding a child
+     * @param username
+     * @param nodeName
+     * @param successExpected
+     * @throws RepositoryException
+     */
+   private void verifyAddChildNode(String username,String nodeName, boolean successExpected) throws RepositoryException {
+       Session userSession = U.loginService(username);
+       try {
+           Node rootNode = userSession.getRootNode();
+           rootNode.addNode(nodeName);
+           userSession.save();
+           assertTrue(successExpected);
+       } catch(Exception e) {
+           assertTrue(!successExpected);
+       } finally {
+           if(userSession != null) {
+               userSession.logout();
+           }
+       }
+   }
+
+    /**
+     * Verifies success/failure of adding a properties
+     * @param username
+     * @param nodeName
+     * @param propertyName
+     * @param successExpected
+     * @throws RepositoryException
+     */
+    private void verifyAddProperty(String username,String nodeName,String propertyName, boolean successExpected) throws RepositoryException {
+        Session userSession = U.loginService(username);
+        try {
+            Node rootNode = userSession.getRootNode();
+            Node node = rootNode.getNode(nodeName);
+            node.setProperty(propertyName,"test");
+            userSession.save();
+            assertTrue(successExpected);
+        } catch(Exception e) {
+            assertTrue(!successExpected);
+        } finally {
+            if(userSession != null) {
+                userSession.logout();
+            }
+        }
+    }
+
+
+
+   /**
+    * Verifies that ACEs for existing principal are replaced
+    */
+  // @Test
+   public void mergeMode_ReplaceExistingPrincipalTest() throws Exception {
+      final String initialAclSetup = 
+                     " set ACL for " + userA + "\n"
+                     + "allow jcr:read,jcr:addChildNodes on / \n"
+                     + "end"
+                     ;
+
+      final String aclsToBeMerged =
+                     " set ACL for " + userA + " (ACLOptions=merge)\n"
+                     + "allow jcr:read on / \n"
+                     + "allow jcr:modifyProperties on / \n"
+                     + "end"
+                     ;
+
+      U.parseAndExecute(initialAclSetup);
+      // verify that setup is correct
+      verifyAddChildNode(userA, "A1_" + U.id, true); // add node should succeed
+      verifyAddProperty(userA,"A1_"+U.id,"Prop1",false); // add property should fail
+
+      //now merge acls
+      U.parseAndExecute(aclsToBeMerged);
+
+      //verify merged ACLs
+      verifyAddChildNode(userA, "A2_" + U.id, false); // add node should fail
+      verifyAddProperty(userA,"A1_"+U.id,"prop2",true);// add property should succeed
+
+   }
+
+
+    /**
+     * Verify that ACLs for new principal are added
+     * @throws Exception
+     */
+  //  @Test
+    public void mergeMode_AddAceTest() throws Exception {
+        final String initialAclSetup =
+                "set ACL for " + userA + "\n"
+                + "allow jcr:read,jcr:write on /\n"
+                + "end \n"
+                ;
+
+        // userA,jcr:write ACE will be removed,
+        // userB ACE will be added
+        final String aclsToBeMerged =
+                    "set ACL on / (ACLOptions=merge) \n"
+                    + "allow jcr:read for " + userA + "\n"
+                    + "allow jcr:read,jcr:write for " + userB + "\n"
+                    + "end \n"
+                ;
+
+        U.parseAndExecute(initialAclSetup);
+        // verify that setup is correct
+        verifyAddChildNode(userA, "A1_" + U.id, true);
+        verifyAddChildNode(userB, "B1_" + U.id, false);
+        //now merge acls
+        U.parseAndExecute(aclsToBeMerged);
+
+        //verify merged ACLs
+        verifyAddChildNode(userA, "A2_" + U.id, false);
+        verifyAddChildNode(userB, "B2_" + U.id, true);
+
+    }
+
+    /**
+     * Verify that ACEs for unspecified principal are preserved
+     * @throws Exception
+     */
+    //@Test
+    public void mergeMode_PreserveAceTest() throws Exception {
+        final String initialAclSetup =
+                        "set ACL on / \n"
+                        + "allow jcr:read,jcr:write for " + userA + "\n"
+                        + "allow jcr:read,jcr:write for " + userB + "\n"
+                        + "end \n"
+                        ;
+
+        // userB ACE will be preserved
+        final String aclsToBeMerged =
+                        "set ACL on / (ACLOptions=merge) \n"
+                        + "allow jcr:read for " + userA + "\n"
+                        + "end \n"
+                        ;
+
+        U.parseAndExecute(initialAclSetup);
+        // verify that setup is correct
+        verifyAddChildNode(userA, "A1_" + U.id, true);
+        verifyAddChildNode(userB, "B1_" + U.id, true);
+
+        //now merge acls
+        U.parseAndExecute(aclsToBeMerged);
+
+        //verify merged ACLs
+        verifyAddChildNode(userA, "A2_" + U.id, false);
+        verifyAddChildNode(userB, "B2_" + U.id, true);
+
+    }
+
+
+    /**
+     * Verifiy that ACE for non-existing principal are added
+     * @throws Exception
+     */
+    //@Test
+    public void mergePreserveMode_AddAceTest() throws Exception{
+        final String initialAclSetup =
+                " set ACL for " + userB + "\n"
+                + "allow jcr:read,jcr:write on /\n"
+                + "end \n"
+                ;
+
+        final String aclsToBeMerged =
+                "set ACL for " + userA + " (ACLOptions=mergePreserve)\n"
+                + "allow jcr:read,jcr:write on / \n"
+                + "end \n"
+                ;
+
+        U.parseAndExecute(initialAclSetup);
+        // verify that setup is correct
+        verifyAddChildNode(userA, "A1_" + U.id, false);
+        verifyAddChildNode(userB, "B1_" + U.id, true);
+
+        //now merge acls
+        U.parseAndExecute(aclsToBeMerged);
+
+        //verify merged ACLs
+        verifyAddChildNode(userA, "A2_" + U.id, true);
+        verifyAddChildNode(userB, "B2_" + U.id, true);
+    }
+
+
+    /**
+     * Verify that ACE for existing principal are ignored
+     * @throws Exception
+     */
+   //@Test
+    public void mergePreserveMode_IgnoreAceTest() throws Exception {
+        final String initialAclSetup =
+                "set ACL for " + userA + "\n"
+                + "allow jcr:read,jcr:addChildNodes on /\n"
+                + "end"
+                ;
+
+        final String aclsToBeMerged =
+                " set ACL for " + userA + " (ACLOptions=mergePreserve) \n"
+                + "allow jcr:read,jcr:modifyProperties on / \n"
+                + "end \n"
+                ;
+
+        U.parseAndExecute(initialAclSetup);
+        // verify that setup is correct
+        verifyAddChildNode(userA, "A1_" + U.id, true); // add node should succeed
+        verifyAddProperty(userA, "A1_" + U.id, "Prop1", false); // add property should fail
+
+        //now merge acls
+        U.parseAndExecute(aclsToBeMerged);
+
+        //verify merged ACLs
+        verifyAddChildNode(userA, "A2_" + U.id, true); // add node should succeed
+        verifyAddProperty(userA, "A2_" + U.id, "Prop1", false); // add property should fail
+    }
+
+
+    /**
+     * Verify that ACE for unspecified principal are preserved
+     * @throws Exception
+     */
+    //@Test
+    public void mergePreserveMode_PreserveAceTest() throws Exception {
+        final String initialAclSetup =
+                " set ACL on /\n"
+                + "allow jcr:read, jcr:write for " + userA + " , " + userB + "\n"
+                + "end \n"
+                ;
+
+        // ACL for userA will be ignored but added for userB
+        final String aclsToBeMerged =
+                " set ACL for " + userA + " (ACLOptions=mergePreserve) \n"
+                + "allow jcr:read on / \n"
+                + "end \n"
+                ;
+
+        U.parseAndExecute(initialAclSetup);
+        // verify that setup is correct
+        verifyAddChildNode(userA, "A1_" + U.id, true);
+        verifyAddChildNode(userB, "B1_" + U.id, true);
+
+        //now merge acls
+        U.parseAndExecute(aclsToBeMerged);
+
+        //verify merged ACLs
+        verifyAddChildNode(userA, "A2_" + U.id, true);
+        verifyAddChildNode(userB, "B2_" + U.id, true);
+    }
 }

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-repoinit] 02/14: Update slingstart maven plugin to 1.7.0 in all projects to avoid build problems using the reactor

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.repoinit-1.1.4
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-repoinit.git

commit a9db69946ff6fdc5a13aa8fc8237e59563992ef6
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Thu Dec 29 14:29:30 2016 +0000

    Update slingstart maven plugin to 1.7.0 in all projects to avoid build problems using the reactor
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/repoinit@1776436 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 91fab70..12d329f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -158,7 +158,7 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.provisioning.model</artifactId>
-            <version>1.4.2</version>
+            <version>1.8.0</version>
             <scope>provided</scope>
         </dependency>
         <dependency>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-repoinit] 05/14: SLING-6182 - add ManyServiceUsersTest

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.repoinit-1.1.4
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-repoinit.git

commit 606b24097d4f5ba0ef622c3de587ff8662d9fd1d
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Fri Feb 3 13:55:09 2017 +0000

    SLING-6182 - add ManyServiceUsersTest
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/repoinit@1781548 13f79535-47bb-0310-9956-ffa450edef68
---
 .../jcr/repoinit/impl/ManyServiceUsersTest.java    | 93 ++++++++++++++++++++++
 1 file changed, 93 insertions(+)

diff --git a/src/test/java/org/apache/sling/jcr/repoinit/impl/ManyServiceUsersTest.java b/src/test/java/org/apache/sling/jcr/repoinit/impl/ManyServiceUsersTest.java
new file mode 100644
index 0000000..89956b3
--- /dev/null
+++ b/src/test/java/org/apache/sling/jcr/repoinit/impl/ManyServiceUsersTest.java
@@ -0,0 +1,93 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.sling.jcr.repoinit.impl;
+
+import java.util.Arrays;
+import java.util.UUID;
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import org.apache.sling.repoinit.parser.RepoInitParsingException;
+import org.apache.sling.testing.mock.sling.ResourceResolverType;
+import org.apache.sling.testing.mock.sling.junit.SlingContext;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import static org.junit.Assert.fail;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/** Created for SLING-6182 to verify that setAcl works right after
+ *  creating a service user.
+ */
+public class ManyServiceUsersTest {
+
+    @Rule
+    public final SlingContext context = new SlingContext(ResourceResolverType.JCR_OAK);
+    
+    private final Logger log = LoggerFactory.getLogger(getClass());
+    
+    private static final String N_USERS_PROP = ManyServiceUsersTest.class.getSimpleName() + ".N_USERS";
+    
+    private TestUtil U;
+    private static final int N_USERS = Integer.getInteger(N_USERS_PROP, 50);
+    private String uniqueId;
+    
+    @Before
+    public void setup() throws RepositoryException, RepoInitParsingException {
+        U = new TestUtil(context);
+        uniqueId = UUID.randomUUID().toString();
+    }
+    
+    @After
+    public void cleanup() {
+        U.cleanup();
+    }
+    
+    @Test
+    public void testSyncServiceUserCreation() throws Exception {
+        
+        log.info("Creating {} service users (as set by the {} system property) and setting ACLs on them", 
+                N_USERS, N_USERS_PROP);
+        
+        final Session s = U.getAdminSession();
+        final Node testRoot = s.getRootNode().addNode(getClass().getSimpleName() + "_" + uniqueId);
+        final String path = testRoot.getPath();
+        s.save();
+        
+        try {
+            for(int i=1; i < N_USERS; i++) {
+                final String username = getClass().getSimpleName() + "_" + uniqueId + "_" + i;
+                UserUtil.createServiceUser(s, username);
+                U.assertServiceUser("Right after creation at index " + i, username, true);
+                
+                // Required for setAcl to work
+                s.save();
+                
+                try {
+                    AclUtil.setAcl(s, Arrays.asList(username), Arrays.asList(path), Arrays.asList("jcr:read"), true);
+                } catch(Exception e) {
+                    fail("SetAcl failed at index " + i + ": " + e);
+                }
+            }
+        } finally {
+            testRoot.remove();
+            s.save();
+        }
+    }
+}
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-repoinit] 13/14: [maven-release-plugin] prepare release org.apache.sling.jcr.repoinit-1.1.4

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.repoinit-1.1.4
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-repoinit.git

commit 1dff75f8196def70aa56bb64c80a1b310bdad15c
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Thu Mar 9 18:07:32 2017 +0000

    [maven-release-plugin] prepare release org.apache.sling.jcr.repoinit-1.1.4
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/repoinit@1786211 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 5bff079..210f104 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,7 +29,7 @@
 
   <artifactId>org.apache.sling.jcr.repoinit</artifactId>
   <packaging>bundle</packaging>
-  <version>1.1.3-SNAPSHOT</version>
+  <version>1.1.4</version>
   <name>Apache Sling JCR RepoInit module</name>
   <description>
 	  Initializes a JCR repository based on the output
@@ -41,9 +41,9 @@
   </properties>
 
   <scm>
-    <connection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/repoinit</connection>
-    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/repoinit</developerConnection>
-    <url>https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/repoinit</url>
+    <connection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.jcr.repoinit-1.1.4</connection>
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.jcr.repoinit-1.1.4</developerConnection>
+    <url>https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.jcr.repoinit-1.1.4</url>
   </scm>
 
     <build>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-repoinit] 06/14: SLING-6182 - use a distinct session to set ACLs, test still passes

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.repoinit-1.1.4
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-repoinit.git

commit 41bcdd93d01a11795f2445c14f746ae0d7c17c3a
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Mon Feb 6 10:51:34 2017 +0000

    SLING-6182 - use a distinct session to set ACLs, test still passes
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/repoinit@1781873 13f79535-47bb-0310-9956-ffa450edef68
---
 .../org/apache/sling/jcr/repoinit/impl/ManyServiceUsersTest.java  | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/test/java/org/apache/sling/jcr/repoinit/impl/ManyServiceUsersTest.java b/src/test/java/org/apache/sling/jcr/repoinit/impl/ManyServiceUsersTest.java
index 89956b3..b1970c4 100644
--- a/src/test/java/org/apache/sling/jcr/repoinit/impl/ManyServiceUsersTest.java
+++ b/src/test/java/org/apache/sling/jcr/repoinit/impl/ManyServiceUsersTest.java
@@ -21,6 +21,7 @@ import java.util.UUID;
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
+import javax.jcr.SimpleCredentials;
 import org.apache.sling.repoinit.parser.RepoInitParsingException;
 import org.apache.sling.testing.mock.sling.ResourceResolverType;
 import org.apache.sling.testing.mock.sling.junit.SlingContext;
@@ -70,7 +71,9 @@ public class ManyServiceUsersTest {
         final String path = testRoot.getPath();
         s.save();
         
+        Session otherSession = null;
         try {
+            otherSession = s.getRepository().login(new SimpleCredentials("admin", "admin".toCharArray()));
             for(int i=1; i < N_USERS; i++) {
                 final String username = getClass().getSimpleName() + "_" + uniqueId + "_" + i;
                 UserUtil.createServiceUser(s, username);
@@ -80,7 +83,7 @@ public class ManyServiceUsersTest {
                 s.save();
                 
                 try {
-                    AclUtil.setAcl(s, Arrays.asList(username), Arrays.asList(path), Arrays.asList("jcr:read"), true);
+                    AclUtil.setAcl(otherSession, Arrays.asList(username), Arrays.asList(path), Arrays.asList("jcr:read"), true);
                 } catch(Exception e) {
                     fail("SetAcl failed at index " + i + ": " + e);
                 }
@@ -88,6 +91,9 @@ public class ManyServiceUsersTest {
         } finally {
             testRoot.remove();
             s.save();
+            if(otherSession != null) {
+                otherSession.logout();
+            }
         }
     }
 }
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-repoinit] 07/14: use Sling Parent 30

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.repoinit-1.1.4
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-repoinit.git

commit 6a01525c9d9ca0031f6b216e6efab2af7bc584f5
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Mon Mar 6 10:22:30 2017 +0000

    use Sling Parent 30
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/repoinit@1785621 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 12d329f..1f9f4a3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.sling</groupId>
     <artifactId>sling</artifactId>
-    <version>29</version>
+    <version>30</version>
     <relativePath />
   </parent>
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-repoinit] 08/14: improve readability and fix method name

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.repoinit-1.1.4
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-repoinit.git

commit 2311ca12e98159dc420048fc6fe7facf345b68a9
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Thu Mar 9 16:10:45 2017 +0000

    improve readability and fix method name
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/repoinit@1786196 13f79535-47bb-0310-9956-ffa450edef68
---
 .../apache/sling/jcr/repoinit/impl/UserUtil.java   | 50 +++++++++++-----------
 .../sling/jcr/repoinit/impl/UserVisitor.java       | 42 +++++++++---------
 2 files changed, 46 insertions(+), 46 deletions(-)

diff --git a/src/main/java/org/apache/sling/jcr/repoinit/impl/UserUtil.java b/src/main/java/org/apache/sling/jcr/repoinit/impl/UserUtil.java
index 168ffd7..513d5cb 100644
--- a/src/main/java/org/apache/sling/jcr/repoinit/impl/UserUtil.java
+++ b/src/main/java/org/apache/sling/jcr/repoinit/impl/UserUtil.java
@@ -24,7 +24,7 @@ import org.apache.jackrabbit.api.security.user.Authorizable;
 import org.apache.jackrabbit.api.security.user.User;
 import org.apache.jackrabbit.api.security.user.UserManager;
 
-/** Utilities for (Service) Users management */
+/** Utilities for User management */
 public class UserUtil {
 
     public static UserManager getUserManager(Session session) throws RepositoryException {
@@ -34,55 +34,55 @@ public class UserUtil {
         return ((JackrabbitSession)session).getUserManager();
     }
 
-    public static Authorizable getAuthorizable(Session session, String username) throws RepositoryException {
-        return getUserManager(session).getAuthorizable(username);
+    public static Authorizable getAuthorizable(Session session, String id) throws RepositoryException {
+        return getUserManager(session).getAuthorizable(id);
     }
 
     /** Create a service user - fails if it already exists */
-    public static void createServiceUser(Session s, String username) throws RepositoryException {
-        getUserManager(s).createSystemUser(username, null);
+    public static void createServiceUser(Session session, String username) throws RepositoryException {
+        getUserManager(session).createSystemUser(username, null);
     }
 
     /** True if specified service user exists */
     public static boolean serviceUserExists(Session session, String username) throws RepositoryException {
         boolean result = false;
-        final Authorizable a = getAuthorizable(session, username);
-        if(a != null) {
-            final User u = (User)a;
-            result = u.isSystemUser();
+        final Authorizable authorizable = getAuthorizable(session, username);
+        if(authorizable != null) {
+            final User user = (User)authorizable;
+            result = user.isSystemUser();
         }
         return result;
     }
 
-    public static void deleteUser(Session s, String username) throws RepositoryException {
-        final Authorizable a = getUserManager(s).getAuthorizable(username);
-        if(a == null) {
-            throw new IllegalStateException("Authorizable not found:" + username);
+    public static void deleteUser(Session session, String id) throws RepositoryException {
+        final Authorizable authorizable = getUserManager(session).getAuthorizable(id);
+        if(authorizable == null) {
+            throw new IllegalStateException("Authorizable not found:" + id);
         }
-        a.remove();
+        authorizable.remove();
     }
 
-    /** Create a service user - fails if it already exists */
-    public static void createUser(Session s, String username, String password) throws RepositoryException {
-        getUserManager(s).createUser(username, password);
+    /** Create a user - fails if it already exists */
+    public static void createUser(Session session, String username, String password) throws RepositoryException {
+        getUserManager(session).createUser(username, password);
     }
 
     /** True if specified user exists */
-    public static boolean serviceExists(Session session, String username) throws RepositoryException {
+    public static boolean userExists(Session session, String id) throws RepositoryException {
         boolean result = false;
-        final Authorizable a = getAuthorizable(session, username);
-        if (a != null) {
-            final User u = (User)a;
-            result = !u.isSystemUser();
+        final Authorizable authorizable = getAuthorizable(session, id);
+        if (authorizable != null) {
+            final User user = (User)authorizable;
+            result = !user.isSystemUser(); // TODO
         }
         return result;
     }
 
     public static void deleteServiceUser(Session s, String username) throws RepositoryException {
-        final Authorizable a = getUserManager(s).getAuthorizable(username);
-        if(a == null) {
+        final Authorizable authorizable = getUserManager(s).getAuthorizable(username);
+        if(authorizable == null) {
             throw new IllegalStateException("Authorizable not found:" + username);
         }
-        a.remove();
+        authorizable.remove();
     }
 }
diff --git a/src/main/java/org/apache/sling/jcr/repoinit/impl/UserVisitor.java b/src/main/java/org/apache/sling/jcr/repoinit/impl/UserVisitor.java
index 5612c0a..cd7ac9a 100644
--- a/src/main/java/org/apache/sling/jcr/repoinit/impl/UserVisitor.java
+++ b/src/main/java/org/apache/sling/jcr/repoinit/impl/UserVisitor.java
@@ -39,61 +39,61 @@ class UserVisitor extends DoNothingVisitor {
 
     @Override
     public void visitCreateServiceUser(CreateServiceUser s) {
-        final String id = s.getUsername();
+        final String username = s.getUsername();
         try {
-            if(!UserUtil.serviceUserExists(session, id)) {
-                log.info("Creating service user {}", id);
-                UserUtil.createServiceUser(session, id);
+            if(!UserUtil.serviceUserExists(session, username)) {
+                log.info("Creating service user {}", username);
+                UserUtil.createServiceUser(session, username);
             } else {
-                log.info("Service user {} already exists, no changes made", id);
+                log.info("Service user {} already exists, no changes made", username);
             }
         } catch(Exception e) {
-            report(e, "Unable to create service user [" + id + "]:" + e);
+            report(e, "Unable to create service user [" + username + "]:" + e);
         }
     }
 
     @Override
     public void visitDeleteServiceUser(DeleteServiceUser s) {
-        final String id = s.getUsername();
-        log.info("Deleting service user {}", id);
+        final String username = s.getUsername();
+        log.info("Deleting service user {}", username);
         try {
-            UserUtil.deleteServiceUser(session, id);
+            UserUtil.deleteServiceUser(session, username);
         } catch(Exception e) {
-            report(e, "Unable to delete service user [" + id + "]:" + e);
+            report(e, "Unable to delete service user [" + username + "]:" + e);
         }
     }
 
     @Override
     public void visitCreateUser(CreateUser u) {
-        final String id = u.getUsername();
+        final String username = u.getUsername();
         try {
-            if(!UserUtil.serviceExists(session, id)) {
+            if(!UserUtil.userExists(session, username)) {
                 final String pwd = u.getPassword();
                 if(pwd != null) {
                     // TODO we might revise this warning once we're able
                     // to create users by providing their encoded password
                     // using u.getPasswordEncoding - for now I think only cleartext works
-                    log.warn("Creating user {} with cleartext password - should NOT be used on production systems", id);
+                    log.warn("Creating user {} with cleartext password - should NOT be used on production systems", username);
                 } else {
-                    log.info("Creating user {}", id);
+                    log.info("Creating user {}", username);
                 }
-                UserUtil.createUser(session, id, pwd);
+                UserUtil.createUser(session, username, pwd);
             } else {
-                log.info("User {} already exists, no changes made", id);
+                log.info("User {} already exists, no changes made", username);
             }
         } catch(Exception e) {
-            report(e, "Unable to create user [" + id + "]:" + e);
+            report(e, "Unable to create user [" + username + "]:" + e);
         }
     }
 
     @Override
     public void visitDeleteUser(DeleteUser u) {
-        final String id = u.getUsername();
-        log.info("Deleting user {}", id);
+        final String username = u.getUsername();
+        log.info("Deleting user {}", username);
         try {
-            UserUtil.deleteUser(session, id);
+            UserUtil.deleteUser(session, username);
         } catch(Exception e) {
-            report(e, "Unable to delete user [" + id + "]:" + e);
+            report(e, "Unable to delete user [" + username + "]:" + e);
         }
     }
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-repoinit] 14/14: [maven-release-plugin] copy for tag org.apache.sling.jcr.repoinit-1.1.4

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.repoinit-1.1.4
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-repoinit.git

commit 6e7ed063056a8b4b0d72da9823d8478d6b6a4817
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Thu Mar 9 18:07:45 2017 +0000

    [maven-release-plugin] copy for tag org.apache.sling.jcr.repoinit-1.1.4
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.jcr.repoinit-1.1.4@1786212 13f79535-47bb-0310-9956-ffa450edef68

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-repoinit] 04/14: SLING-6423 - @Ignore GeneralAclTest tests that do not pass yet

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.repoinit-1.1.4
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-repoinit.git

commit 07b875edfa9aed311dcdfe4c0cc91127a5b17a5f
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Mon Jan 16 10:52:29 2017 +0000

    SLING-6423 - @Ignore GeneralAclTest tests that do not pass yet
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/repoinit@1779006 13f79535-47bb-0310-9956-ffa450edef68
---
 .../org/apache/sling/jcr/repoinit/GeneralAclTest.java | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/src/test/java/org/apache/sling/jcr/repoinit/GeneralAclTest.java b/src/test/java/org/apache/sling/jcr/repoinit/GeneralAclTest.java
index 8799937..e9da029 100644
--- a/src/test/java/org/apache/sling/jcr/repoinit/GeneralAclTest.java
+++ b/src/test/java/org/apache/sling/jcr/repoinit/GeneralAclTest.java
@@ -32,6 +32,7 @@ import org.apache.sling.testing.mock.sling.ResourceResolverType;
 import org.apache.sling.testing.mock.sling.junit.SlingContext;
 import org.junit.After;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Rule;
 import org.junit.Test;
 
@@ -199,7 +200,8 @@ public class GeneralAclTest {
    /**
     * Verifies that ACEs for existing principal are replaced
     */
-  // @Test
+   @Test
+   @Ignore("SLING-6423 - ACLOptions processing is not implemented yet")
    public void mergeMode_ReplaceExistingPrincipalTest() throws Exception {
       final String initialAclSetup = 
                      " set ACL for " + userA + "\n"
@@ -233,7 +235,8 @@ public class GeneralAclTest {
      * Verify that ACLs for new principal are added
      * @throws Exception
      */
-  //  @Test
+    @Test
+    @Ignore("SLING-6423 - ACLOptions processing is not implemented yet")
     public void mergeMode_AddAceTest() throws Exception {
         final String initialAclSetup =
                 "set ACL for " + userA + "\n"
@@ -267,7 +270,8 @@ public class GeneralAclTest {
      * Verify that ACEs for unspecified principal are preserved
      * @throws Exception
      */
-    //@Test
+    @Test
+    @Ignore("SLING-6423 - ACLOptions processing is not implemented yet")
     public void mergeMode_PreserveAceTest() throws Exception {
         final String initialAclSetup =
                         "set ACL on / \n"
@@ -302,7 +306,8 @@ public class GeneralAclTest {
      * Verifiy that ACE for non-existing principal are added
      * @throws Exception
      */
-    //@Test
+    @Test
+    @Ignore("SLING-6423 - ACLOptions processing is not implemented yet")
     public void mergePreserveMode_AddAceTest() throws Exception{
         final String initialAclSetup =
                 " set ACL for " + userB + "\n"
@@ -334,7 +339,8 @@ public class GeneralAclTest {
      * Verify that ACE for existing principal are ignored
      * @throws Exception
      */
-   //@Test
+    @Test
+    @Ignore("SLING-6423 - ACLOptions processing is not implemented yet")
     public void mergePreserveMode_IgnoreAceTest() throws Exception {
         final String initialAclSetup =
                 "set ACL for " + userA + "\n"
@@ -366,7 +372,8 @@ public class GeneralAclTest {
      * Verify that ACE for unspecified principal are preserved
      * @throws Exception
      */
-    //@Test
+    @Test
+    @Ignore("SLING-6423 - ACLOptions processing is not implemented yet")
     public void mergePreserveMode_PreserveAceTest() throws Exception {
         final String initialAclSetup =
                 " set ACL on /\n"

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-repoinit] 12/14: add missing scopes

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.repoinit-1.1.4
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-repoinit.git

commit 2fc91e7218f9cdf5951749d77ee178354c701974
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Thu Mar 9 18:00:02 2017 +0000

    add missing scopes
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/repoinit@1786210 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/pom.xml b/pom.xml
index 5df3256..5bff079 100644
--- a/pom.xml
+++ b/pom.xml
@@ -109,18 +109,22 @@
         <dependency>
             <groupId>org.osgi</groupId>
             <artifactId>osgi.core</artifactId>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-api</artifactId>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.slf4j</groupId>
           <artifactId>slf4j-simple</artifactId>
+            <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>javax.jcr</groupId>
             <artifactId>jcr</artifactId>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.jackrabbit</groupId>
@@ -137,6 +141,7 @@
         <dependency>
             <groupId>javax.servlet</groupId>
             <artifactId>javax.servlet-api</artifactId>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>commons-io</groupId>
@@ -154,6 +159,7 @@
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.jcr.api</artifactId>
             <version>2.4.0</version>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.jackrabbit</groupId>
@@ -170,6 +176,7 @@
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
+            <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-repoinit] 01/14: [maven-release-plugin] prepare for next development iteration

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.repoinit-1.1.4
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-repoinit.git

commit 9c224d1531410da1b646e457903b9b239a30c6a4
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Thu Dec 15 11:41:44 2016 +0000

    [maven-release-plugin] prepare for next development iteration
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/repoinit@1774421 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 9211ad6..91fab70 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,7 +29,7 @@
 
   <artifactId>org.apache.sling.jcr.repoinit</artifactId>
   <packaging>bundle</packaging>
-  <version>1.1.2</version>
+  <version>1.1.3-SNAPSHOT</version>
   <name>Apache Sling JCR RepoInit module</name>
   <description>
 	  Initializes a JCR repository based on the output
@@ -41,9 +41,9 @@
   </properties>
 
   <scm>
-    <connection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.jcr.repoinit-1.1.2</connection>
-    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.jcr.repoinit-1.1.2</developerConnection>
-    <url>https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.jcr.repoinit-1.1.2</url>
+    <connection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/repoinit</connection>
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/repoinit</developerConnection>
+    <url>https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/repoinit</url>
   </scm>
 
     <build>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-repoinit] 09/14: SLING-6182 repoinit fails to set ACL on previously created principal

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.repoinit-1.1.4
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-repoinit.git

commit 837d364e5761b0e2ef447087d2d0e313479a2763
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Thu Mar 9 16:15:11 2017 +0000

    SLING-6182 repoinit fails to set ACL on previously created principal
    
    do not use AccessControlUtils for regular principals
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/repoinit@1786198 13f79535-47bb-0310-9956-ffa450edef68
---
 .../apache/sling/jcr/repoinit/impl/AclUtil.java    | 23 ++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/src/main/java/org/apache/sling/jcr/repoinit/impl/AclUtil.java b/src/main/java/org/apache/sling/jcr/repoinit/impl/AclUtil.java
index 934fa5f..7cd5a51 100644
--- a/src/main/java/org/apache/sling/jcr/repoinit/impl/AclUtil.java
+++ b/src/main/java/org/apache/sling/jcr/repoinit/impl/AclUtil.java
@@ -33,7 +33,9 @@ import javax.jcr.security.Privilege;
 import org.apache.jackrabbit.api.security.JackrabbitAccessControlEntry;
 import org.apache.jackrabbit.api.security.JackrabbitAccessControlList;
 import org.apache.jackrabbit.api.security.JackrabbitAccessControlManager;
+import org.apache.jackrabbit.api.security.user.Authorizable;
 import org.apache.jackrabbit.commons.jackrabbit.authorization.AccessControlUtils;
+import org.apache.jackrabbit.oak.spi.security.principal.EveryonePrincipal;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -52,21 +54,30 @@ public class AclUtil {
         return (JackrabbitAccessControlManager) acm;
     }
 
-    public static void setAcl(Session s, List<String> principals, List<String> paths, List<String> privileges, boolean isAllow)
+    public static void setAcl(Session session, List<String> principals, List<String> paths, List<String> privileges, boolean isAllow)
             throws UnsupportedRepositoryOperationException, RepositoryException {
 
         final String [] privArray = privileges.toArray(new String[privileges.size()]);
-        final Privilege[] jcrPriv = AccessControlUtils.privilegesFromNames(s, privArray);
+        final Privilege[] jcrPriv = AccessControlUtils.privilegesFromNames(session, privArray);
 
         for(String path : paths) {
-            if(!s.nodeExists(path)) {
+            if(!session.nodeExists(path)) {
                 throw new PathNotFoundException("Cannot set ACL on non-existent path " + path);
             }
-            JackrabbitAccessControlList acl = AccessControlUtils.getAccessControlList(s, path);
+            JackrabbitAccessControlList acl = AccessControlUtils.getAccessControlList(session, path);
             AccessControlEntry[] existingAces = acl.getAccessControlEntries();
             boolean changed = false;
             for (String name : principals) {
-                final Principal principal = AccessControlUtils.getPrincipal(s, name);
+                final Principal principal;
+                if (EveryonePrincipal.NAME.equals(name)) {
+                    principal = AccessControlUtils.getPrincipal(session, name);
+                } else {
+                    final Authorizable authorizable = UserUtil.getAuthorizable(session, name);
+                    if (authorizable == null) {
+                        throw new IllegalStateException("Authorizable not found:" + name);
+                    }
+                    principal = authorizable.getPrincipal();
+                }
                 if (principal == null) {
                     throw new IllegalStateException("Principal not found: " + name);
                 }
@@ -79,7 +90,7 @@ public class AclUtil {
                 changed = true;
             }
             if ( changed ) {
-                getJACM(s).setPolicy(path, acl);
+                getJACM(session).setPolicy(path, acl);
             }
             
         }

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-repoinit] 10/14: SLING-6182 repoinit fails to set ACL on previously created principal

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.repoinit-1.1.4
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-repoinit.git

commit 93c5cb04bef4749c7e7b0756b6de5b727cbad8b4
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Thu Mar 9 16:29:07 2017 +0000

    SLING-6182 repoinit fails to set ACL on previously created principal
    
    do not use AccessControlUtils for regular principals (missed pom.xml)
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/repoinit@1786199 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/pom.xml b/pom.xml
index 1f9f4a3..5df3256 100644
--- a/pom.xml
+++ b/pom.xml
@@ -156,6 +156,12 @@
             <version>2.4.0</version>
         </dependency>
         <dependency>
+            <groupId>org.apache.jackrabbit</groupId>
+            <artifactId>oak-core</artifactId>
+            <version>1.0.0</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.provisioning.model</artifactId>
             <version>1.8.0</version>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.