exceptionfactory commented on code in PR #9822:
URL: https://github.com/apache/nifi/pull/9822#discussion_r2015322174


##########
nifi-extension-bundles/nifi-standard-services/nifi-oauth2-provider-api/src/main/java/org/apache/nifi/oauth2/OAuth2AccessTokenProvider.java:
##########
@@ -27,4 +27,14 @@ public interface OAuth2AccessTokenProvider extends 
ControllerService {
      * @return A valid access token (refreshed automatically if needed) and 
additional metadata (provided by the OAuth2 access server)
      */
     AccessToken getAccessDetails();
+
+    /**
+     * @param forceAccessTokenRefresh true if the access token should be 
refreshed
+     *                                even if it is not expired
+     * @return A valid access token (refreshed automatically if needed) and
+     *         additional metadata (provided by the OAuth2 access server)
+     */
+    default AccessToken getAccessDetails(final boolean 
forceAccessTokenRefresh) {

Review Comment:
   Instead of adding this new method and option, what do you think about 
promoting `refreshAccessDetails()` as an interface method? This would require 
calling both `refreshAccessDetails()` and then `getAccessDetails()`, but it 
would clarify that these are separate actions, the first of which could fail, 
allowing the caller to determine the desired behavior. The default 
implementation could be nothing, making it easier for third-party 
implementations to implement when desired, aligning with the optional usage of 
the new Token Refresh Strategy.



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