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 2020/07/06 17:55:21 UTC

[GitHub] [nifi] MuazmaZ commented on a change in pull request #4369: NIFI-7581 Add CS-based credential settings support for ADLS processors

MuazmaZ commented on a change in pull request #4369:
URL: https://github.com/apache/nifi/pull/4369#discussion_r450387709



##########
File path: nifi-nar-bundles/nifi-azure-bundle/nifi-azure-processors/src/main/java/org/apache/nifi/processors/azure/AbstractAzureDataLakeStorageProcessor.java
##########
@@ -158,41 +173,51 @@
     public static Collection<ValidationResult> validateCredentialProperties(final ValidationContext validationContext) {
         final List<ValidationResult> results = new ArrayList<>();
 
-        final boolean useManagedIdentity = validationContext.getProperty(USE_MANAGED_IDENTITY).asBoolean();
-        final boolean accountKeyIsSet  = validationContext.getProperty(ACCOUNT_KEY).isSet();
-        final boolean sasTokenIsSet     = validationContext.getProperty(SAS_TOKEN).isSet();
-
-        int credential_config_found = 0;
-        if(useManagedIdentity) credential_config_found++;
-        if(accountKeyIsSet) credential_config_found++;
-        if(sasTokenIsSet) credential_config_found++;
-
-        if(credential_config_found == 0){
-            final String msg = String.format(
-                "At least one of ['%s', '%s', '%s'] should be set",
-                ACCOUNT_KEY.getDisplayName(),
-                SAS_TOKEN.getDisplayName(),
-                USE_MANAGED_IDENTITY.getDisplayName()
-            );
-            results.add(new ValidationResult.Builder().subject("Credentials config").valid(false).explanation(msg).build());
-        } else if(credential_config_found > 1) {
-            final String msg = String.format(
-                "Only one of ['%s', '%s', '%s'] should be set",
-                ACCOUNT_KEY.getDisplayName(),
-                SAS_TOKEN.getDisplayName(),
-                USE_MANAGED_IDENTITY.getDisplayName()
-            );
-            results.add(new ValidationResult.Builder().subject("Credentials config").valid(false).explanation(msg).build());
+        if (!validationContext.getProperty(AzureStorageUtils.STORAGE_CREDENTIALS_SERVICE).isSet()) {

Review comment:
       @tpalfy makes sense to me especially if that is the pattern for the newer processor.




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