Expand my Community achievements bar.

SOLVED

Dispatcher Extension Restrictions for /etc.clientlibs Paths

Avatar

Level 3

I can't get filter extension restrictions to work for /etc.clientlibs paths. I'm guessing because it is a proxied path and not a physical path. Is this even possible? Here is my config:

 

 

/filter
{
# Deny everything first and then allow specific entries
/0001 { /type "deny" /glob "*" }

#This works
/0010 { /type "allow" /url "/etc/designs/myapp/*"                   /extension '(css|js|ai|bmp|gif|ico|jpe?g|png|ps|psd|svg|tiff?)' }
/0011 { /type "allow" /url "/etc/designs/myapp-lib/*"               /extension '(css|js|ai|bmp|gif|ico|jpe?g|png|ps|psd|svg|tiff?)' }

#This does not work
/0012 { /type "allow" /url "/etc.clientlibs/clientlibs/*"          /extension '(css|js|woff2?)' }
/0013 { /type "allow" /url "/etc.clientlibs/granite/*"             /extension '(css|js|woff2?)' }
/0014 { /type "allow" /url "/etc.clientlibs/wcm/*"                 /extension '(css|js|woff2?)' }
/0015 { /type "allow" /url "/etc.clientlibs/foundation/*"          /extension '(css|js|woff2?)' }
/0016 { /type "allow" /url "/etc.clientlibs/cq/personalization/*"  /extension '(css|js|woff2?)' }
}

 

 

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Hi @AEM_Dan ,


Yes, and It's also about how the URL decomposition works on the dispatcher. This document has some details about the full dissection of URLs by the dispatcher.

https://experienceleague.adobe.com/docs/experience-manager-learn/dispatcher-tutorial/chapter-1.html?... 

 

You could try something like this:-

/0012 { /type "allow" /path "/etc*" /extension "clientlibs" /suffix "{suffix}" }

 

Hope this helps!

Regards,
Nitesh

View solution in original post

7 Replies

Avatar

Correct answer by
Employee Advisor

Hi @AEM_Dan ,


Yes, and It's also about how the URL decomposition works on the dispatcher. This document has some details about the full dissection of URLs by the dispatcher.

https://experienceleague.adobe.com/docs/experience-manager-learn/dispatcher-tutorial/chapter-1.html?... 

 

You could try something like this:-

/0012 { /type "allow" /path "/etc*" /extension "clientlibs" /suffix "{suffix}" }

 

Hope this helps!

Regards,
Nitesh

Avatar

Level 3

Okay, that makes sense actually.  Because of the dot, it *thinks* clientlibs is an extension.  Let me give that a try.

Avatar

Level 3

@AEM_Dan AEM has a built-in tool that allows you to see this breakdown. I have used it countless times to sanity-check URL structures like ClientLibs.

http://localhost:4502/system/console/servletresolver

Hope that helps in addition to @nitesh_kumar's answer.

Avatar

Level 3

Yes, very helpful!  Broke my URL down just like the suggested rule.  Thanks!

Avatar

Level 3

That does indeed work.  So I have:

/0015 { /type "allow" /url "/etc*" /extension "clientlibs" /suffix "/foundation/*.css" }
/0016 { /type "allow" /url "/etc*" /extension "clientlibs" /suffix "/foundation/*.js" }

It would be nice to combine these into one rule like:

/0015 { /type "allow" /url "/etc*" /extension "clientlibs" /suffix '(/foundation/*.css|/foundation/*.js)' }

But that doesn't work.  Thoughts?

Avatar

Community Advisor

@AEM_Dan seems to be correct, few things to confirm, can you make sure this filter.any file is mapped correctly to publish farm which is getting executed ?

 

 

 

Second, can you try removing Extension restrictions and try based on url Only?

 

 

 

Third, is this full filter.any file or anything else you have, if possible post full file?

 

 

 

Here is the AEM Archetype dispatcher filter rule which works perfectly fine

 

 

 

# Enable clientlibs proxy servlet

 

 

 

/0013 { /type "allow" /method "GET" /url "/etc.clientlibs/*" }

 

 

 

 

 

 

 

 

 

https://github.com/adobe/aem-project-archetype/blob/develop/src/main/archetype/dispatcher.ams/src/co...

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Avatar

Level 3

I have everything in just 1 dispatcher.any file and the other filters are working fine so I don't have any reason to believe it's not getting executed on the correct farm.  Plus this does work perfectly fine:

/0012 { /type "allow" /url "/etc.clientlibs/clientlibs/*" }