Lehel44 commented on a change in pull request #5110:
URL: https://github.com/apache/nifi/pull/5110#discussion_r644349920



##########
File path: 
nifi-commons/nifi-security-utils/src/main/java/org/apache/nifi/security/kms/CryptoUtils.java
##########
@@ -133,43 +124,28 @@ public static boolean 
isValidRepositoryEncryptionConfiguration(RepositoryEncrypt
      * @return true if the provided configuration is valid
      */
     public static boolean isValidKeyProvider(String keyProviderImplementation, 
String keyProviderLocation, String keyId, Map<String, String> encryptionKeys) {
-        logger.debug("Attempting to validate the key provider: 
keyProviderImplementation = "
-                + keyProviderImplementation + ", keyProviderLocation = "
-                + keyProviderLocation + ", keyId = "
-                + keyId + ", encryptionKeys = "
-                + ((encryptionKeys == null) ? "0" : encryptionKeys.size()));
-
         try {
             keyProviderImplementation = 
handleLegacyPackages(keyProviderImplementation);
-        } catch (KeyManagementException e) {
-            logger.warn("The attempt to validate the key provider failed 
keyProviderImplementation = "
-                    + keyProviderImplementation + ", keyProviderLocation = "
-                    + keyProviderLocation + ", keyId = "
-                    + keyId + ", encryptionKeys = "
-                    + ((encryptionKeys == null) ? "0" : 
encryptionKeys.size()));
-
+        } catch (final KeyManagementException e) {
+            logger.warn("Key Provider [{}] Validation Failed: {}", 
keyProviderImplementation, e.getMessage());
             return false;
         }
 
         if (STATIC_KEY_PROVIDER_CLASS_NAME.equals(keyProviderImplementation)) {

Review comment:
       Minor: Would you consider using switch here? I think it's more readable.




-- 
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.

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


Reply via email to