ChrisSamo632 commented on code in PR #9605:
URL: https://github.com/apache/nifi/pull/9605#discussion_r1927647640


##########
nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-client-service/src/main/java/org/apache/nifi/elasticsearch/ElasticSearchClientServiceImpl.java:
##########
@@ -153,6 +160,23 @@ protected Collection<ValidationResult> 
customValidate(final ValidationContext va
             );
         }
 
+        if (authorizationScheme == AuthorizationScheme.JWT) {
+            if (oAuth2Provider == null) {
+                results.add(new 
ValidationResult.Builder().subject(OAUTH2_ACCESS_TOKEN_PROVIDER.getName()).valid(false)
+                        .explanation(String.format("if '%s' is '%s' then '%s' 
must be set.",
+                                AUTHORIZATION_SCHEME.getDisplayName(), 
authorizationScheme.getDisplayName(), 
OAUTH2_ACCESS_TOKEN_PROVIDER.getDisplayName())
+                        ).build()
+                );
+            }
+            if (!jwtSharedSecretSet) {
+                results.add(new 
ValidationResult.Builder().subject(JWT_SHARED_SECRET.getName()).valid(false)
+                        .explanation(String.format("if '%s' is '%s' then '%s' 
must be set.",
+                                AUTHORIZATION_SCHEME.getDisplayName(), 
authorizationScheme.getDisplayName(), JWT_SHARED_SECRET.getDisplayName())
+                        ).build()
+                );
+            }
+        }

Review Comment:
   I took the opportunity to update the `BASIC` and `API_KEY` auth types too - 
I think we can get rid of those custom validations now too (with the associated 
`dependsOn` settings for those)



##########
nifi-extension-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-client-service/pom.xml:
##########
@@ -83,23 +87,11 @@
             <artifactId>jackson-annotations</artifactId>
             <scope>provided</scope>
         </dependency>
-        <dependency>
-            <groupId>commons-io</groupId>
-            <artifactId>commons-io</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.commons</groupId>
-            <artifactId>commons-compress</artifactId>
-        </dependency>

Review Comment:
   IntelliJ reports that these dependencies are duplicated or not used here.
   
   It looks like these are now inherited through the 
`nifi-elasticsearch-bundle`, which itself extends the 
`nifi-standard-shared-bom`, which provides these standard dependencies.
   
   But this could be a mistake, I'm happy to add them back in if you think this 
might be an issue (I'm a little rusty on nested POMs) - things seem to be 
working OK when I run some tests though at least



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to