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 2022/11/10 22:12:20 UTC

[GitHub] [nifi] ChrisSamo632 commented on a diff in pull request #6645: NIFI-10794 Made StandardOauth2AccessTokenProvider a verifiable contro…

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


##########
nifi-nar-bundles/nifi-standard-services/nifi-oauth2-provider-bundle/nifi-oauth2-provider-service/src/main/java/org/apache/nifi/oauth2/StandardOauth2AccessTokenProvider.java:
##########
@@ -338,4 +342,20 @@ private boolean isRefreshRequired() {
 
         return Instant.now().isAfter(expirationRefreshTime);
     }
+
+    @Override
+    public List<ConfigVerificationResult> verify(ConfigurationContext context, ComponentLog verificationLogger, Map<String, String> variables) {
+        ConfigVerificationResult.Builder builder = new ConfigVerificationResult.Builder()
+                .verificationStepName("Can acquire token");
+
+        try {
+            getAccessDetails();
+            builder.outcome(ConfigVerificationResult.Outcome.SUCCESSFUL);
+        } catch (Exception ex) {

Review Comment:
   I'm not familiar with what Exceptions might be thrown here, would the message always be appropriate (on its own)?
   
   Would it be sensible to also log the exception, e.g. as a warning with a stacktrace?



-- 
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: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org