akash-gupta2813 commented on code in PR #1290:
URL: https://github.com/apache/ranger/pull/1290#discussion_r4208045084
##########
security-admin/src/main/java/org/apache/ranger/rest/ServiceRESTUtil.java:
##########
@@ -213,6 +214,82 @@ public static boolean processRevokeRequest(RangerPolicy
existingRangerPolicy, Gr
return policyUpdated;
}
+ public static boolean isXPolicyUniqueConstraintViolation(Throwable excp) {
+ return isXPolicyServiceSignatureUniqueConstraintViolation(excp) ||
isXPolicyNameServiceZoneUniqueConstraintViolation(excp);
+ }
+
+ public static boolean
isXPolicyServiceSignatureUniqueConstraintViolation(Throwable excp) {
+ boolean ret = false;
+ Throwable current = excp;
+
+ while (current != null && !ret) {
+ String message = current.getMessage();
+
+ if (StringUtils.containsIgnoreCase(message,
"x_policy_UK_service_signature")) {
Review Comment:
have documented this
// Supported DBs include the violated constraint name in unique-key errors.
// Match only known x_policy constraints to avoid masking unrelated failures.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]