Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MESH-40 Fixed the TODOs left by previous part of the task -> indexsearch for All Domain policies Personas takes longer to respond #3329

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,9 @@ private void processCreatePolicy(AtlasStruct entity) throws AtlasBaseException {
if (!POLICY_SUB_CATEGORY_DOMAIN.equals(policySubCategory)) {
validator.validate(policy, null, parentEntity, CREATE);
validateConnectionAdmin(policy);
} else {
validateAndReduce(policy);
}
// TODO : uncomment after FE release
// else {
// validateAndReduce(policy);
// }

policy.setAttribute(QUALIFIED_NAME, String.format("%s/%s", getEntityQualifiedName(parentEntity), getUUID()));

Expand Down Expand Up @@ -173,11 +171,11 @@ private void validateAndReduce(AtlasEntity policy) {
boolean hasAllDomainPattern = resources.stream().anyMatch(resource ->
resource.equals("entity:*") ||
resource.equals("entity:*/super") ||
resource.equals("entity:default/domain/*/super")
resource.equals(ENTITY_DEFAULT_DOMAIN_SUPER)
);

if (hasAllDomainPattern) {
policy.setAttribute(ATTR_POLICY_RESOURCES, Collections.singletonList("entity:default/domain/*/super"));
policy.setAttribute(ATTR_POLICY_RESOURCES, Collections.singletonList(ENTITY_DEFAULT_DOMAIN_SUPER));
}
}

Expand All @@ -199,11 +197,9 @@ private void processUpdatePolicy(AtlasStruct entity, AtlasVertex vertex) throws
if (!POLICY_SUB_CATEGORY_DOMAIN.equals(policySubCategory)) {
validator.validate(policy, existingPolicy, parentEntity, UPDATE);
validateConnectionAdmin(policy);
} else {
validateAndReduce(policy);
}
// TODO : uncomment after FE release
// else {
// validateAndReduce(policy);
// }

String qName = getEntityQualifiedName(existingPolicy);
policy.setAttribute(QUALIFIED_NAME, qName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,12 @@ private void processCreateStakeholderTitle(AtlasEntity entity) throws AtlasBaseE
}
if (domainQualifiedNames.contains(NEW_STAR) || domainQualifiedNames.contains(STAR)) {
if (domainQualifiedNames.size() > 1) {

domainQualifiedNames.clear();
// TODO : convert this to NEW_STAR after FE release
domainQualifiedNames.add(STAR);
domainQualifiedNames.add(NEW_STAR);
entity.setAttribute(ATTR_DOMAIN_QUALIFIED_NAMES, domainQualifiedNames);
} // TODO : uncomment this after FE release
// else {
// domainQualifiedNames.replaceAll(s -> s.equals(STAR) ? NEW_STAR : s);
// }
}else {
domainQualifiedNames.replaceAll(s -> s.equals(STAR) ? NEW_STAR : s);
}

String qualifiedName = format(PATTERN_QUALIFIED_NAME_ALL_DOMAINS, getUUID());
entity.setAttribute(QUALIFIED_NAME, qualifiedName);
Expand Down Expand Up @@ -216,8 +213,7 @@ private void authorizeDomainAccess(List<String> domainQualifiedNames) throws Atl
String domainQualifiedNameToAuth;

if (domainQualifiedNames.contains(STAR) || domainQualifiedNames.contains(NEW_STAR)) {
//TODO : Convert this to NEW_STAR
domainQualifiedNameToAuth = STAR;
domainQualifiedNameToAuth = NEW_STAR;
} else {
domainQualifiedNameToAuth = domainQualifiedName;
}
Expand Down
Loading