Commit d9d0e8c2 by Pinal Shah Committed by nixonrodrigues

ATLAS-3888 : BasicSearch: Multiple type/tag: [Regression], Restrict when tag…

ATLAS-3888 : BasicSearch: Multiple type/tag: [Regression], Restrict when tag filters and regex in tag Signed-off-by: 's avatarnixonrodrigues <nixon@apache.org>
parent f690755f
...@@ -106,6 +106,17 @@ public class SearchContext { ...@@ -106,6 +106,17 @@ public class SearchContext {
} }
} }
//Wildcard tag with filter will raise an exception with 400 error code
if (CollectionUtils.isNotEmpty(classificationNames) && hasAttributeFilter(searchParameters.getTagFilters())) {
for (String classificationName : classificationNames){
//in case of '*' , filters are allowed, but
//in case of regex 'PI*', filters are not allowed ( if present in any of the requested tag)
if (classificationName.contains(WILDCARD_CLASSIFICATIONS) && !classificationName.equals(WILDCARD_CLASSIFICATIONS)) {
throw new AtlasBaseException(AtlasErrorCode.BAD_REQUEST, "TagFilters specified with wildcard tag name");
}
}
}
// Invalid attributes will raise an exception with 400 error code // Invalid attributes will raise an exception with 400 error code
if (CollectionUtils.isNotEmpty(classificationTypes)) { if (CollectionUtils.isNotEmpty(classificationTypes)) {
for (AtlasClassificationType classificationType : classificationTypes) { for (AtlasClassificationType classificationType : classificationTypes) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment