Skip to content

Commit 216d4e1

Browse files
committed
Merge branch 'release/1.6.1'
2 parents 64417b2 + 196d3a9 commit 216d4e1

40 files changed

+789
-1405
lines changed

HISTORY

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
actool 1.6 - August 14, 2015
22
-------------------------
3-
Fixed #23: AEM 6.1 Compatibility
4-
Fixed #22: SQL2 Queries and new oakindex package that can be installed directly or taken as reference to avoid traversal fallback with queries for [rep:ACL]
5-
Fixed #25: better error handling (also renamed method for clarity)
3+
- AEM 6.1 Compatibility
4+
- Better query performance and new accesscontroltool-oakindex-package (containing an index for [rep:ACL])
5+
- 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
66

77
actool 1.5 - May 21, 2015
88
-------------------------

README.md

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The Access Control Tool for Adobe Experience Manager (ACTool) is a tool that sim
77

88
Building the ACTool requires Java 7 and Maven 3.2.
99

10-
Installing ACTool requires CQ5.6/AEM 6.0.
10+
Installing ACTool requires CQ5.6/AEM 6.0/AEM 6.1.
1111

1212
# Installation
1313

@@ -29,6 +29,7 @@ mvn -PautoInstallPackage install
2929

3030
For better human readability and easy editing the ACL configuration files use the YAML format.
3131

32+
3233
## Overall structure a of an AC configuration file
3334

3435
<img src="docs/images/configuration-file-structure.png">
@@ -68,6 +69,17 @@ If the isMemberOf property of a group contains a group which is not yet installe
6869

6970
The members property contains a list of groups where this group is added as isMemberOf.
7071

72+
## Configuration of users
73+
74+
In general it is best practice to not generate regular users by the AC Tool but use other mechanism (e.g. LDAP) to create users. However, it can be useful to create system users (e.g. for replication agents or OSGi service authentiation) or test users on staging environments.
75+
76+
Users can be configured in the same way as groups in the **user_config** section. There are two differences to groups:
77+
78+
* the attribute "members" cannot be used (for obvious reasons)
79+
* the attribute "password" can be used for preset passwords
80+
* the boolean attribute isSystemUser is used to create system users in AEM 6.1
81+
82+
7183
## Configuration of ACEs
7284

7385
The configurations are done per principal followed by indented informations which comprise of config data which represents the settings per ACE. This data includes
@@ -230,28 +242,24 @@ Example showing 3 separate project-specific configuration sub-nodes each contain
230242

231243
<img src="docs/images/crx-storage.png">
232244

