bhavikpatel9977 commented on code in PR #3824:
URL: https://github.com/apache/ambari/pull/3824#discussion_r1757965173


##########
ambari-server/src/main/java/org/apache/ambari/server/api/services/ClusterService.java:
##########
@@ -860,4 +879,81 @@ ResourceInstance createArtifactResource(String 
clusterName, String artifactName)
 
     return createResource(Resource.Type.Artifact, mapIds);
   }
+
+  private boolean parseBody(String body) {
+    JsonObject jsonObject = gson.fromJson(body, JsonObject.class);
+    if (jsonObject == null) {
+      return false;
+    }
+
+    JsonElement artifact_data = jsonObject.get("artifact_data");
+    if (artifact_data == null) {
+      return false;
+    }
+    JsonArray identities = 
artifact_data.getAsJsonObject().getAsJsonArray("identities");
+    if (identities != null) {
+      if (checkKeytabsPrincipal(identities)) {
+        return true;
+      }
+    }
+
+    JsonArray services = 
artifact_data.getAsJsonObject().getAsJsonArray("services");
+    for (int i = 0; i < services.size(); i++) {
+      JsonArray components = 
services.get(i).getAsJsonObject().get("components").getAsJsonArray();

Review Comment:
   Object level mapping is required to to check/validate the principal and 
keytab values. Also code readability is more in this way.   



-- 
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: dev-unsubscr...@ambari.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@ambari.apache.org
For additional commands, e-mail: dev-h...@ambari.apache.org

Reply via email to