Skip to content

Commit

Permalink
Merge branch 'release/2.0.10'
Browse files Browse the repository at this point in the history
  • Loading branch information
ghenzler committed Jul 10, 2018
2 parents d217131 + b073273 commit 41a921f
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 9 deletions.
2 changes: 1 addition & 1 deletion accesscontroltool-bundle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>biz.netcentric.cq.tools.accesscontroltool</groupId>
<artifactId>accesscontroltool</artifactId>
<version>2.0.9</version>
<version>2.0.10</version>
</parent>

<!-- ====================================================================== -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.ReferenceCardinality;
import org.apache.felix.scr.annotations.ReferencePolicyOption;
import org.apache.felix.scr.annotations.Service;
import org.apache.jackrabbit.api.security.user.Authorizable;
import org.apache.jackrabbit.api.security.user.AuthorizableExistsException;
Expand Down Expand Up @@ -70,7 +71,7 @@ public class AuthorizableInstallerServiceImpl implements
@Reference(cardinality = ReferenceCardinality.OPTIONAL_UNARY)
ExternalGroupInstallerServiceImpl externalGroupCreatorService;

@Reference
@Reference(cardinality = ReferenceCardinality.OPTIONAL_UNARY, policyOption = ReferencePolicyOption.GREEDY)
CryptoSupport cryptoSupport;

@Override
Expand Down Expand Up @@ -154,6 +155,9 @@ void setUserPassword(final AuthorizableConfigBean authorizableConfigBean,
final User authorizableToInstall) throws RepositoryException, CryptoException {
String password = authorizableConfigBean.getPassword();
if (password.matches("\\{.+}")) {
if (cryptoSupport == null) {
throw new CryptoException("CryptoSupport missing to unprotect password.");
}
password = cryptoSupport.unprotect(password);
}
authorizableToInstall.changePassword(password);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package biz.netcentric.cq.tools.actool.history;

import java.util.Objects;

import org.apache.jackrabbit.vault.fs.api.ProgressTrackerListener;
import org.apache.jackrabbit.vault.packaging.PackageException;

Expand All @@ -9,7 +11,7 @@ public class ProgressTrackerListenerInstallationLogger extends PersistableInstal

public ProgressTrackerListenerInstallationLogger(ProgressTrackerListener listener) {
super();
this.listener = listener;
this.listener = Objects.requireNonNull(listener);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class AcToolInstallHookServiceImpl implements AcToolInstallHookService {
@Override
public PersistableInstallationLogger installYamlFilesFromPackage(Archive archive, Session session, ProgressTrackerListener progressTrackerListener)
throws Exception {
PersistableInstallationLogger history = new ProgressTrackerListenerInstallationLogger(progressTrackerListener);
PersistableInstallationLogger history = progressTrackerListener != null ? new ProgressTrackerListenerInstallationLogger(progressTrackerListener) : new PersistableInstallationLogger();
Map<String, String> configs = configFilesRetriever.getConfigFileContentFromPackage(archive);
history.setCrxPackageName(getArchiveName(archive));
String[] restrictedToPaths = null; // never use path restriction for hook usage for now
Expand Down
2 changes: 1 addition & 1 deletion accesscontroltool-exampleconfig-package/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<parent>
<groupId>biz.netcentric.cq.tools.accesscontroltool</groupId>
<artifactId>accesscontroltool</artifactId>
<version>2.0.9</version>
<version>2.0.10</version>
</parent>

<!-- ====================================================================== -->
Expand Down
2 changes: 1 addition & 1 deletion accesscontroltool-oakindex-package/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<parent>
<groupId>biz.netcentric.cq.tools.accesscontroltool</groupId>
<artifactId>accesscontroltool</artifactId>
<version>2.0.9</version>
<version>2.0.10</version>
</parent>

<!-- ====================================================================== -->
Expand Down
2 changes: 1 addition & 1 deletion accesscontroltool-package/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<parent>
<groupId>biz.netcentric.cq.tools.accesscontroltool</groupId>
<artifactId>accesscontroltool</artifactId>
<version>2.0.9</version>
<version>2.0.10</version>
</parent>

<!-- ====================================================================== -->
Expand Down
16 changes: 15 additions & 1 deletion docs/ApplyConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The following section explain how you can trigger the installation of ACLs.
## Installation Hook

You can automatically install ACEs and authorizables defined in YAML files within a package using the Content Package Install Hook mechanism.
If you use the content-package-maven-plugin enable the installation hook via:
If you use the content-package-maven-plugin for building the package, enable the installation hook via:

```
<plugin>
Expand All @@ -29,6 +29,20 @@ If you use the content-package-maven-plugin enable the installation hook via:
</plugin>
```

If you would rather use the filevault-package-maven-plugin for building the package, enable the installation hook via:

```
<plugin>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>filevault-package-maven-plugin</artifactId>
<configuration>
<properties>
<installhook.actool.class>biz.netcentric.cq.tools.actool.installhook.AcToolInstallHook</installhook.actool.class>
</properties>
</configuration>
</plugin>
```

The `*.yaml` files are installed directly from the package content and respect the [run mode semantics](Configuration.md). Otherwise there is no limitation, so the YAML files will be picked up from anywhere in the package (as long as the parent node does not contain a `.` followed by one or multiple not matching run modes).

Although it is not necessary that the YAML files are covered by the filter rules of the `filter.xml`, this is recommended practice. That way you can see afterwards in the repository which YAML files have been processed. However if you would not let the `filter.xml` cover your YAML files, those files would still be processed by the installation hook.
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<groupId>biz.netcentric.cq.tools.accesscontroltool</groupId>
<artifactId>accesscontroltool</artifactId>
<version>2.0.9</version>
<version>2.0.10</version>
<packaging>pom</packaging>

<name>Access Control Tool - Reactor Project</name>
Expand Down

0 comments on commit 41a921f

Please sign in to comment.