diff --git a/paimon-core/src/main/java/org/apache/paimon/rest/auth/AuthSession.java b/paimon-core/src/main/java/org/apache/paimon/rest/auth/AuthSession.java index a3e34ac532df..29b4b7272c01 100644 --- a/paimon-core/src/main/java/org/apache/paimon/rest/auth/AuthSession.java +++ b/paimon-core/src/main/java/org/apache/paimon/rest/auth/AuthSession.java @@ -86,7 +86,7 @@ private static void scheduleTokenRefresh( int retryTimes) { if (retryTimes < TOKEN_REFRESH_NUM_RETRIES) { long expiresInMillis = expiresAtMillis - System.currentTimeMillis(); - // how much ahead of time to start the request to allow it to complete + // how much ahead of time to start the refresh to allow it to complete long refreshWindowMillis = Math.min(expiresInMillis, MAX_REFRESH_WINDOW_MILLIS); // how much time to wait before expiration long waitIntervalMillis = expiresInMillis - refreshWindowMillis; diff --git a/paimon-core/src/main/java/org/apache/paimon/rest/auth/BearTokenCredentialsProvider.java b/paimon-core/src/main/java/org/apache/paimon/rest/auth/BearTokenCredentialsProvider.java index dfe9725fbf39..89228fe10b28 100644 --- a/paimon-core/src/main/java/org/apache/paimon/rest/auth/BearTokenCredentialsProvider.java +++ b/paimon-core/src/main/java/org/apache/paimon/rest/auth/BearTokenCredentialsProvider.java @@ -18,19 +18,13 @@ package org.apache.paimon.rest.auth; -import org.apache.paimon.utils.StringUtils; - /** credentials provider for bear token. */ public class BearTokenCredentialsProvider extends BaseBearTokenCredentialsProvider { private final String token; public BearTokenCredentialsProvider(String token) { - if (StringUtils.isNullOrWhitespaceOnly(token)) { - throw new IllegalArgumentException("token is null"); - } else { - this.token = token; - } + this.token = token; } @Override