wimsymons commented on a change in pull request #24:
URL:
https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/24#discussion_r524156737
##########
File path:
src/main/java/org/apache/sling/resourceresolver/impl/mapping/MapEntries.java
##########
@@ -1047,13 +1023,39 @@ private boolean addEntry(final Map<String,
List<MapEntry>> entryMap, final Strin
return map;
}
- /**
+ /**
+ *
+ * validate alias path based on configuration provided
+ */
+
+ protected boolean isValidAliasPath(final String path){
+ if(path == null){
+ throw new IllegalArgumentException("Unexpected null path");
+ }
+
+ // ignore system tree
+ if (path.startsWith(JCR_SYSTEM_PREFIX)){
+ log.debug("loadAliases: Ignoring {}", path);
+ return false;
+ }
+ Set<String> allowedPaths = this.factory.getAllowedAliasPaths();
+ // check allow list
+ if(!allowedPaths.isEmpty()){
Review comment:
Why the extra check? The next statement will do this for you anyway.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]