rdblue commented on code in PR #6489:
URL: https://github.com/apache/iceberg/pull/6489#discussion_r1056486440


##########
core/src/main/java/org/apache/iceberg/rest/auth/OAuth2Util.java:
##########
@@ -302,8 +318,16 @@ public static OAuthTokenResponse 
tokenResponseFromJson(JsonNode json) {
     return builder.build();
   }
 
+  public static boolean tokenExpired(Optional<JWT> jwt) {
+    return jwt.isPresent()
+        && (jwt.get()
+            .expiredAt(System.currentTimeMillis() + 
AuthSession.MAX_REFRESH_WINDOW_MILLIS));

Review Comment:
   I think that checking whether a token is expired should check the current 
time, not whether it is expected to expire in 5 minutes.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to