Skip to content

Commit

Permalink
Merge branch 'release/2.1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
ghenzler committed Jul 26, 2018
2 parents 1568ceb + 117ccf0 commit aade8f8
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 15 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.1.0</version>
<version>2.1.1</version>
</parent>

<!-- ====================================================================== -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,18 +152,30 @@ private void installAuthorizableConfigurationBean(final Session session,
}

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);
}
final User authorizableToInstall) throws RepositoryException, AuthorizableCreatorException {
String password = getPassword(authorizableConfigBean);
authorizableToInstall.changePassword(password);
}


private String getPassword(final AuthorizableConfigBean authorizableConfigBean)
throws AuthorizableCreatorException {
try {
String password = authorizableConfigBean.getPassword();
if (password.matches("\\{.+}")) {
if (cryptoSupport == null) {
throw new CryptoException("CryptoSupport missing to unprotect password.");
}
password = cryptoSupport.unprotect(password);
}
return password;
} catch (CryptoException e) {
throw new AuthorizableCreatorException(
"Could not decrypt password for user " + authorizableConfigBean.getAuthorizableId() + ": " + e);
}
}


/** This is only relevant for members that point to groups/users not contained in configuration.
* {@link biz.netcentric.cq.tools.actool.configreader.YamlConfigurationMerger#ensureIsMemberOfIsUsedWherePossible()} ensures that
* regular relationships between groups contained in config are kept in isMemberOf */
Expand Down Expand Up @@ -709,7 +721,7 @@ private Authorizable createNewUser(
throws AuthorizableExistsException, RepositoryException,
AuthorizableCreatorException {
String authorizableId = principalConfigBean.getAuthorizableId();
String password = principalConfigBean.getPassword();
String password = getPassword(principalConfigBean);
boolean isSystemUser = principalConfigBean.isSystemUser();
String intermediatePath = principalConfigBean.getPath();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
import com.adobe.granite.crypto.CryptoException;
import com.adobe.granite.crypto.CryptoSupport;

import biz.netcentric.cq.tools.actool.authorizableinstaller.AuthorizableCreatorException;
import biz.netcentric.cq.tools.actool.configmodel.AcConfiguration;
import biz.netcentric.cq.tools.actool.configmodel.AuthorizableConfigBean;
import biz.netcentric.cq.tools.actool.configmodel.GlobalConfiguration;
Expand Down Expand Up @@ -340,7 +341,7 @@ public void setUp() throws CryptoException {
}

@Test
public void test() throws RepositoryException, CryptoException {
public void test() throws RepositoryException, AuthorizableCreatorException {
final AuthorizableConfigBean bean = new AuthorizableConfigBean();
bean.setPassword(password);

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.1.0</version>
<version>2.1.1</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.1.0</version>
<version>2.1.1</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.1.0</version>
<version>2.1.1</version>
</parent>

<!-- ====================================================================== -->
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.1.0</version>
<version>2.1.1</version>
<packaging>pom</packaging>

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

0 comments on commit aade8f8

Please sign in to comment.