alopresto commented on a change in pull request #3672: NIFI-6363 Additional 
Sensitive Property Providers
URL: https://github.com/apache/nifi/pull/3672#discussion_r318131409
 
 

 ##########
 File path: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-properties-loader/src/main/java/org/apache/nifi/properties/sensitive/ProtectedNiFiProperties.java
 ##########
 @@ -339,8 +342,19 @@ public NiFiProperties getUnprotectedProperties() throws 
SensitivePropertyProtect
                 if (key.endsWith(".protected")) {
                     // Do nothing
                 } else if (isPropertyProtected(key)) {
+                    String value = getProperty(key);
+                    String protectionScheme = 
getProperty(getProtectionKey(key));
+                    SensitivePropertyProvider propertyProvider = 
sensitivePropertyProvider;
+                    String defaultScheme = 
sensitivePropertyProvider.getIdentifierKey();
+                    boolean sameScheme = 
defaultScheme.equals(protectionScheme);
+
+                    if (!sameScheme && 
StandardSensitivePropertyProvider.hasProviderFor(protectionScheme)) {
+                        propertyProvider = 
StandardSensitivePropertyProvider.fromKey(value, protectionScheme);
+                        logger.info("Selected specific sensitive property 
provider: " + propertyProvider.getName() + " for property: " + key);
+                    }
 
 Review comment:
   I would add another block to check `!sameScheme && 
!SSPP.hasProviderFor(protectionScheme)` and return a more explicit error that 
"the provided protection scheme is not supported."

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to