nastra commented on code in PR #12555:
URL: https://github.com/apache/iceberg/pull/12555#discussion_r2011767343


##########
core/src/main/java/org/apache/iceberg/rest/auth/OAuth2Manager.java:
##########
@@ -64,18 +65,89 @@ public class OAuth2Manager extends RefreshingAuthManager {
   private AuthSessionCache sessionCache;
 
   public OAuth2Manager(String managerName) {
-    super(managerName + "-token-refresh");
+    super(managerName);
     this.name = managerName;
   }
 
   @Override
+  public OAuth2Manager withClient(RESTClient restClient) {
+    Preconditions.checkNotNull(restClient, "invalid restClient: null");
+    refreshClient = restClient.withAuthSession(AuthSession.EMPTY);
+    return this;
+  }
+
+  @Override
+  public OAuth2Util.AuthSession authSession(AuthScope scope) {
+    Preconditions.checkNotNull(scope, "invalid scope: null");
+    Preconditions.checkState(
+        refreshClient != null, "cannot create AuthSession: no RESTClient 
available");
+    if (sessionCache == null) {
+      sessionCache = newSessionCache(name, scope.properties());
+    }

Review Comment:
   nit: newline



-- 
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-unsubscr...@iceberg.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to