nifi-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [nifi] natural commented on a change in pull request #3542: NIFI-6363 Integrates AWS KMS SPP. Refactors SSPP.
Date Mon, 24 Jun 2019 17:59:20 GMT
natural commented on a change in pull request #3542: NIFI-6363 Integrates AWS KMS SPP.  Refactors
SSPP.
URL: https://github.com/apache/nifi/pull/3542#discussion_r296844799
 
 

 ##########
 File path: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-properties-loader/src/main/java/org/apache/nifi/properties/sensitive/ProtectedNiFiProperties.java
 ##########
 @@ -510,22 +448,21 @@ private boolean isProviderAvailable(String protectionScheme) {
      */
     private String unprotectValue(String key, String retrievedValue) {
         // Checks if the key is sensitive and marked as protected
-        if (isPropertyProtected(key)) {
-            final String protectionScheme = getProperty(getProtectionKey(key));
+        if (!isPropertyProtected(key)) {
+            return retrievedValue;
+        }
+        final String protectionScheme = getProperty(getProtectionKey(key));
 
-            // No provider registered for this scheme, so just return the value
-            if (!isProviderAvailable(protectionScheme)) {
-                logger.warn("No provider available for {} so passing the protected {} value
back", protectionScheme, key);
-                return retrievedValue;
-            }
+        if (protectionScheme.equals("unknown")) {
+            return retrievedValue;
+        }
 
-            try {
-                SensitivePropertyProvider sensitivePropertyProvider = getSensitivePropertyProvider(protectionScheme);
-                return sensitivePropertyProvider.unprotect(retrievedValue);
-            } catch (SensitivePropertyProtectionException e) {
-                throw new SensitivePropertyProtectionException("Error unprotecting value
for " + key, e.getCause());
-            }
+        // try and make one to unprotect, and if that fails...
+        try {
+            return StandardSensitivePropertyProvider.fromKey(defaultKeyHex).unprotect(retrievedValue);
+        } catch (final SensitivePropertyProtectionException e) {
+            throw new SensitivePropertyProtectionException(e);
 
 Review comment:
   Ah, that's another good catch.  Restored the previous exception (re-)handling.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message