amogh-jahagirdar commented on code in PR #10161:
URL: https://github.com/apache/iceberg/pull/10161#discussion_r1606204569


##########
core/src/main/java/org/apache/iceberg/rest/auth/OAuth2Util.java:
##########
@@ -458,32 +458,11 @@ public static class AuthSession {
     private static final long MAX_REFRESH_WINDOW_MILLIS = 300_000; // 5 minutes
     private static final long MIN_REFRESH_WAIT_MILLIS = 10;
     private volatile Map<String, String> headers;
-    private volatile String token;
-    private volatile String tokenType;
-    private volatile Long expiresAtMillis;
-    private final String credential;
-    private final String scope;
-    private volatile boolean keepRefreshed = true;
-    private final String oauth2ServerUri;
+    private volatile AuthConfig config;
 
-    private Map<String, String> optionalOAuthParams = ImmutableMap.of();
-
-    public AuthSession(
-        Map<String, String> baseHeaders,
-        String token,
-        String tokenType,
-        String credential,
-        String scope,
-        String oauth2ServerUri,
-        Map<String, String> optionalOAuthParams) {
-      this.headers = RESTUtil.merge(baseHeaders, authHeaders(token));
-      this.token = token;
-      this.tokenType = tokenType;
-      this.expiresAtMillis = OAuth2Util.expiresAtMillis(token);
-      this.credential = credential;
-      this.scope = scope;
-      this.oauth2ServerUri = oauth2ServerUri;
-      this.optionalOAuthParams = optionalOAuthParams;
+    public AuthSession(Map<String, String> baseHeaders, AuthConfig config) {
+      this.headers = RESTUtil.merge(baseHeaders, authHeaders(config.token()));
+      this.config = config;

Review Comment:
   Since it's public, unfortunately I don't think we can remove this 
constructor just yet, I think we'll have to deprecate like the other 
constructors.



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