From 5e09533df210f965b3b8ce50b50cd05278fc82f1 Mon Sep 17 00:00:00 2001 From: yantian Date: Mon, 9 Dec 2024 16:02:51 +0800 Subject: [PATCH] update comment in AuthSession and delete validate in BearTokenCredentialsProvider --- .../java/org/apache/paimon/rest/auth/AuthSession.java | 2 +- .../paimon/rest/auth/BearTokenCredentialsProvider.java | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) 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