233-
The projectspecific configuration files get stored in CRX under a node which can be set in the OSGi configuration of the AcService (system/console/configMgr). Each child node contains the project specific configuration file(s). Everytime a new installation gets executed, the newest configuration file gets used. The folder structure gets created by deployment or manually in CRX. Each time a new configuration file gets uploaded in CRX (e.g. deployment) or the content of a file gets changed a node listener can trigger a new installation of the configurations. This behaviour can be enabled/disabled in UploadListenerService OSGi config.
245+
The project specific configuration files are stored in CRX under a node which can be set in the OSGi configuration of the AcService (system/console/configMgr). Each folder underneath this location may contain `*.yaml` files that contain AC configuration. The folder structure gets created by deployment or manually in CRX.
246+
247+
In general the parent node may specify required Sling run modes being separated by a dot (```.```). Folder names can contain runmodes in the same way as OSGi configurations ([installation of OSGi bundles through JCR packages in Sling](http://sling.apache.org/documentation/bundles/jcr-installer-provider.html)) using a `.` (e.g. `myproject.author` will only become active on author). Additionally, multiple runmodes combinations can be given separated by comma to avoid duplication of configuration (e.g. `myproject.author.test,author.dev` will be active on authors of dev and test environment only). Each time a new configuration file gets uploaded in CRX (e.g. deployment) or the content of a file gets changed a node listener can trigger a new installation of the configurations. This behaviour can be enabled/disabled in UploadListenerService OSGi config.
234248

235249
## Installation process
236250

237251
During the installation all groups defined in the groups section of the configuration file get created in the system. In a next step all ACEs configured in the ACE section get installed in CRX. Any old ACEs regarding these groups not contained anymore in the config but in the repository gets automatically purged thus no old or obsolete ACEs stay in the system and any manual change of ACEs regarding these groups get reverted thus ensuring a defined state again. ACEs not belongig to those groups in the configuration files remain untouched. So after the installation took place all groups and the corresponding ACEs exactly as defined in the configuration(s) are installed on the system.
238252

239-
If at any point during the installation an ecxeption occurs, no changes get persisted in the system. This prevents ending up having a undefined state in the repository.
253+
If at any point during the installation an exception occurs, no changes get persisted in the system. This prevents ending up having a undefined state in the repository.
240254

241-
During the installation a history containing the most important events gets ceated and persisted in CRX for later examination.
242-
Merging of ACEs
255+
During the installation a history containing the most important events gets created and persisted in CRX for later examination.
243256

244-
To achieve the aforementioned requirements every new installation comprises the following steps:
257+
The following steps are performed:
258+
259+
1. All AC entries are removed from the repository which refer to an authorizable being mentioned in the YAML configuration file (no matter to which path those entries refer).
260+
1. All authorizables being mentioned in the YAML configuration get created (if necessary, i.e. if they do no exist yet).
261+
1. All AC entries generated from the YAML configuration get persisted in the repository. If there are already existing entries for one path (and referring to another authorizable) those are not touched. New AC entries are added at the end of the list. All new AC entries are sorted, so that the Deny entries are listed above the Allow entries. Since the AC entry nodes are evaluated bottom-to-top this sorting order leads to less restrictions (e.g. for a user which is member of two groups where one group sets a Deny and the other one sets an Allow, this order ensures that the allow has a higher priority).
245262

246-
* The group based ACE configuration from configuration file gets transformed into a node based configuration
247-
* A dump in the same format gets fetched from the repository
248-
* On each node contained in this file the following steps get performed:
249-
* The ACL from dump and from the configuration gets compared
250-
* If there are already ACEs in the repository regarding a group from the configuration, these ACEs get removed
251-
* The other ACEs not contained in the respective ACL from config get merged into the ACL from the config and get ordered (deny ACEs followed by allow ACEs)
252-
* The ACL from in repo gets replaced by the merged one from config
253-
* In case there is a node in repository dump that is not covered in the config the following step gets performed
254-
* if the ACL of that node has one or several ACEs belonging to one or several groups from config, these ACEs get deleted
255263

256264
### Installation Hook
257265

@@ -270,11 +278,7 @@ To enable that on a package being created with Maven through the content-package
270278
</plugin>
271279
```
272280

273-
Now it depends on where those ```*.yaml``` are located in the package, because not in all cases they are being installed.
274-
In general the parent node may specify required Sling run modes being separated by a dot (```.```). They specify the minimum required Sling run modes to be set in order for the YAML children files to be installed. This mechanism works similar as the [installation of OSGi bundles through JCR packages in Sling](http://sling.apache.org/documentation/bundles/jcr-installer-provider.html).
275-
276-
E.g. the parent node name ```somename.publish``` will require at least the ```publish``` run mode to be set in order for the YAML children to be installed by the Installation Hook mechanism. The parent node name may also specify multiple required run modes.
277-
If the parent node name does not contain a dot it will always be installed up (independent of any run modes). Except for those parent name limitations it does not matter at all where those ```*.yaml``` are located within the package (they will always be found by the install hook).
281+
The ```*.yaml``` files are installed directly from the package content and respect the same runmode semantics as described above.
278282

279283
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.
280284

accesscontroltool-bundle/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<parent>
1212
<groupId>biz.netcentric.cq.tools.accesscontroltool</groupId>
1313
<artifactId>accesscontroltool</artifactId>
14-
<version>1.6</version>
14+
<version>1.6.1</version>
1515
</parent>
1616

1717
<!-- ====================================================================== -->

accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/aceservice/AcInstallService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public interface AcInstallService {
3434

3535
/**
3636
* Purges all ACLs being set on the given root path (and below)
37-
* @param rootPath the rootPath for which the ACLs should be removed
37+
* @param rootNodePath the rootPath for which the ACLs should be removed
3838
* @param isRecursive if {@code true} will remove ACLs recursively from the given rootPath and its children, otherwise only for the given rootPath.
3939
* @param listener the listener which should receive methods callbacks whenever something should be logged.
4040
*/

accesscontroltool-bundle/src/main/java/biz/netcentric/cq/tools/actool/aceservice/AceService.java

Lines changed: 25 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -20,85 +20,49 @@ public interface AceService {
2020

2121
public AcInstallationHistoryPojo execute();
2222

23-
/**
24-
* method that indicates whether the service is ready for installation (if
25-
* at least one configurations was found in repository)
26-
*
27-
* @return true if ready, otherwise false
28-
*/
23+
/** method that indicates whether the service is ready for installation (if at least one configurations was found in repository)
24+
*
25+
* @return {@code true} if ready, otherwise {@code false} */
2926
public boolean isReadyToStart();
3027

31-
/**
32-
* purges all acls of the node specified by path (no deletion of acls of
33-
* subnodes)
34-
*
35-
* @param path
36-
* @return status message
37-
*/
28+
/** purges all acls of the node specified by path (no deletion of acls of subnodes)
29+
*
30+
* @param path the path from which to purge the ACL
31+
* @return status message */
3832
public String purgeACL(final String path);
3933

40-
/**
41-
* purges all acls of the node specified by path and all acls of all
42-
* subnodes
43-
*
44-
* @param path
45-
* @return status message
46-
*/
34+
/** purges all acls of the node specified by path and all acls of all subnodes
35+
*
36+
* @param path the path from which to purge the ACL (including those of all subnodes)
37+
* @return status message */
4738
public String purgeACLs(final String path);
4839

49-
/**
50-
* method that purges authorizable(s) and all respective aces from the
51-
* system
52-
*
53-
* @param authorizableId
54-
* @return status message
55-
*/
40+
/** method that purges authorizable(s) and all respective aces from the system
41+
*
42+
* @param authorizableIds comma-separated list of authorizable ids
43+
* @return status message */
5644
public String purgeAuthorizables(String authorizableIds);
5745

58-
/**
59-
* returns current execution status
60-
*
61-
* @return true if the service is executing, false if not
62-
*/
46+
/** returns current execution status
47+
*
48+
* @return true if the service is executing, false if not */
6349
public boolean isExecuting();
6450

65-
/**
66-
* return the path in repository under witch the ac confiuration are stored
67-
*
68-
* @return node path in repository
69-
*/
51+
/** return the path in repository under witch the ac confiuration are stored
52+
*
53+
* @return node path in repository */
7054
public String getConfigurationRootPath();
7155

72-
/**
73-
* return a set containing the paths to the newest configurations under the
74-
* configuration root path
75-
*
76-
* @return set containing paths
77-
*/
56+
/** return a set containing the paths to the newest configurations under the configuration root path
57+
*
58+
* @return set containing paths */
7859
public Set<String> getCurrentConfigurationPaths();
7960

80-
/**
81-
* returns map holding the node paths to the newest configurations as key
82-
* and the textual yaml configuation as entries
83-
*
84-
* @param configurationsRootPath
85-
* paths under which the ac configurations get stored in
86-
* repository
87-
* @param session
88-
* @param history
89-
* history object
90-
* @return map holding the newest configurations
91-
* @throws Exception
92-
*/
93-
public Map<String, String> getNewestConfigurationNodes(
94-
final String configurationsRootPath, final Session session,
95-
AcInstallationHistoryPojo history) throws Exception;
96-
9761
public String purgeAuthorizablesFromConfig();
9862

9963
public void installNewConfigurations(Session session,
10064
AcInstallationHistoryPojo history,
10165
Map<String, String> newestConfigurations, Set<AuthorizableInstallationHistory> authorizableInstallationHistorySet)
102-
throws Exception;
66+
throws Exception;
10367

10468
}

0 commit comments

Comments
 (0)