Skip to content

Commit 7d89311

Browse files
committed
Improve readme with implicitly allowed services
1 parent 8f4f590 commit 7d89311

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed

README.md

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,20 @@ Ensures Bundle-SymbolicName headers conform to naming conventions, with support
2828

2929
### DS Component Provided Services
3030
Validates that Declarative Services components only provide services whose fully qualified class names match specified patterns.
31-
Apart from the explicitly managed configuration there is implicit allows for all those commons services which have multi-tenancy support built-in via a specific (validated) OSGi property. Those
32-
are validated on a different level.
31+
32+
#### Implicitly Allowed Services
33+
34+
In addition to explicitly configured patterns, the following services are always allowed by default because they are known to support multi-tenancy or are unlikely to cause namespace clashes:
35+
36+
- `javax.servlet.Servlet`
37+
- `jakarta.servlet.Servlet`
38+
- `javax.servlet.Filter`
39+
- `jakarta.servlet.Filter`
40+
- `org.apache.sling.api.adapter.AdapterFactory`
41+
- `org.apache.sling.rewriter.TransformerFactory`
42+
- `com.adobe.granite.workflow.exec.WorkflowProcess`
43+
- `com.day.cq.workflow.exec.WorkflowProcess`
44+
- `org.apache.sling.auth.core.spi.AuthenticationHandler`
3345

3446
### HTTP/Servlet Whiteboard
3547
For DS components implementing `javax.servlet.Servlet` or `jakarta.servlet.Servlet`, validates
@@ -100,14 +112,21 @@ In general you add this artifact as plugin dependency to the Maven plugin. Then
100112
com.mycompany.services.*
101113
102114
-plugin.namespace: biz.netcentric.osgi.bnd.NamespaceValidatorsPlugin; \
103-
allowedExportPackagePattern="com\\.mycompany\\..*"; \s
115+
allowedExportPackagePattern="com\\.mycompany\\..*"; \
104116
allowedBundleSymbolicNamePatterns="com\\.mycompany\\.bundles\\..*"; \
105117
allowedServiceClassPatterns="com\\.mycompany\\..*"; \
106118
allowedSlingServletPathsPattern="/apps/myproject/.*"; \
107119
allowedSlingServletResourceTypesPatterns="/apps/myproject/.*"; \
108120
allowedSlingServletResourceSuperTypePattern="/apps/myproject/.*";
109121
]]></bnd>
110122
</configuration>
123+
<dependencies>
124+
<dependency>
125+
<groupId>biz.netcentric.osgi.bnd</groupId>
126+
<artifactId>bundle-namespace-validators</artifactId>
127+
<version>1.0.0</version>
128+
</dependency>
129+
</dependencies>
111130
</plugin>
112131
```
113132

@@ -125,4 +144,4 @@ This project is licensed under the Eclipse Public License 2.0 - see the [LICENSE
125144

126145
- [AEM Content Package Namespace Validators](https://github.com/Netcentric/aem-content-package-namespace-validators) - Content package validation
127146
- [Bnd Tools](https://bnd.bndtools.org/) - OSGi development tools
128-
- [Apache Sling](https://sling.apache.org/) - Web framework for the JVM
147+
- [Apache Sling](https://sling.apache.org/) - Web framework for the JVM

src/main/java/biz/netcentric/osgi/bnd/NamespaceValidatorsPlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ private void validateServiceProviders(String componentName, Element componentEle
559559

560560
/**
561561
* Retrieves all properties of a DS component as a map of property name to collection of values.
562-
* Handles properties with a 'value' attribute (comma-separated values) and supports multi-valued properties.
562+
* Handles (single-value) properties with a 'value' attribute and supports multi-valued properties in text content.
563563
*/
564564
private Map<String, Collection<String>> getComponentProperties(Element componentElement) {
565565
Map<String, Collection<String>> properties = new java.util.HashMap<>();

0 commit comments

Comments
 (0)