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_r297456028
 
 

 ##########
 File path: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-security/src/main/java/org/apache/nifi/web/security/spring/LoginIdentityProviderFactoryBean.java
 ##########
 @@ -219,16 +217,14 @@ private LoginIdentityProviderConfigurationContext 
loadLoginIdentityProviderConfi
     }
 
     private String decryptValue(String cipherText, String encryptionScheme) 
throws SensitivePropertyProtectionException {
-            initializeSensitivePropertyProvider(encryptionScheme);
+        initializeSensitivePropertyProvider(encryptionScheme);
         return SENSITIVE_PROPERTY_PROVIDER.unprotect(cipherText);
     }
 
     private static void initializeSensitivePropertyProvider(String 
encryptionScheme) throws SensitivePropertyProtectionException {
-        if (SENSITIVE_PROPERTY_PROVIDER == null || 
!SENSITIVE_PROPERTY_PROVIDER.getIdentifierKey().equalsIgnoreCase(encryptionScheme))
 {
+        if (SENSITIVE_PROPERTY_PROVIDER == null) {
             try {
-                String keyHex = getMasterKey();
-                SENSITIVE_PROPERTY_PROVIDER_FACTORY = new 
AESSensitivePropertyProviderFactory(keyHex);
-                SENSITIVE_PROPERTY_PROVIDER = 
SENSITIVE_PROPERTY_PROVIDER_FACTORY.getProvider();
+                SENSITIVE_PROPERTY_PROVIDER = 
StandardSensitivePropertyProvider.fromKey(getMasterKey(), encryptionScheme);
 
 Review comment:
   I think we should add this type of test, but I'm not sure how to expose the 
AWS test classes across packages.  I'll open the a ticket to track this for now.

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