You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2022/09/08 14:23:11 UTC

[GitHub] [nifi] bejancsaba commented on a diff in pull request #6375: NIFI-10458 Add support for the DESCRIBE/MANIFEST Operation

bejancsaba commented on code in PR #6375:
URL: https://github.com/apache/nifi/pull/6375#discussion_r966036354


##########
c2/c2-client-bundle/c2-client-service/src/main/java/org/apache/nifi/c2/client/service/C2HeartbeatFactory.java:
##########
@@ -225,4 +242,14 @@ private File getConfDirectory() {
 
         return confDirectory;
     }
+
+    public String calculateManifestHash(List<Bundle> loadedBundles) {
+        byte[] bytes = messageDigest.digest(loadedBundles.stream()

Review Comment:
   Thanks, updated



##########
c2/c2-client-bundle/c2-client-service/src/main/java/org/apache/nifi/c2/client/service/C2HeartbeatFactory.java:
##########
@@ -225,4 +242,14 @@ private File getConfDirectory() {
 
         return confDirectory;
     }
+
+    public String calculateManifestHash(List<Bundle> loadedBundles) {
+        byte[] bytes = messageDigest.digest(loadedBundles.stream()
+            .map(bundle -> bundle.getGroup() + bundle.getArtifact() + bundle.getVersion())
+            .sorted()
+            .collect(Collectors.joining(","))
+            .getBytes(StandardCharsets.UTF_8));
+
+        return UUID.nameUUIDFromBytes(bytes).toString();

Review Comment:
   Updated as requested



-- 
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: issues-unsubscribe@nifi.apache.org

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