From 1dd2840a4908bb78655fbaee665c79f101d2762d Mon Sep 17 00:00:00 2001 From: Konrad Windszus Date: Fri, 27 Nov 2015 14:40:35 +0100 Subject: [PATCH 01/26] updating poms for 1.7.1-SNAPSHOT development --- accesscontroltool-bundle/pom.xml | 2 +- accesscontroltool-oakindex-package/pom.xml | 2 +- accesscontroltool-package/pom.xml | 2 +- pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/accesscontroltool-bundle/pom.xml b/accesscontroltool-bundle/pom.xml index 8d2d75c1..dbddeacc 100644 --- a/accesscontroltool-bundle/pom.xml +++ b/accesscontroltool-bundle/pom.xml @@ -11,7 +11,7 @@ biz.netcentric.cq.tools.accesscontroltool accesscontroltool - 1.7.0-SNAPSHOT + 1.7.1-SNAPSHOT diff --git a/accesscontroltool-oakindex-package/pom.xml b/accesscontroltool-oakindex-package/pom.xml index 4e2835b6..a21bb2df 100644 --- a/accesscontroltool-oakindex-package/pom.xml +++ b/accesscontroltool-oakindex-package/pom.xml @@ -15,7 +15,7 @@ biz.netcentric.cq.tools.accesscontroltool accesscontroltool - 1.7.0-SNAPSHOT + 1.7.1-SNAPSHOT diff --git a/accesscontroltool-package/pom.xml b/accesscontroltool-package/pom.xml index 7ce8eca5..84935754 100644 --- a/accesscontroltool-package/pom.xml +++ b/accesscontroltool-package/pom.xml @@ -15,7 +15,7 @@ biz.netcentric.cq.tools.accesscontroltool accesscontroltool - 1.7.0-SNAPSHOT + 1.7.1-SNAPSHOT diff --git a/pom.xml b/pom.xml index 3c8ceefc..33b7949f 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ biz.netcentric.cq.tools.accesscontroltool accesscontroltool - 1.7.0-SNAPSHOT + 1.7.1-SNAPSHOT pom Access Control Tool - Reactor Project From 5e466dab2e3487239566ab7ef7525af94f8b4d23 Mon Sep 17 00:00:00 2001 From: Konrad Windszus Date: Fri, 27 Nov 2015 14:43:01 +0100 Subject: [PATCH 02/26] updating develop poms to master versions to avoid merge conflicts --- accesscontroltool-bundle/pom.xml | 2 +- accesscontroltool-oakindex-package/pom.xml | 2 +- accesscontroltool-package/pom.xml | 2 +- pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/accesscontroltool-bundle/pom.xml b/accesscontroltool-bundle/pom.xml index dbddeacc..61668345 100644 --- a/accesscontroltool-bundle/pom.xml +++ b/accesscontroltool-bundle/pom.xml @@ -11,7 +11,7 @@ biz.netcentric.cq.tools.accesscontroltool accesscontroltool - 1.7.1-SNAPSHOT + 1.7.0 diff --git a/accesscontroltool-oakindex-package/pom.xml b/accesscontroltool-oakindex-package/pom.xml index a21bb2df..d2ff4f04 100644 --- a/accesscontroltool-oakindex-package/pom.xml +++ b/accesscontroltool-oakindex-package/pom.xml @@ -15,7 +15,7 @@ biz.netcentric.cq.tools.accesscontroltool accesscontroltool - 1.7.1-SNAPSHOT + 1.7.0 diff --git a/accesscontroltool-package/pom.xml b/accesscontroltool-package/pom.xml index 84935754..dfe7a7ad 100644 --- a/accesscontroltool-package/pom.xml +++ b/accesscontroltool-package/pom.xml @@ -15,7 +15,7 @@ biz.netcentric.cq.tools.accesscontroltool accesscontroltool - 1.7.1-SNAPSHOT + 1.7.0 diff --git a/pom.xml b/pom.xml index 33b7949f..cfe302cc 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ biz.netcentric.cq.tools.accesscontroltool accesscontroltool - 1.7.1-SNAPSHOT + 1.7.0 pom Access Control Tool - Reactor Project From b73e55098c2410c4f1020c80de5450fd0f75ba97 Mon Sep 17 00:00:00 2001 From: Konrad Windszus Date: Fri, 27 Nov 2015 14:43:01 +0100 Subject: [PATCH 03/26] Updating develop poms back to pre merge state --- accesscontroltool-bundle/pom.xml | 2 +- accesscontroltool-oakindex-package/pom.xml | 2 +- accesscontroltool-package/pom.xml | 2 +- pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/accesscontroltool-bundle/pom.xml b/accesscontroltool-bundle/pom.xml index 61668345..dbddeacc 100644 --- a/accesscontroltool-bundle/pom.xml +++ b/accesscontroltool-bundle/pom.xml @@ -11,7 +11,7 @@ biz.netcentric.cq.tools.accesscontroltool accesscontroltool - 1.7.0 + 1.7.1-SNAPSHOT diff --git a/accesscontroltool-oakindex-package/pom.xml b/accesscontroltool-oakindex-package/pom.xml index d2ff4f04..a21bb2df 100644 --- a/accesscontroltool-oakindex-package/pom.xml +++ b/accesscontroltool-oakindex-package/pom.xml @@ -15,7 +15,7 @@ biz.netcentric.cq.tools.accesscontroltool accesscontroltool - 1.7.0 + 1.7.1-SNAPSHOT diff --git a/accesscontroltool-package/pom.xml b/accesscontroltool-package/pom.xml index dfe7a7ad..84935754 100644 --- a/accesscontroltool-package/pom.xml +++ b/accesscontroltool-package/pom.xml @@ -15,7 +15,7 @@ biz.netcentric.cq.tools.accesscontroltool accesscontroltool - 1.7.0 + 1.7.1-SNAPSHOT diff --git a/pom.xml b/pom.xml index cfe302cc..33b7949f 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ biz.netcentric.cq.tools.accesscontroltool accesscontroltool - 1.7.0 + 1.7.1-SNAPSHOT pom Access Control Tool - Reactor Project From 0b03d0462397e4509b93eee776ea3de9da77086a Mon Sep 17 00:00:00 2001 From: Conrad Woeltge Date: Thu, 3 Dec 2015 17:46:45 +0100 Subject: [PATCH 04/26] #54: introducing CQ5.6.1 dependencies, removing oakindex-package --- README.md | 3 +++ accesscontroltool-bundle/pom.xml | 16 ++++++++++++---- pom.xml | 32 +++++++++++++++++++++----------- 3 files changed, 36 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 4d1a8439..6591c424 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,9 @@ The package can be installed using the AEM Package Manager or directly from the mvn -PautoInstallPackage install ``` +## Working on CQ5.6 +To deploy to CQ5.6 switch to branch `develop-cq56`. + # Configuration File Format For better human readability and easy editing the ACL configuration files use the YAML format. diff --git a/accesscontroltool-bundle/pom.xml b/accesscontroltool-bundle/pom.xml index dbddeacc..f04d08f9 100644 --- a/accesscontroltool-bundle/pom.xml +++ b/accesscontroltool-bundle/pom.xml @@ -23,10 +23,6 @@ Access Control Tool Bundle - - com.adobe.aem - aem-api - org.osgi org.osgi.compendium @@ -121,6 +117,18 @@ hamcrest-library 1.3 + + org.apache.jackrabbit + jackrabbit-jcr-commons + + + org.apache.sling + org.apache.sling.settings + + + com.day.jcr.vault + com.day.jcr.vault + diff --git a/pom.xml b/pom.xml index 33b7949f..fc93b653 100644 --- a/pom.xml +++ b/pom.xml @@ -76,17 +76,33 @@ accesscontroltool-bundle accesscontroltool-package - accesscontroltool-oakindex-package - + + - com.adobe.aem - aem-api - 6.0.0.1 + org.apache.jackrabbit + jackrabbit-jcr-commons + 2.11.2 + + + org.apache.sling + org.apache.sling.settings + 1.2.2 + + + com.day.jcr.vault + com.day.jcr.vault + 2.4.32 + + + com.day.cq + cq-commons + 5.6.4 provided + org.osgi org.osgi.core @@ -183,12 +199,6 @@ 5.6.2 provided - - com.day.cq - cq-commons - 5.8.2 - provided - org.yaml snakeyaml From 6c075ef5575305794664afdeeae1afe42bfd6688 Mon Sep 17 00:00:00 2001 From: Conrad Woeltge Date: Thu, 3 Dec 2015 22:19:59 +0100 Subject: [PATCH 05/26] #54: -Poakindex can now be added as profile. CQ5.6.1 dependencies can be default --- README.md | 7 +++++-- pom.xml | 7 +++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6591c424..b4434db9 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,11 @@ The package can be installed using the AEM Package Manager or directly from the mvn -PautoInstallPackage install ``` -## Working on CQ5.6 -To deploy to CQ5.6 switch to branch `develop-cq56`. +## AEM6.x +To add an Oak Index install, run all commands with profile `oakindex`, e.g. + ``` +mvn clean install -Poakindex + ``` # Configuration File Format diff --git a/pom.xml b/pom.xml index fc93b653..3f862318 100644 --- a/pom.xml +++ b/pom.xml @@ -432,6 +432,13 @@ + + oakindex + + accesscontroltool-oakindex-package + + + From b66d4fc00b4f88a1c8552e34f54c97898ecacc94 Mon Sep 17 00:00:00 2001 From: Conrad Woeltge Date: Thu, 3 Dec 2015 23:23:49 +0100 Subject: [PATCH 06/26] #54: refining dependencies after testing. --- accesscontroltool-bundle/pom.xml | 6 ++++++ pom.xml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/accesscontroltool-bundle/pom.xml b/accesscontroltool-bundle/pom.xml index f04d08f9..4c503c2b 100644 --- a/accesscontroltool-bundle/pom.xml +++ b/accesscontroltool-bundle/pom.xml @@ -129,6 +129,12 @@ com.day.jcr.vault com.day.jcr.vault + + org.apache.jackrabbit + oak-core + 1.3.9 + compile + diff --git a/pom.xml b/pom.xml index 3f862318..f1fc7132 100644 --- a/pom.xml +++ b/pom.xml @@ -190,7 +190,7 @@ org.apache.jackrabbit jackrabbit-api - 2.3.0 + 2.7.5 provided From 86e628c99f1eae45c5533b15c31391e67f372abe Mon Sep 17 00:00:00 2001 From: Conrad Woeltge Date: Fri, 4 Dec 2015 09:20:01 +0100 Subject: [PATCH 07/26] #54: removing cq5.6.1 comment as it doesn't make much sense anymore --- pom.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/pom.xml b/pom.xml index f1fc7132..cdc318b1 100644 --- a/pom.xml +++ b/pom.xml @@ -80,7 +80,6 @@ - org.apache.jackrabbit jackrabbit-jcr-commons @@ -102,7 +101,6 @@ 5.6.4 provided - org.osgi org.osgi.core From b4f84780421e45bfcb5d587c4f124bc4a0e9de24 Mon Sep 17 00:00:00 2001 From: Conrad Woeltge Date: Fri, 4 Dec 2015 09:32:28 +0100 Subject: [PATCH 08/26] #54: changing Oak dependency scope to test to avoid AEM dependencies by accident. --- accesscontroltool-bundle/pom.xml | 2 +- .../netcentric/cq/tools/actool/helper/QueryHelper.java | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/accesscontroltool-bundle/pom.xml b/accesscontroltool-bundle/pom.xml index 4c503c2b..4eb7e00e 100644 --- a/accesscontroltool-bundle/pom.xml +++ b/accesscontroltool-bundle/pom.xml @@ -133,7 +133,7 @@ org.apache.jackrabbit oak-core 1.3.9 - compile + test diff --git a/accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/helper/QueryHelper.java b/accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/helper/QueryHelper.java index 171231d8..a8e03736 100644 --- a/accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/helper/QueryHelper.java +++ b/accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/helper/QueryHelper.java @@ -31,10 +31,12 @@ import javax.jcr.security.AccessControlManager; import org.apache.jackrabbit.api.security.JackrabbitAccessControlList; -import org.apache.jackrabbit.oak.spi.security.user.UserConstants; public class QueryHelper { + private static final String NT_REP_USER = "rep:User"; + private static final String NT_REP_GROUP = "rep:Group"; + /** * Method that returns a set containing all rep:policy nodes from repository * excluding those contained in paths which are excluded from search @@ -133,13 +135,13 @@ public static Set getNodes(final Session session, public static Set getUsersFromHome(final Session session) throws InvalidQueryException, RepositoryException { - Set users = getPrincipalsFromHome(session, UserConstants.NT_REP_USER); + Set users = getPrincipalsFromHome(session, NT_REP_USER); return users; } public static Set getGroupsFromHome(final Session session) throws InvalidQueryException, RepositoryException { - Set groups = getPrincipalsFromHome(session, UserConstants.NT_REP_GROUP); + Set groups = getPrincipalsFromHome(session, NT_REP_GROUP); return groups; } From 2b094e85f731fb4b79f5c88a8c31f88aaa2c1c4f Mon Sep 17 00:00:00 2001 From: Conrad Woeltge Date: Fri, 4 Dec 2015 09:33:05 +0100 Subject: [PATCH 09/26] #54: adding a comment to pom encuraging for CQ 5.6.1 compatibility --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index cdc318b1..cef241f9 100644 --- a/pom.xml +++ b/pom.xml @@ -80,6 +80,7 @@ + org.apache.jackrabbit jackrabbit-jcr-commons From cb4256f13f4500188edb010780b8679d4bf16bca Mon Sep 17 00:00:00 2001 From: Conrad Woeltge Date: Fri, 4 Dec 2015 09:36:40 +0100 Subject: [PATCH 10/26] #54: updating readme --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b4434db9..6cdd621f 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,11 @@ The package can be installed using the AEM Package Manager or directly from the mvn -PautoInstallPackage install ``` -## AEM6.x -To add an Oak Index install, run all commands with profile `oakindex`, e.g. +## AEM6.x/Oak + +The `oakindex-package` contains an optimized Oak index to cover all queries being issued by the Access Control Tool. To build (and optionally deploy) the content-package use the Maven profile oakindex. This package is only compatible with Oak and even there it is optional (as it will only speed up queries). + +To use the package, run all commands with profile `oakindex`, e.g. ``` mvn clean install -Poakindex ``` From 6d0849507057788054bada15a2789494b0ee886e Mon Sep 17 00:00:00 2001 From: Konrad Windszus Date: Fri, 4 Dec 2015 09:43:20 +0100 Subject: [PATCH 11/26] fix version of jackrabbit api (to make it 5.6.1 compatible) make all dependencies being provided by CQ have scope "provided" --- pom.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index cef241f9..4e1bc869 100644 --- a/pom.xml +++ b/pom.xml @@ -85,16 +85,19 @@ org.apache.jackrabbit jackrabbit-jcr-commons 2.11.2 + provided org.apache.sling org.apache.sling.settings 1.2.2 + provided com.day.jcr.vault com.day.jcr.vault 2.4.32 + provided com.day.cq @@ -189,7 +192,7 @@ org.apache.jackrabbit jackrabbit-api - 2.7.5 + 2.6.2 provided From b080faf95f37bf43a9a4dd482efaae5ea2c468a3 Mon Sep 17 00:00:00 2001 From: Konrad Windszus Date: Fri, 4 Dec 2015 15:10:46 +0100 Subject: [PATCH 12/26] Integrate reindex package hook Closes #56 --- accesscontroltool-oakindex-package/pom.xml | 260 +++++++++++++-------- 1 file changed, 158 insertions(+), 102 deletions(-) diff --git a/accesscontroltool-oakindex-package/pom.xml b/accesscontroltool-oakindex-package/pom.xml index a21bb2df..4dc4422f 100644 --- a/accesscontroltool-oakindex-package/pom.xml +++ b/accesscontroltool-oakindex-package/pom.xml @@ -1,109 +1,165 @@ - + + 4.0.0 + + + + + biz.netcentric.cq.tools.accesscontroltool + accesscontroltool + 1.7.1-SNAPSHOT + - All rights reserved. This program and the accompanying materials - are made available under the terms of the Eclipse Public License v1.0 - which accompanies this distribution, and is available at - http://www.eclipse.org/legal/epl-v10.html ---> - - 4.0.0 - - - - - biz.netcentric.cq.tools.accesscontroltool - accesscontroltool - 1.7.1-SNAPSHOT - + + + - - - + accesscontroltool-oakindex-package + content-package + Access Control Tool Package - Oak Index - accesscontroltool-oakindex-package - content-package - Access Control Tool Package - Oak Index + + + + src/main/jcr_root + false + + **/.vlt + **/.vltignore + + + - - - - src/main/jcr_root - false - - **/.vlt - **/.vltignore - - - + + + org.apache.maven.plugins + maven-resources-plugin + + true + + - - - org.apache.maven.plugins - maven-resources-plugin - - true - - - - - com.day.jcr.vault - content-package-maven-plugin - true - - Netcentric - src/main/META-INF/vault/filter.xml - http://${crx.host}:${crx.port}/crx/packmgr/service.jsp - - - - - - - autoInstallPackage - - - - com.day.jcr.vault - content-package-maven-plugin - - - install-content-package - install - - install - - - - - - - - - autoInstallPackagePublish - - - - com.day.jcr.vault - content-package-maven-plugin - - - install-content-package-publish - install - - install - - - http://${publish.crx.host}:${publish.crx.port}/crx/packmgr/service.jsp - ${publish.crx.username} - ${publish.crx.password} - - - - - - - - + + com.day.jcr.vault + content-package-maven-plugin + true + + Netcentric + src/main/META-INF/vault/filter.xml + http://${crx.host}:${crx.port}/crx/packmgr/service.jsp + + + + org.apache.maven.plugins + maven-dependency-plugin + 2.10 + + + copy-reindex-hook-into-package + generate-resources + + copy + + + + + net.distilledcode + filevault-oak-reindex-hook + 1.0.2 + + + ${project.build.directory}/vault-work/META-INF/vault/hooks + + + + + + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + + org.apache.maven.plugins + + + maven-dependency-plugin + + + [2.10,) + + + copy + + + + + + + + + + + + + + + + autoInstallPackage + + + + com.day.jcr.vault + content-package-maven-plugin + + + install-content-package + install + + install + + + + + + + + + autoInstallPackagePublish + + + + com.day.jcr.vault + content-package-maven-plugin + + + install-content-package-publish + install + + install + + + http://${publish.crx.host}:${publish.crx.port}/crx/packmgr/service.jsp + ${publish.crx.username} + ${publish.crx.password} + + + + + + + + From f068b9eff5563655ffc312c6ad12e4bdad1e55cd Mon Sep 17 00:00:00 2001 From: Konrad Windszus Date: Fri, 4 Dec 2015 15:15:20 +0100 Subject: [PATCH 13/26] Revert "Integrate reindex package hook Closes #56" This reverts commit b080faf95f37bf43a9a4dd482efaae5ea2c468a3. --- accesscontroltool-oakindex-package/pom.xml | 260 ++++++++------------- 1 file changed, 102 insertions(+), 158 deletions(-) diff --git a/accesscontroltool-oakindex-package/pom.xml b/accesscontroltool-oakindex-package/pom.xml index 4dc4422f..a21bb2df 100644 --- a/accesscontroltool-oakindex-package/pom.xml +++ b/accesscontroltool-oakindex-package/pom.xml @@ -1,165 +1,109 @@ - - - 4.0.0 - - - - - biz.netcentric.cq.tools.accesscontroltool - accesscontroltool - 1.7.1-SNAPSHOT - + - - + All rights reserved. This program and the accompanying materials + are made available under the terms of the Eclipse Public License v1.0 + which accompanies this distribution, and is available at + http://www.eclipse.org/legal/epl-v10.html +--> + + 4.0.0 + + + + + biz.netcentric.cq.tools.accesscontroltool + accesscontroltool + 1.7.1-SNAPSHOT + - accesscontroltool-oakindex-package - content-package - Access Control Tool Package - Oak Index + + + - - - - src/main/jcr_root - false - - **/.vlt - **/.vltignore - - - + accesscontroltool-oakindex-package + content-package + Access Control Tool Package - Oak Index - - - org.apache.maven.plugins - maven-resources-plugin - - true - - + + + + src/main/jcr_root + false + + **/.vlt + **/.vltignore + + + - - com.day.jcr.vault - content-package-maven-plugin - true - - Netcentric - src/main/META-INF/vault/filter.xml - http://${crx.host}:${crx.port}/crx/packmgr/service.jsp - - - - org.apache.maven.plugins - maven-dependency-plugin - 2.10 - - - copy-reindex-hook-into-package - generate-resources - - copy - - - - - net.distilledcode - filevault-oak-reindex-hook - 1.0.2 - - - ${project.build.directory}/vault-work/META-INF/vault/hooks - - - - - - - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - - org.apache.maven.plugins - - - maven-dependency-plugin - - - [2.10,) - - - copy - - - - - - - - - - - - - - - - autoInstallPackage - - - - com.day.jcr.vault - content-package-maven-plugin - - - install-content-package - install - - install - - - - - - - - - autoInstallPackagePublish - - - - com.day.jcr.vault - content-package-maven-plugin - - - install-content-package-publish - install - - install - - - http://${publish.crx.host}:${publish.crx.port}/crx/packmgr/service.jsp - ${publish.crx.username} - ${publish.crx.password} - - - - - - - - + + + org.apache.maven.plugins + maven-resources-plugin + + true + + + + + com.day.jcr.vault + content-package-maven-plugin + true + + Netcentric + src/main/META-INF/vault/filter.xml + http://${crx.host}:${crx.port}/crx/packmgr/service.jsp + + + + + + + autoInstallPackage + + + + com.day.jcr.vault + content-package-maven-plugin + + + install-content-package + install + + install + + + + + + + + + autoInstallPackagePublish + + + + com.day.jcr.vault + content-package-maven-plugin + + + install-content-package-publish + install + + install + + + http://${publish.crx.host}:${publish.crx.port}/crx/packmgr/service.jsp + ${publish.crx.username} + ${publish.crx.password} + + + + + + + + From b133b6a15a4f305b9913a621f58dab9330b2d947 Mon Sep 17 00:00:00 2001 From: Konrad Windszus Date: Fri, 4 Dec 2015 15:15:52 +0100 Subject: [PATCH 14/26] minimize formatting changes --- accesscontroltool-oakindex-package/pom.xml | 62 +++++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) diff --git a/accesscontroltool-oakindex-package/pom.xml b/accesscontroltool-oakindex-package/pom.xml index a21bb2df..c9abf784 100644 --- a/accesscontroltool-oakindex-package/pom.xml +++ b/accesscontroltool-oakindex-package/pom.xml @@ -57,7 +57,67 @@ http://${crx.host}:${crx.port}/crx/packmgr/service.jsp - + + + org.apache.maven.plugins + maven-dependency-plugin + 2.10 + + + copy-reindex-hook-into-package + generate-resources + + copy + + + + + net.distilledcode + filevault-oak-reindex-hook + 1.0.2 + + + ${project.build.directory}/vault-work/META-INF/vault/hooks + + + + + + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + + org.apache.maven.plugins + + + maven-dependency-plugin + + + [2.10,) + + + copy + + + + + + + + + + + + From ca25d87f8a25721990ca8a8f8724ea6ca7bb4d46 Mon Sep 17 00:00:00 2001 From: Konrad Windszus Date: Fri, 4 Dec 2015 15:18:08 +0100 Subject: [PATCH 15/26] make sure index is always overwritten, add documentation link --- accesscontroltool-oakindex-package/pom.xml | 1 + .../src/main/META-INF/vault/filter.xml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/accesscontroltool-oakindex-package/pom.xml b/accesscontroltool-oakindex-package/pom.xml index c9abf784..949df3bd 100644 --- a/accesscontroltool-oakindex-package/pom.xml +++ b/accesscontroltool-oakindex-package/pom.xml @@ -64,6 +64,7 @@ 2.10 + copy-reindex-hook-into-package generate-resources diff --git a/accesscontroltool-oakindex-package/src/main/META-INF/vault/filter.xml b/accesscontroltool-oakindex-package/src/main/META-INF/vault/filter.xml index 559cc100..d7fd60af 100644 --- a/accesscontroltool-oakindex-package/src/main/META-INF/vault/filter.xml +++ b/accesscontroltool-oakindex-package/src/main/META-INF/vault/filter.xml @@ -1,4 +1,4 @@ - + From 7ffd080f8d2d39ea39055c4b575efc305b3b42d4 Mon Sep 17 00:00:00 2001 From: Konrad Windszus Date: Mon, 7 Dec 2015 11:39:53 +0100 Subject: [PATCH 16/26] revert to old (CQ 5.6.1 incompatible) jackrabbit API to fix build --- pom.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4e1bc869..de079cec 100644 --- a/pom.xml +++ b/pom.xml @@ -192,7 +192,8 @@ org.apache.jackrabbit jackrabbit-api - 2.6.2 + + 2.7.1 provided From 0ccc2289190509b0a4898874414b6cfd514c30b9 Mon Sep 17 00:00:00 2001 From: Konrad Windszus Date: Mon, 7 Dec 2015 12:58:24 +0100 Subject: [PATCH 17/26] Clearly state compatibility only with CQ 5.6.1 (SP2) This closes #54 --- README.md | 2 +- pom.xml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6cdd621f..c74f22d7 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ The Access Control Tool for Adobe Experience Manager (ACTool) is a tool that sim Building the ACTool requires Java 7 and Maven 3.2. -Installing ACTool requires CQ5.6/AEM 6.0/AEM 6.1. +Installing ACTool requires CQ5.6 (min. SP2)/AEM 6.0/AEM 6.1. # Installation diff --git a/pom.xml b/pom.xml index de079cec..753a0b5d 100644 --- a/pom.xml +++ b/pom.xml @@ -80,7 +80,7 @@ - + org.apache.jackrabbit jackrabbit-jcr-commons @@ -192,8 +192,8 @@ org.apache.jackrabbit jackrabbit-api - - 2.7.1 + + 2.7.5 provided From 224d6a13fec2959a70d0e650a4e1e0cf67485514 Mon Sep 17 00:00:00 2001 From: Konrad Windszus Date: Mon, 7 Dec 2015 13:00:17 +0100 Subject: [PATCH 18/26] fix compatibility info --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c74f22d7..2a2109db 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ The Access Control Tool for Adobe Experience Manager (ACTool) is a tool that sim Building the ACTool requires Java 7 and Maven 3.2. -Installing ACTool requires CQ5.6 (min. SP2)/AEM 6.0/AEM 6.1. +Installing ACTool requires CQ5.6.1 (min. SP2)/AEM 6.0/AEM 6.1. # Installation From f7484f33350cbb3c7dbf1563b7dfa7f51a24f810 Mon Sep 17 00:00:00 2001 From: gruberroland-netcentric Date: Fri, 29 Jan 2016 10:07:43 +0100 Subject: [PATCH 19/26] fixed initialContent example --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2a2109db..4e7d6d2a 100644 --- a/README.md +++ b/README.md @@ -117,7 +117,7 @@ Overall format actions: actions string privileges: privileges string repGlob: regex (optional, path restriction as regular expression) - initialContent: (optional) + initialContent: (optional) ``` Only ACEs for groups which are defined in the same configuration file can be installed! This ensures a consistency between the groups and their ACE definitions per configuration file. From 83ee43bed86a30d3238159df3d27e9797e98aa6a Mon Sep 17 00:00:00 2001 From: "georg.henzler" Date: Thu, 4 Feb 2016 18:34:20 +0100 Subject: [PATCH 20/26] #58 Major refactoring to allow - more flexible use of for loops regarding hierarchy - if statements - the in children of syntax --- HISTORY | 18 -- README.md | 48 ++++ accesscontroltool-bundle/pom.xml | 31 +++ .../aceservice/impl/AceServiceImpl.java | 11 +- .../actool/configreader/YamlConfigReader.java | 166 +----------- .../configreader/YamlConfigurationMerger.java | 12 +- .../YamlMacroChildNodeObjectsProvider.java | 22 ++ ...YamlMacroChildNodeObjectsProviderImpl.java | 131 ++++++++++ .../configreader/YamlMacroElEvaluator.java | 206 +++++++++++++++ .../configreader/YamlMacroProcessor.java | 23 ++ .../configreader/YamlMacroProcessorImpl.java | 198 ++++++++++++++ .../configreader/YamlConfigReaderTest.java | 131 +--------- .../YamlConfigurationMergerTest.java | 22 +- .../configreader/YamlMacroProcessorTest.java | 242 ++++++++++++++++++ .../AcToolInstallHookServiceImplTest.java | 6 - .../src/test/resources/test-if.yaml | 53 ++++ .../test/resources/test-loop-children-of.yaml | 26 ++ .../src/test/resources/test-loop.yaml | 11 +- 18 files changed, 1035 insertions(+), 322 deletions(-) delete mode 100644 HISTORY create mode 100644 accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/configreader/YamlMacroChildNodeObjectsProvider.java create mode 100644 accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/configreader/YamlMacroChildNodeObjectsProviderImpl.java create mode 100644 accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/configreader/YamlMacroElEvaluator.java create mode 100644 accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/configreader/YamlMacroProcessor.java create mode 100644 accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/configreader/YamlMacroProcessorImpl.java create mode 100644 accesscontroltool-bundle/src/test/java/biz/netcentric/cq/tools/actool/configreader/YamlMacroProcessorTest.java delete mode 100644 accesscontroltool-bundle/src/test/java/biz/netcentric/cq/tools/actool/installhook/AcToolInstallHookServiceImplTest.java create mode 100644 accesscontroltool-bundle/src/test/resources/test-if.yaml create mode 100644 accesscontroltool-bundle/src/test/resources/test-loop-children-of.yaml diff --git a/HISTORY b/HISTORY deleted file mode 100644 index 2e569012..00000000 --- a/HISTORY +++ /dev/null @@ -1,18 +0,0 @@ -actool 1.6 - August 14, 2015 -------------------------- -- AEM 6.1 Compatibility -- Better query performance and new accesscontroltool-oakindex-package (containing an index for [rep:ACL]) -- Ability to add users in a user_config section (in the same format as group_config). Users additionally support property isSystemUser for AEM 6.1 - -actool 1.5 - May 21, 2015 -------------------------- -Fixed #15: purgeAllAuthorizablesFromConfigurations() method throws Exception - -actool 1.4, April 14th, 2015 ----------------------------- -Fixed #13: Restored call to AccessControlUtils.addActions to deal with CQ-specific actions -Fixed #14: Support hyphens in 'for' loop lists of values. - -actool 1.3 March 5th, 2015 --------------------------- -Added support to set members of a group diff --git a/README.md b/README.md index 4e7d6d2a..f1912e1f 100644 --- a/README.md +++ b/README.md @@ -242,6 +242,54 @@ This will create 12 groups: * content-BRAND2-MKT2-reader * content-BRAND2-MKT2-writer +### Loops derived from content structure (since 1.8.x) + +For some use cases it is useful to dynamically derive the list of possible values from the content structure. FOR ... IN CHILDREN OF will loop over the children of the provided path (skipping 'jcr:content' nodes) and provide an object with the properties name, path, primaryType, jcr:content (a map of all properties of the respective node) and title (./jcr:content/jcr:title added to root map for convenience). + +``` +- FOR site IN CHILDREN OF /content/myPrj: + + - content-reader-${site.name}: + - name: Content Reader ${site.title} + isMemberOf: + path: /home/groups/${site.name} +``` + + +### Conditional entries (since 1.8.x) + +When looping over content structures, entries can be applied conditionally using the "IF" keyword: + +``` +- FOR site IN CHILDREN OF /content/myPrj: + + - content-reader-${site.name}: + - name: Content Reader ${site.title} + isMemberOf: + path: /home/groups/${site.name} + + IF ${endsWith(site.name,'-master')}: + - content-reader-master-${site.name}: + - name: Master Content Reader ${site.title} + isMemberOf: + path: /home/groups/global +``` + +Expressions are evaluated using javax.el expression language. The following utility functions are made available to any EL expression used in yaml: + +- split(str,separator) +- join(array,separator) +- subarray(array,startIndexInclusive,endIndexExclusive) +- upperCase(str) +- lowerCase(str) +- substringAfter(str,separator) +- substringBefore(str,separator) +- substringAfterLast(str,separator) +- substringBeforeLast(str,separator) +- contains(str,fragmentStr) +- endsWith(str,fragmentStr) +- startsWith(str,fragmentStr) + ## Validation First the validation of the different configuration lines is performed based on regular expressions and gets applied while reading the file. Further validation consists of checking paths for existence as well as for double entries, checks for conflicting ACEs (e.g. allow and deny for same actions on same node), checks whether principals are existing under home. If an invalid parameter or aforementioned issue gets detected, the reading gets aborted and an appropriate error message gets append in the installation history and log. diff --git a/accesscontroltool-bundle/pom.xml b/accesscontroltool-bundle/pom.xml index 4eb7e00e..a793c021 100644 --- a/accesscontroltool-bundle/pom.xml +++ b/accesscontroltool-bundle/pom.xml @@ -129,6 +129,26 @@ com.day.jcr.vault com.day.jcr.vault + + + + org.apache.tomcat + el-api + 6.0.41 + + + org.apache.tomcat + jasper-el + 6.0.41 + + + + org.slf4j + slf4j-log4j12 + 1.7.6 + + + org.apache.jackrabbit oak-core @@ -142,6 +162,17 @@ + + + org.apache.felix + maven-bundle-plugin + + + el-api,jasper-el + + + + org.apache.felix maven-scr-plugin diff --git a/accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/aceservice/impl/AceServiceImpl.java b/accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/aceservice/impl/AceServiceImpl.java index 685acfc8..4ea85f85 100644 --- a/accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/aceservice/impl/AceServiceImpl.java +++ b/accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/aceservice/impl/AceServiceImpl.java @@ -49,7 +49,6 @@ import biz.netcentric.cq.tools.actool.configreader.ConfigFilesRetriever; import biz.netcentric.cq.tools.actool.configreader.ConfigReader; import biz.netcentric.cq.tools.actool.configreader.ConfigurationMerger; -import biz.netcentric.cq.tools.actool.configreader.YamlConfigurationMerger; import biz.netcentric.cq.tools.actool.dumpservice.Dumpservice; import biz.netcentric.cq.tools.actool.helper.AcHelper; import biz.netcentric.cq.tools.actool.helper.AccessControlUtils; @@ -82,6 +81,9 @@ public class AceServiceImpl implements AceService { @Reference private ConfigReader configReader; + @Reference + private ConfigurationMerger configurationMerger; + @Reference private ConfigFilesRetriever configFilesRetriever; @@ -299,7 +301,6 @@ public void installNewConfigurations(Session session, if (newestConfigurations != null) { - ConfigurationMerger configurationMerger = new YamlConfigurationMerger(); List mergedConfigurations = configurationMerger.getMergedConfigurations(newestConfigurations, history, configReader); installMergedConfigurations(history, session, @@ -572,11 +573,9 @@ public Set getAllAuthorizablesFromConfig(Session session) AcInstallationHistoryPojo history = new AcInstallationHistoryPojo(); Node rootNode = session.getNode(configurationPath); Map newestConfigurations = configFilesRetriever.getConfigFileContentFromNode(rootNode); - ConfigurationMerger configurationMeger = new YamlConfigurationMerger(); - List mergedConfigurations = configurationMeger.getMergedConfigurations( + List mergedConfigurations = configurationMerger.getMergedConfigurations( newestConfigurations, history, configReader); - return ((Map>) mergedConfigurations.get(0)) - .keySet(); + return ((Map>) mergedConfigurations.get(0)).keySet(); } } diff --git a/accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/configreader/YamlConfigReader.java b/accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/configreader/YamlConfigReader.java index b22b4ee8..b92d9b50 100644 --- a/accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/configreader/YamlConfigReader.java +++ b/accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/configreader/YamlConfigReader.java @@ -10,15 +10,12 @@ import java.util.ArrayList; import java.util.Collection; -import java.util.HashMap; import java.util.HashSet; import java.util.LinkedHashMap; import java.util.LinkedHashSet; -import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; -import java.util.regex.Matcher; import java.util.regex.Pattern; import javax.jcr.Node; @@ -126,7 +123,7 @@ private Collection getConfigSection(final String sectionName, final Collection y } private Map> getAuthorizablesMap( - final List yamlMap, final AuthorizableValidator authorizableValidator, boolean isGroupSection) + List yamlMap, final AuthorizableValidator authorizableValidator, boolean isGroupSection) throws AcConfigBeanValidationException { final Set alreadyProcessedGroups = new HashSet(); final Map> principalMap = new LinkedHashMap>(); @@ -134,32 +131,10 @@ private Map> getAuthorizablesMap( if (yamlMap == null) { return principalMap; } + for (final LinkedHashMap currentMap : yamlMap) { - final String currentPrincipal = (String) currentMap.keySet().iterator() - .next(); - - final Matcher matcher = forLoopPattern.matcher(currentPrincipal); - if (matcher.find()) { - LOG.info("Principal name {} matches FOR loop pattern. Unrolling {}", currentPrincipal, currentMap.get(currentPrincipal)); - final List groups = unrollGroupForLoop(currentPrincipal, - (List>) currentMap.get(currentPrincipal), - new HashMap(), isGroupSection); - for (final AuthorizableConfigBean group : groups) { - final String principal = group.getPrincipalID(); - if (!alreadyProcessedGroups.add(principal)) { - throw new IllegalArgumentException( - "There is more than one group definition for group: " - + principal); - } - if (authorizableValidator != null) { - authorizableValidator.validate(group); - } - final Set tmpSet = new LinkedHashSet(); - tmpSet.add(group); - principalMap.put(principal, tmpSet); - } - } else { + final String currentPrincipal = (String) currentMap.keySet().iterator().next(); if (!alreadyProcessedGroups.add(currentPrincipal)) { throw new IllegalArgumentException( @@ -185,14 +160,14 @@ private Map> getAuthorizablesMap( principalMap.get(currentPrincipal).add(tmpPrincipalConfigBean); } } - } + } return principalMap; } private Map> getPreservedOrderdAceMap( - final List aceYamlList, + List aceYamlList, final Set groupsFromCurrentConfig, final AceBeanValidator aceBeanValidator) throws RepositoryException, AcConfigBeanValidationException { @@ -202,6 +177,7 @@ private Map> getPreservedOrderdAceMap( if (aceYamlList == null) { return aceMap; } + Session session = null; try { if (repository != null) { @@ -212,20 +188,7 @@ private Map> getPreservedOrderdAceMap( final String principalName = currentPrincipalAceMap.keySet() .iterator().next(); - final Matcher matcher = forLoopPattern.matcher(principalName); - if (matcher.find()) { - LOG.info("Principal name {} matches FOR loop pattern. Unrolling {}", principalName, - currentPrincipalAceMap.get(principalName)); - final List aces = unrollAceForLoop(principalName, currentPrincipalAceMap.get(principalName), - new HashMap()); - for (final AceBean ace : aces) { - if (aceMap.get(ace.getPrincipalName()) == null) { - final Set tmpSet = new LinkedHashSet(); - aceMap.put(ace.getPrincipalName(), tmpSet); - } - aceMap.get(ace.getPrincipalName()).add(ace); - } - } else { + final List> aceDefinitions = currentPrincipalAceMap.get(principalName); LOG.info("start reading ACE configuration of authorizable: {}", @@ -270,7 +233,7 @@ private Map> getPreservedOrderdAceMap( aceMap.get(principalName).add(newAceBean); } } - } + } return aceMap; } finally { @@ -280,119 +243,6 @@ private Map> getPreservedOrderdAceMap( } } - protected List unrollAceForLoop(final String forSpec, final List> groups, - final Map substitutions) { - final List beans = new LinkedList(); - final Matcher matcher = forLoopPattern.matcher(forSpec); - if (matcher.find()) { - final String var = matcher.group(1); - final String in = matcher.group(2); - final String[] values = in.split(",\\s+"); - // Looping over values in FOR statement - for (final String value : values) { - // Replace variables in config - final String regex = "\\$\\{" + var + "}"; - // Looping over groups - for (final Map group : groups) { - final String key = group.keySet().iterator().next(); - final Matcher matcher2 = forLoopPattern.matcher(key); - if (matcher2.find()) { - substitutions.put(regex, value); - LOG.info("Detected nested loop {}. Unrolling with {}", key, substitutions); - final List nestedAces = unrollAceForLoop(key, (List>) group.get(key), substitutions); - beans.addAll(nestedAces); - } else { - String principalName = key.replaceAll(regex, value.trim()); - for (final String sub : substitutions.keySet()) { - principalName = principalName.replaceAll(sub, substitutions.get(sub).trim()); - } - final List> aces = (List>) group.get(key); - // Looping over ACEs for group - for (final Map ace : aces) { - final Map unrolledGroup = new HashMap(); - final AceBean newAceBean = new AceBean(); - // Looping over property values and child objects - for (final String key2 : ace.keySet()) { - final Object val = ace.get(key2); - if (val == null) { - unrolledGroup.put(key2, null); - } else if (val instanceof String) { - String newVal = ((String) val).replaceAll(regex, value.trim()); - for (final String sub : substitutions.keySet()) { - newVal = newVal.replaceAll(sub, substitutions.get(sub).trim()); - } - unrolledGroup.put(key2, newVal); - } - } - setupAceBean(principalName, unrolledGroup, newAceBean); - beans.add(newAceBean); - } - } - } - } - } else { - LOG.error("Incorrect for loop syntax: {}", forSpec); - } - return beans; - } - - protected List unrollGroupForLoop(final String forSpec, final List> groups, - final Map substitutions, boolean isGroupSection) { - final List beans = new LinkedList(); - final Matcher matcher = forLoopPattern.matcher(forSpec); - if (matcher.find()) { - final String var = matcher.group(1); - final String in = matcher.group(2); - final String[] values = in.split(",\\s+"); - // Looping over values in FOR statement - for (final String value : values) { - // Replace variables in config - final String regex = "\\$\\{" + var + "}"; - // Looping over groups - for (final Map group : groups) { - final String key = group.keySet().iterator().next(); - final Matcher matcher2 = forLoopPattern.matcher(key); - if (matcher2.find()) { - substitutions.put(regex, value); - LOG.info("Detected nested loop {}. Unrolling with {}", key, substitutions); - final List nestedGroups = unrollGroupForLoop(key, (List>) group.get(key), - substitutions, isGroupSection); - beans.addAll(nestedGroups); - } else { - String principalName = key.replaceAll(regex, value.trim()); - for (final String sub : substitutions.keySet()) { - principalName = principalName.replaceAll(sub, substitutions.get(sub).trim()); - } - final List> groupMaps = (List>) group.get(key); - // Looping over ACEs for group - for (final Map props : groupMaps) { - final Map unrolledGroup = new HashMap(); - final AuthorizableConfigBean newGroupBean = new AuthorizableConfigBean(); - // Looping over property values and child objects - for (final String key2 : props.keySet()) { - final Object val = props.get(key2); - if (val == null) { - unrolledGroup.put(key2, null); - } else if (val instanceof String) { - String newVal = ((String) val).replaceAll(regex, value.trim()); - for (final String sub : substitutions.keySet()) { - newVal = newVal.replaceAll(sub, substitutions.get(sub).trim()); - } - unrolledGroup.put(key2, newVal); - } - } - setupAuthorizableBean(newGroupBean, unrolledGroup, principalName, isGroupSection); - beans.add(newGroupBean); - } - } - } - } - } else { - LOG.error("Incorrect for loop syntax: {}", forSpec); - } - return beans; - } - private void handleWildcards(final Session session, final Map> aceMap, final String principal, final AceBean tmpAclBean) throws InvalidQueryException, diff --git a/accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/configreader/YamlConfigurationMerger.java b/accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/configreader/YamlConfigurationMerger.java index 4fdc56ad..edcc3cbb 100644 --- a/accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/configreader/YamlConfigurationMerger.java +++ b/accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/configreader/YamlConfigurationMerger.java @@ -18,6 +18,9 @@ import javax.jcr.RepositoryException; +import org.apache.felix.scr.annotations.Component; +import org.apache.felix.scr.annotations.Reference; +import org.apache.felix.scr.annotations.Service; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.yaml.snakeyaml.Yaml; @@ -34,10 +37,15 @@ import biz.netcentric.cq.tools.actool.validators.impl.AuthorizableMemberGroupsValidator; import biz.netcentric.cq.tools.actool.validators.impl.AuthorizableValidatorImpl; +@Service +@Component public class YamlConfigurationMerger implements ConfigurationMerger { private static final Logger LOG = LoggerFactory.getLogger(YamlConfigurationMerger.class); + @Reference + YamlMacroProcessor yamlMacroProcessor; + @Override public List getMergedConfigurations( final Map newestConfigurations, @@ -63,7 +71,9 @@ public List getMergedConfigurations( history.addMessage(message); final Yaml yaml = new Yaml(); - final List yamlList = (List) yaml.load(entry.getValue()); + List yamlList = (List) yaml.load(entry.getValue()); + + yamlList = yamlMacroProcessor.processMacros(yamlList, history); final Set sectionIdentifiers = new LinkedHashSet(); diff --git a/accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/configreader/YamlMacroChildNodeObjectsProvider.java b/accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/configreader/YamlMacroChildNodeObjectsProvider.java new file mode 100644 index 00000000..11000fc4 --- /dev/null +++ b/accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/configreader/YamlMacroChildNodeObjectsProvider.java @@ -0,0 +1,22 @@ +/* + * (C) Copyright 2015 Netcentric AG. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + */ +package biz.netcentric.cq.tools.actool.configreader; + +import java.util.List; + +import biz.netcentric.cq.tools.actool.installationhistory.AcInstallationHistoryPojo; + +/** Provides the objects for . + * + * @author ghenzler */ +public interface YamlMacroChildNodeObjectsProvider { + + List getValuesForPath(String pathOfChildrenOfClause, AcInstallationHistoryPojo history); + +} \ No newline at end of file diff --git a/accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/configreader/YamlMacroChildNodeObjectsProviderImpl.java b/accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/configreader/YamlMacroChildNodeObjectsProviderImpl.java new file mode 100644 index 00000000..6c67ebb7 --- /dev/null +++ b/accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/configreader/YamlMacroChildNodeObjectsProviderImpl.java @@ -0,0 +1,131 @@ +/* + * (C) Copyright 2015 Netcentric AG. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + */ +package biz.netcentric.cq.tools.actool.configreader; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.jcr.Node; +import javax.jcr.NodeIterator; +import javax.jcr.PathNotFoundException; +import javax.jcr.Property; +import javax.jcr.PropertyIterator; +import javax.jcr.RepositoryException; +import javax.jcr.Session; +import javax.jcr.Value; +import javax.jcr.ValueFormatException; + +import org.apache.felix.scr.annotations.Component; +import org.apache.felix.scr.annotations.Reference; +import org.apache.felix.scr.annotations.Service; +import org.apache.sling.jcr.api.SlingRepository; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.day.cq.commons.jcr.JcrConstants; + +import biz.netcentric.cq.tools.actool.installationhistory.AcInstallationHistoryPojo; + +@Service +@Component +public class YamlMacroChildNodeObjectsProviderImpl implements YamlMacroChildNodeObjectsProvider { + + private static final Logger LOG = LoggerFactory.getLogger(YamlMacroChildNodeObjectsProviderImpl.class); + + @Reference + private SlingRepository repository; + + @Override + public List getValuesForPath(String pathOfChildrenOfClause, AcInstallationHistoryPojo history) { + + LOG.info("FOR Loop: Getting children for " + pathOfChildrenOfClause); + + List results = new ArrayList(); + + Session session = null; + try { + session = repository.loginAdministrative(null); + + + Node node = session.getNode(pathOfChildrenOfClause); + + NodeIterator childrenIt = node.getNodes(); + while(childrenIt.hasNext()) { + Node childNode = (Node) childrenIt.next(); + + if (childNode.getName().startsWith("jcr:") + || childNode.getName().startsWith("rep:") + || childNode.getName().startsWith("oak:")) { + continue; + } + + Map childNodeObjectForEl = new HashMap(); + + childNodeObjectForEl.put("name", childNode.getName()); + childNodeObjectForEl.put("path", childNode.getPath()); + childNodeObjectForEl.put("primaryType", childNode.getPrimaryNodeType().toString()); + + try { + Node jcrContentNode = childNode.getNode(JcrConstants.JCR_CONTENT); + + PropertyIterator propertiesIt = jcrContentNode.getProperties(); + while (propertiesIt.hasNext()) { + Property prop = (Property) propertiesIt.next(); + Map jcrContentSubNode = new HashMap(); + if (prop.isMultiple()) { + jcrContentSubNode.put(prop.getName(), valuesToStringArr(prop.getValues())); + } else { + String strVal = prop.getValue().getString(); + jcrContentSubNode.put(prop.getName(), strVal); + + // add the title also to root map to simplify access + if (JcrConstants.JCR_TITLE.equals(prop.getName())) { + childNodeObjectForEl.put("title", strVal); + } + } + + childNodeObjectForEl.put(JcrConstants.JCR_CONTENT, jcrContentSubNode); + } + + } catch (PathNotFoundException epnf) { + LOG.debug("Node " + node.getPath() + " does not have a jcr content node (legitimate for folders)"); + } + + + results.add(childNodeObjectForEl); + } + + } catch (PathNotFoundException e) { + history.addWarning( + "Path " + pathOfChildrenOfClause + " as configured for source for FOR loop does not exist! (statement skipped)"); + + } catch (RepositoryException e) { + throw new IllegalStateException("Could not get children of path " + pathOfChildrenOfClause + ": " + e, e); + } finally { + if (session != null && session.isLive()) { + session.logout(); + } + } + + history.addMessage("Loop for children of " + pathOfChildrenOfClause + " evaluates to " + results.size() + " children"); + + return results; + } + + private String[] valuesToStringArr(Value[] values) throws ValueFormatException, RepositoryException { + String[] strVals = new String[values.length]; + for (int i = 0; i < values.length; i++) { + strVals[i] = values[i].getString(); + } + return strVals; + } + +} diff --git a/accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/configreader/YamlMacroElEvaluator.java b/accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/configreader/YamlMacroElEvaluator.java new file mode 100644 index 00000000..c2302472 --- /dev/null +++ b/accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/configreader/YamlMacroElEvaluator.java @@ -0,0 +1,206 @@ +/* + * (C) Copyright 2015 Netcentric AG. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + */ +package biz.netcentric.cq.tools.actool.configreader; + +import java.beans.FeatureDescriptor; +import java.lang.reflect.Method; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +import javax.el.ArrayELResolver; +import javax.el.BeanELResolver; +import javax.el.CompositeELResolver; +import javax.el.ELContext; +import javax.el.ELResolver; +import javax.el.ExpressionFactory; +import javax.el.FunctionMapper; +import javax.el.ListELResolver; +import javax.el.MapELResolver; +import javax.el.ValueExpression; +import javax.el.VariableMapper; + +import org.apache.commons.lang.ArrayUtils; +import org.apache.commons.lang.StringUtils; + +/** Evaluates expressions that may contain variables from for loops. + * + * Not an OSGi Service as it carries state and is not multi-threading safe. + * + * @author ghenzler */ +public class YamlMacroElEvaluator { + + private ExpressionFactory expressionFactory; + private ELContext context; + + private Map vars = new HashMap(); + + public YamlMacroElEvaluator() { + + try { + Class expressionFactoryClass = getClass().getClassLoader().loadClass("org.apache.el.ExpressionFactoryImpl"); + expressionFactory = (ExpressionFactory) expressionFactoryClass.newInstance(); + } catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) { + throw new IllegalStateException("Could not init EL: " + e); + } + + final VariableMapper variableMapper = new ElVariableMapper(); + final ElFunctionMapper functionMapper = new ElFunctionMapper(); + final CompositeELResolver compositeELResolver = new CompositeELResolver(); + + compositeELResolver.add(new BaseELResolver()); + compositeELResolver.add(new ArrayELResolver()); + compositeELResolver.add(new ListELResolver()); + compositeELResolver.add(new BeanELResolver()); + compositeELResolver.add(new MapELResolver()); + context = new ELContext() { + @Override + public ELResolver getELResolver() { + return compositeELResolver; + } + + @Override + public FunctionMapper getFunctionMapper() { + return functionMapper; + } + + @Override + public VariableMapper getVariableMapper() { + return variableMapper; + } + }; + + } + + public T evaluateEl(String el, Class expectedResultType, Map variables) { + + vars = variables; + + ValueExpression expression = expressionFactory.createValueExpression(context, el, expectedResultType); + T value = (T) expression.getValue(context); + return value; + } + + class ElFunctionMapper extends FunctionMapper { + + private Map functionMap = new HashMap(); + + public ElFunctionMapper() { + + try { + Method[] exportedMethods = new Method[] { + + StringUtils.class.getMethod("split", new Class[] { String.class, String.class }), + StringUtils.class.getMethod("join", new Class[] { Object[].class, String.class }), + ArrayUtils.class.getMethod("subarray", new Class[] { Object[].class, int.class, int.class }), + + StringUtils.class.getMethod("upperCase", new Class[] { String.class }), + StringUtils.class.getMethod("lowerCase", new Class[] { String.class }), + StringUtils.class.getMethod("substringAfter", new Class[] { String.class, String.class }), + StringUtils.class.getMethod("substringBefore", new Class[] { String.class, String.class }), + StringUtils.class.getMethod("substringAfterLast", new Class[] { String.class, String.class }), + StringUtils.class.getMethod("substringBeforeLast", new Class[] { String.class, String.class }), + StringUtils.class.getMethod("contains", new Class[] { String.class, String.class }), + StringUtils.class.getMethod("endsWith", new Class[] { String.class, String.class }), + StringUtils.class.getMethod("startsWith", new Class[] { String.class, String.class }) + }; + for (Method method : exportedMethods) { + functionMap.put(method.getName(), method); + } + + } catch (NoSuchMethodException e) { + throw new IllegalStateException("Class StringUtils/ArrayUtils is missing expected methods", e); + } + + } + + @Override + public Method resolveFunction(String prefix, String localName) { + String key = (StringUtils.isNotBlank(prefix) ? prefix + ":" : "") + localName; + return functionMap.get(key); + } + + } + + class ElVariableMapper extends VariableMapper { + + @Override + public ValueExpression resolveVariable(String paramString) { + Object value = vars.get(paramString); + return value != null ? expressionFactory.createValueExpression(value, value.getClass()) : null; + } + + @Override + public ValueExpression setVariable(String paramString, ValueExpression paramValueExpression) { + throw new UnsupportedOperationException(); + } + + } + + /** extra base resolver needed to allow to put maps on root level, see + * http://illegalargumentexception.blogspot.com.es/2008/04/java-using-el-outside-j2ee.html */ + class BaseELResolver extends ELResolver { + + private ELResolver delegate = new MapELResolver(); + + public BaseELResolver() { + } + + @Override + public Object getValue(ELContext context, Object base, Object property) { + if (base == null) { + base = vars; + } + return delegate.getValue(context, base, property); + } + + @Override + public Class getCommonPropertyType(ELContext context, Object base) { + if (base == null) { + base = vars; + } + return delegate.getCommonPropertyType(context, base); + } + + @Override + public Iterator getFeatureDescriptors(ELContext context, + Object base) { + if (base == null) { + base = vars; + } + return delegate.getFeatureDescriptors(context, base); + } + + @Override + public Class getType(ELContext context, Object base, Object property) { + if (base == null) { + base = vars; + } + return delegate.getType(context, base, property); + } + + @Override + public boolean isReadOnly(ELContext context, Object base, Object property) { + if (base == null) { + base = vars; + } + return delegate.isReadOnly(context, base, property); + } + + @Override + public void setValue(ELContext context, Object base, Object property, Object value) { + if (base == null) { + base = vars; + } + delegate.setValue(context, base, property, value); + } + + } + +} diff --git a/accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/configreader/YamlMacroProcessor.java b/accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/configreader/YamlMacroProcessor.java new file mode 100644 index 00000000..fa96c3fe --- /dev/null +++ b/accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/configreader/YamlMacroProcessor.java @@ -0,0 +1,23 @@ +/* + * (C) Copyright 2015 Netcentric AG. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + */ +package biz.netcentric.cq.tools.actool.configreader; + +import java.util.LinkedHashMap; +import java.util.List; + +import biz.netcentric.cq.tools.actool.installationhistory.AcInstallationHistoryPojo; + +/** Processes FOR and IF statements in yaml files. + * + * @author ghenzler */ +public interface YamlMacroProcessor { + + List processMacros(List yamlList, AcInstallationHistoryPojo history); + +} \ No newline at end of file diff --git a/accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/configreader/YamlMacroProcessorImpl.java b/accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/configreader/YamlMacroProcessorImpl.java new file mode 100644 index 00000000..ae44b700 --- /dev/null +++ b/accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/configreader/YamlMacroProcessorImpl.java @@ -0,0 +1,198 @@ +/* + * (C) Copyright 2015 Netcentric AG. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + */ +package biz.netcentric.cq.tools.actool.configreader; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.apache.commons.lang.StringUtils; +import org.apache.felix.scr.annotations.Component; +import org.apache.felix.scr.annotations.Reference; +import org.apache.felix.scr.annotations.Service; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import biz.netcentric.cq.tools.actool.installationhistory.AcInstallationHistoryPojo; + +@Service +@Component +public class YamlMacroProcessorImpl implements YamlMacroProcessor { + + private static final Logger LOG = LoggerFactory.getLogger(YamlMacroProcessorImpl.class); + + private final Pattern forLoopPattern = Pattern.compile("for +(\\w+) +in +(?:\\[([,/\\s\\w\\-]+)\\]|children +of +([^\\s]+))", + Pattern.CASE_INSENSITIVE); + private final Pattern ifPattern = Pattern.compile("if +([^\\s]+)", Pattern.CASE_INSENSITIVE); + + YamlMacroElEvaluator elEvaluator = new YamlMacroElEvaluator(); + + @Reference + YamlMacroChildNodeObjectsProvider yamlMacroChildNodeObjectsProvider; + + @Override + public List processMacros(List yamlList, AcInstallationHistoryPojo history) { + return (List) transform(yamlList, history); + } + + private Object transform(Object o, AcInstallationHistoryPojo history) { + return transform(o, new HashMap(), history); + } + + private Object transform(Object o, Map variables, AcInstallationHistoryPojo history) { + if (o == null) { + return null; + } else if (o instanceof String) { + String str = (String) o; + + String result = elEvaluator.evaluateEl(str, String.class, variables); + return result; + + } else if (o instanceof List) { + List list = (List) o; + List transformedList = new LinkedList(); + for (Object val : list) { + Object transformedObject = transform(val, variables, history); + addToListWithPotentialUnfolding(transformedList, transformedObject); + } + return transformedList; + } else if (o instanceof Map) { + Map map = (Map) o; + Map resultMap = new LinkedHashMap(); + for (Object key : map.keySet()) { + Object objVal = map.get(key); + + Matcher forMatcher = forLoopPattern.matcher(key.toString()); + if (forMatcher.matches()) { + // map is skipped and value returned directly + return evaluateForStatement(variables, objVal, forMatcher, history); + } + + Matcher ifMatcher = ifPattern.matcher(key.toString()); + if (ifMatcher.matches()) { + // map is skipped and value returned directly + return evaluateIfStatement(variables, objVal, ifMatcher, history); + } + + // default: transform both key and value + Object transformedKey = transform(key, variables, history); + Object transformedVal = transform(objVal, variables, history); + resultMap.put(transformedKey, transformedVal); + + } + return resultMap; + } else { + throw new IllegalStateException("Unexpected class " + o.getClass() + " in object structure produced by yaml: " + o); + + } + } + + private Object evaluateForStatement(Map variables, Object objVal, Matcher forMatcher, + AcInstallationHistoryPojo history) { + String varName = StringUtils.trim(forMatcher.group(1)); + String valueOfInClause = StringUtils.trim(forMatcher.group(2)); + String pathOfChildrenOfClause = StringUtils.trim(forMatcher.group(3)); + // allow variables in root path also + if (StringUtils.isNotBlank(pathOfChildrenOfClause)) { + pathOfChildrenOfClause = elEvaluator.evaluateEl(pathOfChildrenOfClause, String.class, variables); + } + + final List iterationValues = valueOfInClause != null ? Arrays.asList(valueOfInClause.split("\\s*,\\s*")) + : yamlMacroChildNodeObjectsProvider.getValuesForPath(pathOfChildrenOfClause, history); + + List toBeUnfoldedList = unfoldLoop(variables, objVal, varName, iterationValues, history); + + return toBeUnfoldedList; + } + + private Object evaluateIfStatement(Map variables, Object objVal, Matcher ifMatcher, + AcInstallationHistoryPojo history) { + String condition = ifMatcher.group(1).trim(); + + boolean expressionIsTrue = elEvaluator.evaluateEl(condition, Boolean.class, variables); + + List toBeUnfoldedList = unfoldIf(variables, objVal, expressionIsTrue, history); + + return toBeUnfoldedList; + } + + private void addToListWithPotentialUnfolding(List transformedList, Object transformedObject) { + if (transformedObject instanceof ToBeUnfoldedList) { + // add entries individually (for for loops) + ToBeUnfoldedList toBeUnfoldedList = (ToBeUnfoldedList) transformedObject; + for (Object object : toBeUnfoldedList) { + transformedList.add(object); + } + } else { + // add transformed object as is + transformedList.add(transformedObject); + } + } + + private List unfoldLoop(Map variables, Object val, String varName, List varValues, + AcInstallationHistoryPojo history) { + List resultList = new ToBeUnfoldedList(); + + for (Object varValue : varValues) { + Map variablesAtThisScope = new HashMap(variables); + variablesAtThisScope.put(varName, varValue); + unfold(val, resultList, variablesAtThisScope, history); + + } + return resultList; + } + + private List unfoldIf(Map variables, Object val, boolean expressionIsTrue, + AcInstallationHistoryPojo history) { + List resultList = new ToBeUnfoldedList(); + if (expressionIsTrue) { + unfold(val, resultList, variables, history); + } // otherwise return empty list + + return resultList; + } + + private void unfold(Object val, List resultList, Map variablesAtThisScope, + AcInstallationHistoryPojo history) { + if (val instanceof List) { + List origList = (List) val; + for (Object origListItem : origList) { + Object transformedListItem = transform(origListItem, variablesAtThisScope, history); + addToListWithPotentialUnfolding(resultList, transformedListItem); + } + } else { + Object transformedListItem = transform(val, variablesAtThisScope, history); + addToListWithPotentialUnfolding(resultList, transformedListItem); + } + } + + + // marker class + private class ToBeUnfoldedList extends LinkedList { + + } + + public static void main(String[] args) throws Exception { + Map userMap = new HashMap(); + userMap.put("x", new Integer(123)); + userMap.put("y", new Integer(456)); + userMap.put("TEST", "a long test value"); + + String expr = "x= ---- ${upperCase(splitByWholeSeparator(TEST,'long')[1])}"; + String val = new YamlMacroElEvaluator().evaluateEl(expr, String.class, userMap); + System.out.println("the value for " + expr + " =>> " + val); + + } + +} diff --git a/accesscontroltool-bundle/src/test/java/biz/netcentric/cq/tools/actool/configreader/YamlConfigReaderTest.java b/accesscontroltool-bundle/src/test/java/biz/netcentric/cq/tools/actool/configreader/YamlConfigReaderTest.java index b3dd103b..c895dea0 100644 --- a/accesscontroltool-bundle/src/test/java/biz/netcentric/cq/tools/actool/configreader/YamlConfigReaderTest.java +++ b/accesscontroltool-bundle/src/test/java/biz/netcentric/cq/tools/actool/configreader/YamlConfigReaderTest.java @@ -11,15 +11,12 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; import java.io.IOException; import java.io.InputStream; import java.io.StringWriter; -import java.util.HashMap; import java.util.Iterator; import java.util.LinkedHashMap; -import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; @@ -32,63 +29,12 @@ import org.yaml.snakeyaml.Yaml; import biz.netcentric.cq.tools.actool.authorizableutils.AuthorizableConfigBean; -import biz.netcentric.cq.tools.actool.configreader.YamlConfigReader; import biz.netcentric.cq.tools.actool.helper.AceBean; import biz.netcentric.cq.tools.actool.validators.exceptions.AcConfigBeanValidationException; import biz.netcentric.cq.tools.actool.validators.impl.AceBeanValidatorImpl; public class YamlConfigReaderTest { - @Test - public void testLoop() throws IOException, AcConfigBeanValidationException, RepositoryException { - final YamlConfigReader yamlConfigReader = new YamlConfigReader(); - final List yamlList = getYamlList("test-loop.yaml"); - final Map> groups = yamlConfigReader.getGroupConfigurationBeans(yamlList, null); - final Map> aces = yamlConfigReader.getAceConfigurationBeans(yamlList, groups.keySet(), null); - assertEquals("Number of ACEs", 5, aces.size()); - final Set group1 = aces.get("content-BRAND-MKT1-reader"); - assertEquals("Number of ACEs for groupA", 1, group1.size()); - final Set group2 = aces.get("content-BRAND-MKT2-writer"); - assertEquals("Number of ACEs for groupB", 2, group2.size()); - } - - /** - * @see https://github.com/Netcentric/accesscontroltool/issues/14 */ - @Test - public void testLoopWithHyphen() throws IOException, AcConfigBeanValidationException, RepositoryException { - final YamlConfigReader yamlConfigReader = new YamlConfigReader(); - final List yamlList = getYamlList("test-loop-with-hyphen.yaml"); - final Map> groups = yamlConfigReader.getGroupConfigurationBeans(yamlList, null); - final Map> aces = yamlConfigReader.getAceConfigurationBeans(yamlList, groups.keySet(), null); - assertEquals("Number of ACEs", 5, aces.size()); - final Set group1 = aces.get("content-BRAND-MKT-1-reader"); - assertEquals("Number of ACEs for groupA", 1, group1.size()); - final Set group2 = aces.get("content-BRAND-MKT-2-writer"); - assertEquals("Number of ACEs for groupB", 2, group2.size()); - } - - @Test - public void testNestedLoop() throws IOException, AcConfigBeanValidationException, RepositoryException { - final YamlConfigReader yamlConfigReader = new YamlConfigReader(); - final List yamlList = getYamlList("test-nested-loops.yaml"); - final Map> groups = yamlConfigReader.getGroupConfigurationBeans(yamlList, null); - final Map> aces = yamlConfigReader.getAceConfigurationBeans(yamlList, groups.keySet(), null); - assertEquals("Number of ACEs", 12, aces.size()); - assertTrue(aces.containsKey("content-BRAND1-reader")); - assertTrue(aces.containsKey("content-BRAND1-writer")); - assertTrue(aces.containsKey("content-BRAND2-reader")); - assertTrue(aces.containsKey("content-BRAND2-writer")); - assertTrue(aces.containsKey("content-BRAND1-MKT1-reader")); - assertTrue(aces.containsKey("content-BRAND1-MKT1-writer")); - assertTrue(aces.containsKey("content-BRAND2-MKT1-reader")); - assertTrue(aces.containsKey("content-BRAND2-MKT1-writer")); - assertTrue(aces.containsKey("content-BRAND1-MKT2-reader")); - assertTrue(aces.containsKey("content-BRAND1-MKT2-writer")); - assertTrue(aces.containsKey("content-BRAND2-MKT2-reader")); - assertTrue(aces.containsKey("content-BRAND2-MKT2-writer")); - final AceBean b1m1r = aces.get("content-BRAND1-MKT1-reader").iterator().next(); - assertEquals("JCR path", "/content/BRAND1/MKT1", b1m1r.getJcrPath()); - } @Test public void testNullActions() throws IOException, AcConfigBeanValidationException, RepositoryException { @@ -113,75 +59,6 @@ public void testNoActions() throws IOException, AcConfigBeanValidationException, assertEquals("Number of actions", 0, ace.getActions().length); } - @Test - public void testGroupLoop() throws IOException, AcConfigBeanValidationException, RepositoryException { - final YamlConfigReader yamlConfigReader = new YamlConfigReader(); - final List yamlList = getYamlList("test-loop.yaml"); - final Map> groups = yamlConfigReader.getGroupConfigurationBeans(yamlList, null); - assertEquals("Number of groups", 7, groups.size()); - assertEquals("Path of group", "/home/groups/BRAND1", groups.get("content-BRAND1-reader").iterator().next().getPath()); - assertEquals("Path of group", "/home/groups/BRAND1", groups.get("content-BRAND1-writer").iterator().next().getPath()); - assertEquals("Path of group", "/home/groups/BRAND2", groups.get("content-BRAND2-reader").iterator().next().getPath()); - assertEquals("Path of group", "/home/groups/BRAND2", groups.get("content-BRAND2-writer").iterator().next().getPath()); - assertEquals("Path of group", "/home/groups/BRAND3", groups.get("content-BRAND3-reader").iterator().next().getPath()); - assertEquals("Path of group", "/home/groups/BRAND3", groups.get("content-BRAND3-writer").iterator().next().getPath()); - } - - @Test - public void testNestedGroupLoop() throws IOException, AcConfigBeanValidationException, RepositoryException { - final YamlConfigReader yamlConfigReader = new YamlConfigReader(); - final List yamlList = getYamlList("test-nested-loops.yaml"); - final Map> groups = yamlConfigReader.getGroupConfigurationBeans(yamlList, null); - assertEquals("Number of groups", 13, groups.size()); - assertEquals("Path of group", "/home/groups/BRAND1", groups.get("content-BRAND1-reader").iterator().next().getPath()); - assertEquals("Path of group", "/home/groups/BRAND1/MKT1", groups.get("content-BRAND1-MKT1-writer").iterator().next().getPath()); - } - - @Test - public void testAceForLoopParsing() { - final String forStmt = "for brand IN [ BRAND1, BRAND2, BRAND3 ]"; - final YamlConfigReader yamlConfigReader = new YamlConfigReader(); - final List> groups = new LinkedList>(); - final Map> reader = new HashMap>(); - final List> readerAces = new LinkedList>(); - reader.put("content-${brand}-reader", readerAces); - final Map ace1 = new HashMap(); - ace1.put("path", "/content/${brand}"); - readerAces.add(ace1); - final Map ace2 = new HashMap(); - ace2.put("path", "/content/${brand}/foo"); - readerAces.add(ace2); - groups.add(reader); - final List beans = yamlConfigReader.unrollAceForLoop(forStmt, groups, new HashMap()); - assertEquals("Number of loop iterations", 6, beans.size()); - assertEquals("/content/BRAND1", beans.get(0).getJcrPath()); - assertEquals("/content/BRAND1/foo", beans.get(1).getJcrPath()); - assertEquals("/content/BRAND2", beans.get(2).getJcrPath()); - assertEquals("/content/BRAND2/foo", beans.get(3).getJcrPath()); - assertEquals("/content/BRAND3", beans.get(4).getJcrPath()); - assertEquals("/content/BRAND3/foo", beans.get(5).getJcrPath()); - } - - @Test - public void testGroupForLoopParsing() { - final String forStmt = "for brand IN [ BRAND1, BRAND2, BRAND3 ]"; - final YamlConfigReader yamlConfigReader = new YamlConfigReader(); - final List> groups = new LinkedList>(); - final Map> group = new HashMap>(); - final List> groupMaps = new LinkedList>(); - group.put("content-${brand}-reader", groupMaps); - final Map props = new HashMap(); - props.put("path", "/home/groups/${brand}"); - groupMaps.add(props); - groups.add(group); - final List beans = yamlConfigReader - .unrollGroupForLoop(forStmt, groups, new HashMap(), true); - assertEquals("Number of groups", 3, beans.size()); - assertEquals("/home/groups/BRAND1", beans.get(0).getPath()); - assertEquals("/home/groups/BRAND2", beans.get(1).getPath()); - assertEquals("/home/groups/BRAND3", beans.get(2).getPath()); - } - @Test public void testMultipleAcesSamePath() throws IOException, AcConfigBeanValidationException, RepositoryException { final YamlConfigReader yamlConfigReader = new YamlConfigReader(); @@ -219,7 +96,7 @@ public void testOptionalSections() throws Exception { assertEquals("Number of ACEs", 1, acls.get("groupA").size()); } - /** Test support for rep:userManagerment privilege name */ + /** Test support for rep:userManagement privilege name */ @Test @Ignore public void testUserManagementPrivilege() throws IOException, AcConfigBeanValidationException, RepositoryException { @@ -244,12 +121,12 @@ public void testMemberGroups() throws IOException, AcConfigBeanValidationExcepti assertEquals("groupA", groups.get("groupB").iterator().next().getMembersStringFromConfig()); } - private List getYamlList(final String filename) throws IOException { + static List getYamlList(final String filename) throws IOException { final String configString = getTestConfigAsString(filename); final Yaml yaml = new Yaml(); - final List yamlList = (List) yaml - .load(configString); + List yamlList = (List) yaml.load(configString); + return yamlList; } diff --git a/accesscontroltool-bundle/src/test/java/biz/netcentric/cq/tools/actool/configreader/YamlConfigurationMergerTest.java b/accesscontroltool-bundle/src/test/java/biz/netcentric/cq/tools/actool/configreader/YamlConfigurationMergerTest.java index 270f1bef..824fa670 100644 --- a/accesscontroltool-bundle/src/test/java/biz/netcentric/cq/tools/actool/configreader/YamlConfigurationMergerTest.java +++ b/accesscontroltool-bundle/src/test/java/biz/netcentric/cq/tools/actool/configreader/YamlConfigurationMergerTest.java @@ -1,3 +1,11 @@ +/* + * (C) Copyright 2015 Netcentric AG. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + */ package biz.netcentric.cq.tools.actool.configreader; import static org.junit.Assert.assertEquals; @@ -11,13 +19,10 @@ import javax.jcr.RepositoryException; +import org.junit.Before; import org.junit.Test; import biz.netcentric.cq.tools.actool.authorizableutils.AuthorizableConfigBean; -import biz.netcentric.cq.tools.actool.configreader.ConfigReader; -import biz.netcentric.cq.tools.actool.configreader.ConfigurationMerger; -import biz.netcentric.cq.tools.actool.configreader.YamlConfigReader; -import biz.netcentric.cq.tools.actool.configreader.YamlConfigurationMerger; import biz.netcentric.cq.tools.actool.installationhistory.AcInstallationHistoryPojo; import biz.netcentric.cq.tools.actool.validators.exceptions.AcConfigBeanValidationException; @@ -26,11 +31,18 @@ * @author Roland Gruber */ public class YamlConfigurationMergerTest { + private YamlConfigurationMerger merger; + + @Before + public void setup() { + merger = new YamlConfigurationMerger(); + merger.yamlMacroProcessor = new YamlMacroProcessorImpl(); + } + @Test public void testMemberGroups() throws IOException, RepositoryException, AcConfigBeanValidationException { final String config = YamlConfigReaderTest.getTestConfigAsString("test-membergroups.yaml"); final ConfigReader reader = new YamlConfigReader(); - final ConfigurationMerger merger = new YamlConfigurationMerger(); final Map configs = new HashMap(); configs.put("/etc/config", config); final List results = merger.getMergedConfigurations(configs, mock(AcInstallationHistoryPojo.class), reader); diff --git a/accesscontroltool-bundle/src/test/java/biz/netcentric/cq/tools/actool/configreader/YamlMacroProcessorTest.java b/accesscontroltool-bundle/src/test/java/biz/netcentric/cq/tools/actool/configreader/YamlMacroProcessorTest.java new file mode 100644 index 00000000..c96cc2ae --- /dev/null +++ b/accesscontroltool-bundle/src/test/java/biz/netcentric/cq/tools/actool/configreader/YamlMacroProcessorTest.java @@ -0,0 +1,242 @@ +/* + * (C) Copyright 2015 Netcentric AG. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + */ +package biz.netcentric.cq.tools.actool.configreader; + +import static biz.netcentric.cq.tools.actool.configreader.YamlConfigReaderTest.getYamlList; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.doReturn; +import static org.mockito.MockitoAnnotations.initMocks; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import javax.jcr.RepositoryException; + +import org.junit.Before; +import org.junit.Test; +import org.mockito.InjectMocks; +import org.mockito.Mock; + +import biz.netcentric.cq.tools.actool.authorizableutils.AuthorizableConfigBean; +import biz.netcentric.cq.tools.actool.helper.AceBean; +import biz.netcentric.cq.tools.actool.installationhistory.AcInstallationHistoryPojo; +import biz.netcentric.cq.tools.actool.validators.exceptions.AcConfigBeanValidationException; + +public class YamlMacroProcessorTest { + + @Mock + YamlMacroChildNodeObjectsProviderImpl yamlMacroChildNodeObjectsProvider; + + @Mock + AcInstallationHistoryPojo acInstallationHistoryPojo; + + @InjectMocks + YamlMacroProcessorImpl yamlMacroProcessor = new YamlMacroProcessorImpl(); + + @Before + public void setup() { + initMocks(this); + } + + @Test + public void testGroupLoop() throws IOException, AcConfigBeanValidationException, RepositoryException { + + List yamlList = getYamlList("test-loop.yaml"); + + yamlList = yamlMacroProcessor.processMacros(yamlList, acInstallationHistoryPojo); + + Map> groups = readGroupConfigs(yamlList); + assertEquals("Number of groups", 10, groups.size()); + assertEquals("Path of group", "/home/groups/BRAND1", groups.get("content-BRAND1-reader").iterator().next().getPath()); + assertEquals("Path of group", "/home/groups/BRAND1", groups.get("content-BRAND1-writer").iterator().next().getPath()); + assertEquals("Path of group", "/home/groups/BRAND2", groups.get("content-BRAND2-reader").iterator().next().getPath()); + assertEquals("Path of group", "/home/groups/BRAND2", groups.get("content-BRAND2-writer").iterator().next().getPath()); + assertEquals("Path of group", "/home/groups/BRAND3", groups.get("content-BRAND3-reader").iterator().next().getPath()); + assertEquals("Path of group", "/home/groups/BRAND3", groups.get("content-BRAND3-writer").iterator().next().getPath()); + + assertEquals("Path of group", "/home/groups/VAR1", groups.get("content-VAR1").iterator().next().getPath()); + assertEquals("Path of group", "/home/groups/VAR2", groups.get("content-VAR2").iterator().next().getPath()); + assertEquals("Path of group", "/home/groups/VAR3", groups.get("content-VAR3").iterator().next().getPath()); + + } + + @Test + public void testNestedGroupLoop() throws IOException, AcConfigBeanValidationException, RepositoryException { + final YamlConfigReader yamlConfigReader = new YamlConfigReader(); + List yamlList = getYamlList("test-nested-loops.yaml"); + + yamlList = yamlMacroProcessor.processMacros(yamlList, acInstallationHistoryPojo); + + final Map> groups = readGroupConfigs(yamlList); + + assertEquals("Number of groups", 13, groups.size()); + assertEquals("Path of group", "/home/groups/BRAND1", groups.get("content-BRAND1-reader").iterator().next().getPath()); + assertEquals("Path of group", "/home/groups/BRAND1/MKT1", groups.get("content-BRAND1-MKT1-writer").iterator().next().getPath()); + } + + @Test + public void testAceLoop() throws IOException, AcConfigBeanValidationException, RepositoryException { + + List yamlList = getYamlList("test-loop.yaml"); + + yamlList = yamlMacroProcessor.processMacros(yamlList, acInstallationHistoryPojo); + + final Map> aces = readAceConfigs(yamlList); + assertEquals("Number of ACEs", 5, aces.size()); + final Set group1 = aces.get("content-BRAND-MKT1-reader"); + assertEquals("Number of ACEs for groupA", 1, group1.size()); + final Set group2 = aces.get("content-BRAND-MKT2-writer"); + assertEquals("Number of ACEs for groupB", 2, group2.size()); + } + + /** @see https://github.com/Netcentric/accesscontroltool/issues/14 + * */ + @Test + public void testAceLoopWithHyphen() throws IOException, AcConfigBeanValidationException, RepositoryException { + + List yamlList = getYamlList("test-loop-with-hyphen.yaml"); + + yamlList = yamlMacroProcessor.processMacros(yamlList, acInstallationHistoryPojo); + + final Map> aces = readAceConfigs(yamlList); + assertEquals("Number of ACEs", 5, aces.size()); + final Set group1 = aces.get("content-BRAND-MKT-1-reader"); + assertEquals("Number of ACEs for groupA", 1, group1.size()); + final Set group2 = aces.get("content-BRAND-MKT-2-writer"); + assertEquals("Number of ACEs for groupB", 2, group2.size()); + } + + @Test + public void testNestedLoop() throws IOException, AcConfigBeanValidationException, RepositoryException { + + List yamlList = getYamlList("test-nested-loops.yaml"); + + yamlList = yamlMacroProcessor.processMacros(yamlList, acInstallationHistoryPojo); + + final Map> aces = readAceConfigs(yamlList); + assertEquals("Number of ACEs", 12, aces.size()); + assertTrue(aces.containsKey("content-BRAND1-reader")); + assertTrue(aces.containsKey("content-BRAND1-writer")); + assertTrue(aces.containsKey("content-BRAND2-reader")); + assertTrue(aces.containsKey("content-BRAND2-writer")); + assertTrue(aces.containsKey("content-BRAND1-MKT1-reader")); + assertTrue(aces.containsKey("content-BRAND1-MKT1-writer")); + assertTrue(aces.containsKey("content-BRAND2-MKT1-reader")); + assertTrue(aces.containsKey("content-BRAND2-MKT1-writer")); + assertTrue(aces.containsKey("content-BRAND1-MKT2-reader")); + assertTrue(aces.containsKey("content-BRAND1-MKT2-writer")); + assertTrue(aces.containsKey("content-BRAND2-MKT2-reader")); + assertTrue(aces.containsKey("content-BRAND2-MKT2-writer")); + final AceBean b1m1r = aces.get("content-BRAND1-MKT1-reader").iterator().next(); + assertEquals("JCR path", "/content/BRAND1/MKT1", b1m1r.getJcrPath()); + } + + @Test + public void testIf() throws IOException, AcConfigBeanValidationException, RepositoryException { + + List yamlList = getYamlList("test-if.yaml"); + + yamlList = yamlMacroProcessor.processMacros(yamlList, acInstallationHistoryPojo); + + final Map> aces = readAceConfigs(yamlList); + + assertEquals("Number of Groups in ACE Section", 2, aces.size()); + final Set group1 = aces.get("content-reader"); + assertEquals("Number of ACEs for groupA", 1, group1.size()); + final Set group2 = aces.get("content-writer"); + assertEquals("Number of ACEs for groupB", 2, group2.size()); + + final Map> groups = readGroupConfigs(yamlList); + assertEquals("Number of groups", 1, groups.size()); + assertEquals("Path of group", "/home/groups/folder2", groups.get("content-writer").iterator().next().getPath()); + + } + + @Test + public void testLoopChildrenOf() throws IOException, AcConfigBeanValidationException, RepositoryException { + + List yamlList = getYamlList("test-loop-children-of.yaml"); + + String contentLocationChildrenFromYamlFile = "/content/test"; + + doReturn(getExampleValuesForLoopOverChildrenOfPath()).when(yamlMacroChildNodeObjectsProvider) + .getValuesForPath(contentLocationChildrenFromYamlFile, acInstallationHistoryPojo); + + yamlList = yamlMacroProcessor.processMacros(yamlList, acInstallationHistoryPojo); + + // new Yaml().dump(yamlList, new PrintWriter(System.out)); + + final Map> groups = readGroupConfigs(yamlList); + assertEquals(4, groups.size()); + + AuthorizableConfigBean group1 = groups.get("content-node1-reader").iterator().next(); + assertEquals("/home/groups/test", group1.getPath()); + assertEquals("Jcr Content Property in Name val1", group1.getPrincipalName()); + + AuthorizableConfigBean group2 = groups.get("content-node1-writer").iterator().next(); + assertEquals("/home/groups/test", group2.getPath()); + assertEquals("Writer of Node 1", group2.getPrincipalName()); + + } + + private List getExampleValuesForLoopOverChildrenOfPath() { + + List result = new ArrayList(); + Map test1 = new HashMap() { + { + put("path", "/content/test/node1"); + put("name", "node1"); + put("title", "Node 1"); + put("jcr:content", new HashMap() { + { + put("jcr:title", "testJcrTitle"); + put("prop", "val1"); + } + }); + } + }; + result.add(test1); + + Map test2 = new HashMap() { + { + put("path", "/content/test/node2"); + put("name", "node2"); + put("title", "Node 2"); + put("jcr:content", new HashMap() { + { + put("jcr:title", "testJcrTitle"); + put("prop", "val2"); + } + }); + } + }; + result.add(test2); + + return result; + } + + // --- using YamlConfigReader to make assertions easier (the raw yaml structure makes it really hard) + + private Map> readAceConfigs(final List yamlList) + throws RepositoryException, AcConfigBeanValidationException { + Map> groups = readGroupConfigs(yamlList); + return new YamlConfigReader().getAceConfigurationBeans(yamlList, groups.keySet(), null); + } + + private Map> readGroupConfigs(List yamlList) throws AcConfigBeanValidationException { + return new YamlConfigReader().getGroupConfigurationBeans(yamlList, null); + } + +} diff --git a/accesscontroltool-bundle/src/test/java/biz/netcentric/cq/tools/actool/installhook/AcToolInstallHookServiceImplTest.java b/accesscontroltool-bundle/src/test/java/biz/netcentric/cq/tools/actool/installhook/AcToolInstallHookServiceImplTest.java deleted file mode 100644 index 69c278e9..00000000 --- a/accesscontroltool-bundle/src/test/java/biz/netcentric/cq/tools/actool/installhook/AcToolInstallHookServiceImplTest.java +++ /dev/null @@ -1,6 +0,0 @@ -package biz.netcentric.cq.tools.actool.installhook; - - -public class AcToolInstallHookServiceImplTest { - -} diff --git a/accesscontroltool-bundle/src/test/resources/test-if.yaml b/accesscontroltool-bundle/src/test/resources/test-if.yaml new file mode 100644 index 00000000..636fca62 --- /dev/null +++ b/accesscontroltool-bundle/src/test/resources/test-if.yaml @@ -0,0 +1,53 @@ +# +# (C) Copyright 2015 Netcentric AG. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# + +- group_config: + + - if ${false}: + + - content-reader: + + - name: + isMemberOf: + path: /home/groups/folder1 + + - content-writer: + + - name: + isMemberOf: + path: /home/groups/folder2 + + +- ace_config: + + - if ${true}: + + - content-reader: + + - path: /content/BRAND + permission: allow + actions: read,acl_read + privileges: + repGlob: + + + - content-writer: + + - path: /content/test1 + permission: allow + actions: read,acl_read + privileges: + repGlob: + + - path: /content/test2 + permission: allow + actions: read,acl_read + privileges: + repGlob: + \ No newline at end of file diff --git a/accesscontroltool-bundle/src/test/resources/test-loop-children-of.yaml b/accesscontroltool-bundle/src/test/resources/test-loop-children-of.yaml new file mode 100644 index 00000000..dadc0fc6 --- /dev/null +++ b/accesscontroltool-bundle/src/test/resources/test-loop-children-of.yaml @@ -0,0 +1,26 @@ +# +# (C) Copyright 2015 Netcentric AG. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# + +- group_config: + + - FOR childNode IN CHILDREN OF /content/test: + + - content-${childNode.name}-reader: + + - name: Jcr Content Property in Name ${childNode['jcr:content'].prop} + isMemberOf: + path: /home/groups/${ split(childNode.path,'/')[1] } + + - content-${childNode.name}-writer: + + - name: Writer of ${childNode.title} + isMemberOf: + path: /home/groups/${ split(childNode.path,'/')[1] } + + \ No newline at end of file diff --git a/accesscontroltool-bundle/src/test/resources/test-loop.yaml b/accesscontroltool-bundle/src/test/resources/test-loop.yaml index 1050ddf0..628b069e 100644 --- a/accesscontroltool-bundle/src/test/resources/test-loop.yaml +++ b/accesscontroltool-bundle/src/test/resources/test-loop.yaml @@ -28,7 +28,16 @@ - name: isMemberOf: path: /home/groups/${brand} - + + # checking consecutive loops + - for var IN [ VAR1, VAR2, VAR3 ]: + + - content-${var}: + + - name: + isMemberOf: + path: /home/groups/${var} + - ace_config: From ba8bc4cd490bc9d8ebda933a72fb2eb827943028 Mon Sep 17 00:00:00 2001 From: "georg.henzler" Date: Mon, 8 Feb 2016 09:29:59 +0100 Subject: [PATCH 21/26] #58 corrected log4j dep --- accesscontroltool-bundle/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accesscontroltool-bundle/pom.xml b/accesscontroltool-bundle/pom.xml index a793c021..52adfa54 100644 --- a/accesscontroltool-bundle/pom.xml +++ b/accesscontroltool-bundle/pom.xml @@ -146,7 +146,7 @@ org.slf4j slf4j-log4j12 1.7.6 - + test From d6a8f370ab55800c8c5ebc8f6d97741179d96410 Mon Sep 17 00:00:00 2001 From: "georg.henzler" Date: Tue, 9 Feb 2016 18:41:23 +0100 Subject: [PATCH 22/26] Updated version to 1.8.0-SNAPSHOT as #58 is a significant new feature --- accesscontroltool-bundle/pom.xml | 2 +- accesscontroltool-oakindex-package/pom.xml | 2 +- accesscontroltool-package/pom.xml | 2 +- pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/accesscontroltool-bundle/pom.xml b/accesscontroltool-bundle/pom.xml index 52adfa54..98360992 100644 --- a/accesscontroltool-bundle/pom.xml +++ b/accesscontroltool-bundle/pom.xml @@ -11,7 +11,7 @@ biz.netcentric.cq.tools.accesscontroltool accesscontroltool - 1.7.1-SNAPSHOT + 1.8.0-SNAPSHOT diff --git a/accesscontroltool-oakindex-package/pom.xml b/accesscontroltool-oakindex-package/pom.xml index 949df3bd..b6406f34 100644 --- a/accesscontroltool-oakindex-package/pom.xml +++ b/accesscontroltool-oakindex-package/pom.xml @@ -15,7 +15,7 @@ biz.netcentric.cq.tools.accesscontroltool accesscontroltool - 1.7.1-SNAPSHOT + 1.8.0-SNAPSHOT diff --git a/accesscontroltool-package/pom.xml b/accesscontroltool-package/pom.xml index 84935754..40dd0dcf 100644 --- a/accesscontroltool-package/pom.xml +++ b/accesscontroltool-package/pom.xml @@ -15,7 +15,7 @@ biz.netcentric.cq.tools.accesscontroltool accesscontroltool - 1.7.1-SNAPSHOT + 1.8.0-SNAPSHOT diff --git a/pom.xml b/pom.xml index 753a0b5d..b66cdc05 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ biz.netcentric.cq.tools.accesscontroltool accesscontroltool - 1.7.1-SNAPSHOT + 1.8.0-SNAPSHOT pom Access Control Tool - Reactor Project From fd3a58c8fb564c93c7f7345f8fc8cec3c4592d15 Mon Sep 17 00:00:00 2001 From: "georg.henzler" Date: Thu, 11 Feb 2016 23:58:46 +0100 Subject: [PATCH 23/26] updating poms for 1.8.0 branch with snapshot versions --- accesscontroltool-bundle/pom.xml | 2 +- accesscontroltool-package/pom.xml | 2 +- pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/accesscontroltool-bundle/pom.xml b/accesscontroltool-bundle/pom.xml index 98360992..3c71a6b0 100644 --- a/accesscontroltool-bundle/pom.xml +++ b/accesscontroltool-bundle/pom.xml @@ -11,7 +11,7 @@ biz.netcentric.cq.tools.accesscontroltool accesscontroltool - 1.8.0-SNAPSHOT + 1.8.0-rc-SNAPSHOT diff --git a/accesscontroltool-package/pom.xml b/accesscontroltool-package/pom.xml index 40dd0dcf..c38024e7 100644 --- a/accesscontroltool-package/pom.xml +++ b/accesscontroltool-package/pom.xml @@ -15,7 +15,7 @@ biz.netcentric.cq.tools.accesscontroltool accesscontroltool - 1.8.0-SNAPSHOT + 1.8.0-rc-SNAPSHOT diff --git a/pom.xml b/pom.xml index b66cdc05..42de362d 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ biz.netcentric.cq.tools.accesscontroltool accesscontroltool - 1.8.0-SNAPSHOT + 1.8.0-rc-SNAPSHOT pom Access Control Tool - Reactor Project From 7ea12ccc95eba6d6beea6199453e46f86e6340ae Mon Sep 17 00:00:00 2001 From: "georg.henzler" Date: Thu, 11 Feb 2016 23:59:50 +0100 Subject: [PATCH 24/26] updating poms for branch'release/1.8.0' with non-snapshot versions --- accesscontroltool-bundle/pom.xml | 2 +- accesscontroltool-package/pom.xml | 2 +- pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/accesscontroltool-bundle/pom.xml b/accesscontroltool-bundle/pom.xml index 3c71a6b0..d6043c8e 100644 --- a/accesscontroltool-bundle/pom.xml +++ b/accesscontroltool-bundle/pom.xml @@ -11,7 +11,7 @@ biz.netcentric.cq.tools.accesscontroltool accesscontroltool - 1.8.0-rc-SNAPSHOT + 1.8.0 diff --git a/accesscontroltool-package/pom.xml b/accesscontroltool-package/pom.xml index c38024e7..dd473418 100644 --- a/accesscontroltool-package/pom.xml +++ b/accesscontroltool-package/pom.xml @@ -15,7 +15,7 @@ biz.netcentric.cq.tools.accesscontroltool accesscontroltool - 1.8.0-rc-SNAPSHOT + 1.8.0 diff --git a/pom.xml b/pom.xml index 42de362d..6d15b891 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ biz.netcentric.cq.tools.accesscontroltool accesscontroltool - 1.8.0-rc-SNAPSHOT + 1.8.0 pom Access Control Tool - Reactor Project From 2e75ba381862b84208badeb17601136e303c5900 Mon Sep 17 00:00:00 2001 From: "georg.henzler" Date: Fri, 12 Feb 2016 00:04:11 +0100 Subject: [PATCH 25/26] fixed version of oakindex module --- accesscontroltool-oakindex-package/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accesscontroltool-oakindex-package/pom.xml b/accesscontroltool-oakindex-package/pom.xml index b6406f34..baf91137 100644 --- a/accesscontroltool-oakindex-package/pom.xml +++ b/accesscontroltool-oakindex-package/pom.xml @@ -15,7 +15,7 @@ biz.netcentric.cq.tools.accesscontroltool accesscontroltool - 1.8.0-SNAPSHOT + 1.8.0 From 7d37dd3af31a3376dcc0d6d30fe2c6254064c878 Mon Sep 17 00:00:00 2001 From: "georg.henzler" Date: Fri, 12 Feb 2016 00:12:25 +0100 Subject: [PATCH 26/26] updating poms for branch'release/1.8.0' with non-snapshot versions --- accesscontroltool-oakindex-package/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accesscontroltool-oakindex-package/pom.xml b/accesscontroltool-oakindex-package/pom.xml index baf91137..1c048365 100644 --- a/accesscontroltool-oakindex-package/pom.xml +++ b/accesscontroltool-oakindex-package/pom.xml @@ -110,7 +110,7 @@ - +