- Notifications
You must be signed in to change notification settings - Fork0
FileVault validators which verify that content packages comply with certain namespacing rules.
License
Netcentric/aem-content-package-namespace-validators
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Validates that FileVault content packages stick to certain namespacing rules. This is helpful to make sure that separate AEM applications may run in parallel on the same server without stepping on each other toes. This is particularly useful withmultiple teams working on the same AEM environment (also outlined inConsiderations for a multi-team setup).
There are several validators included in this artifact, all relate to namespacing rules for certain aspects of AEM:
- FileVault Content Package Filter (
rootattribute of eachfilterelement) - FileVault Content Package ID (both
groupand optionallynamepackage properties) - Oak Authorizables (
rep:principalNameand optionallyrep:authorizableIdproperties of users/groups) - Oak Query Index Definition (path restrictions forLucene orProperty index definitions)
- OSGi Configuration
- Sling Resource Type and Resource Super Type (
sling:resourceTypeandsling:resourceSuperTypeproperties) - AEM Client Library (
categoriesproperty) - Embedded Bundles (the
Bundle-SymbolicNameof embedded bundles, can be validated on bundle side viahttps://github.com/Netcentric/bundle-namespace-validators as well)
Namespacing has been explicitly mentioned inAchim Koch's Blog: Hosting Multiple Tenants on AEM but obviously namespacing is just one of multiple aspects to consider for multi-tenant AEM environments.
There was also a talk about multi-tenancy and this tool in theadaptTo 2025 conference.
For a similar tool for OSGi bundles look athttps://github.com/Netcentric/bundle-namespace-validators.
This artifact provides multiple validator implementations for theFileVault Validation Module and can be used for example with thefilevault-package-maven-plugin like outlined below.
The following options are supported apart from the default settings mentioned inFileVault validation.Leaving the validators with the default options will not emit validation issues at all, i.e. none of the options are mandatory.
| Validator ID | Option | Description | Since |
|---|---|---|---|
netcentric-filter-namespace | allowedPathPatterns | Comma-separated list of regular expression patterns. Each package filterroot must match at least one of the given patterns. | 1.0.0 |
netcentric-packageid-namespace | allowedGroupPatterns | Comma-separated list of regular expression patterns. The package's group must match at least one of the given patterns. | 1.0.0 |
netcentric-packageid-namespace | allowedNamePatterns | Comma-separated list of regular expression patterns. The package's name must match at least one of the given patterns. | 1.0.0 |
netcentric-authorizable-namespace | allowedPrincipalNamePatterns | Comma-separated list of regular expression patterns. The authorizable'srep:principalName must match at least one of the given patterns. | 1.0.0 |
netcentric-authorizable-namespace | allowedAuthorizableIdPatterns | Comma-separated list of regular expression patterns. The authorizable'srep:authorizableId or its node name (if the property does not exist( must match at least one of the given patterns. | 1.0.0 |
netcentric-authorizable-namespace | allowedAuthorizableIdPatterns | Comma-separated list of regular expression patterns. The authorizable'srep:authorizableId or its node name (if the property does not exist) must match at least one of the given patterns. | 1.0.0 |
netcentric-oakindex-namespace | allowedPathPatterns | Comma-separated list of regular expression patterns. Each Oak index definition's path restriction (forlucene index types orproperty index types) must match at least one of the given patterns. | 1.0.0 |
netcentric-osgiconfig-namespace | allowedPidPatterns | Comma-separated list of regular expression patterns. Each (non-factory) configuration name given via theOSGi Installer must have a PID matching at least one of the given patterns. | 1.0.0 |
netcentric-osgiconfig-namespace | allowedFactoryPidNames | Comma-separated list of regular expression patterns. Each factory configuration name given via theOSGi Installer must have a name matching at least one of the given patterns. | 1.0.0 |
netcentric-osgiconfig-namespace | restrictFactoryConfigurationsToAllowedPidPatterns | Boolean flag,false by default. If set totrue each factory configuration PID given via theOSGi Installer must also matching at least one of the given patterns fromallowedPidPatterns. | 1.0.0 |
netcentric-resourcetype-namespace | allowedTypePatterns | Comma-separated list of regular expression patterns. Eachsling:resourceType property of arbitrary JCR nodes must match at least one of the given patterns. | 1.0.0 |
netcentric-resourcetype-namespace | allowedSuperTypePatterns | Comma-separated list of regular expression patterns. Eachsling:resourceSuperType property of arbitrary JCR nodes must match at least one of the given patterns. | 1.0.0 |
netcentric-clientlibrary-namespace | allowedCategoryPatterns | Comma-separated list of regular expression patterns. Eachclient library'scategories value must match at least one of the given patterns. | 1.0.0 |
netcentric-embedded-namespace | allowedBundleSymbolicNamePatterns | Comma-separated list of regular expression patterns. Eachembedded bundle in the package must have aBundle-SymbolicName in its manifest which matches at least one of the given patterns. | 1.1.0 |
Due to the use of comma-separated strings it is not possible to use a comma within the regular expressions. However, as those are matched against names/paths (which don't allow a comma anyhow) using the comma inside the regular expressions shouldn't be necessary anyhow.
Make the relevant attribute value/name/property value match one of the given patterns.
You can use this validator with theFileVault Package Maven Plugin in version 1.4.0 or higher like this
<plugin> <groupId>org.apache.jackrabbit</groupId> <artifactId>filevault-package-maven-plugin</artifactId> <configuration> <validatorsSettings> <netcentric-authorizable-namespace> <options> <allowedPrincipalNamePatterns>mytenant-.*</allowedPrincipalNamePatterns> <allowedAuthorizableIdPatterns>mytenant-.*</allowedAuthorizableIdPatterns> </options> </netcentric-authorizable-namespace> <netcentric-clientlibrary-namespace> <options> <allowedCategoryPatterns>mytenant-.*</allowedCategoryPatterns> </options> </netcentric-clientlibrary-namespace> <netcentric-filter-namespace> <options> <allowedFilterRootPatterns>/apps/mytenant(/.*)?,/conf/mytenant(/.*)?,/home/users/mytenant(/.*)?,/oak:index/mytenant-(.*)</allowedFilterRootPatterns> </options> </netcentric-filter-namespace> <netcentric-oakindex-namespace> <options> <allowedPathPatterns>/content/mytenant(/.*)?</allowedPathPatterns> </options> </netcentric-oakindex-namespace> <netcentric-osgiconfig-namespace> <options> <allowedPidPatterns>com\.example\.mytenant\..*</allowedPidPatterns> <allowedFactoryPidNames>name.*</allowedFactoryPidNames> <restrictFactoryConfigurationsToAllowedPidPatterns>true</restrictFactoryConfigurationsToAllowedPidPatterns> </options> </netcentric-osgiconfig-namespace> <netcentric-packageid-namespace> <options> <allowedGroupPatterns>biz\.netcentric\.filevault\.validator\.aem\.namespace\.it</allowedGroupPatterns> <allowedNamePatterns>.*-package</allowedNamePatterns> </options> </netcentric-packageid-namespace> <netcentric-resourcetype-namespace> <options> <allowedSuperTypePatterns>/apps/mytenant2/components/.*</allowedSuperTypePatterns> <allowedTypePatterns>/apps/mytenant2/components/.*</allowedTypePatterns> </options> </netcentric-resourcetype-namespace> <netcentric-embedded-namespace> <options> <allowedBundleSymbolicNamePatterns>mytenant-.*<allowedBundleSymbolicNamePatterns> </options> </netcentric-embedded-namespace> </validatorsSettings> </configuration> <dependencies> <dependency> <groupId>biz.netcentric.filevault.validators</groupId> <artifactId>aem-content-package-namespace-validators</artifactId> <version><latestversion></version> </dependency> </dependencies></plugin>There is also a project skeleton athttps://github.com/Netcentric/aem-multitenant-demo which includes these validators with a simple prefix based tenant namespace approach.
Adobe, and AEM are either registered trademarks or trademarks of Adobe in the United States and/or other countries.
About
FileVault validators which verify that content packages comply with certain namespacing rules.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.