Introduction
From Artifactory 7.146.7 Self-Hosted version, sometimes the non-admin users can see the artifacts via UI from the repositories with include or exclude patterns, but can’t search the artifacts via AQL from the same repositories. This makes customers confused.
Create a repository with Include Patterns:
Non-admin users can see the artifacts in this repository via UI:
But the same user cannot search the artifacts in the repository via AQL:
Root Cause
The root cause is the repository sets the include and exclude patterns. From Artifactory 7.146.7 Self-Hosted version, Artifactory’s AQL search results respect repository include and exclude patterns. That is, artifacts that do not match the repository's patterns are filtered out from the search results for non-admin users.
Resolution
There are two ways to resolve this issue:
1. Let the non-admin users know the include and exclude patterns, and input the right path in the request body, then they can get the correct response with the artifacts searched:
2. If the admin user does not want the non-admin users to know the patterns, following the security or audit requirements, he should allow non-admin users to search without the “includeExcludePatterns” filter.
The admin user can set the feature flag as following:
artifactory.aql.query.apply.includeExcludePatterns=flase
in $JFROG_HOME/artifactory/etc/artifactory/artifactory.system.properties and then restart the Artifactory.
After that, the non-admin users can search the artifacts without following the include and exclude patterns: