nastra commented on code in PR #18910:
URL: https://github.com/apache/iceberg/pull/18910#discussion_r4697067014
##########
core/src/main/java/org/apache/iceberg/rest/auth/OAuth2Util.java:
##########
@@ -627,15 +636,10 @@ public static AuthSession fromAccessToken(
if (null != expiresAtMillis && expiresAtMillis <= startTimeMillis) {
Pair<Integer, TimeUnit> expiration = session.refresh(client);
- // if expiration is non-null, then token refresh was successful
+ // if expiration is non-null, the response carried expires_in, so
refresh() has stored a
+ // non-null expiry on the session (from the token's exp claim or from
expires_in)
if (expiration != null) {
- if (null != session.expiresAtMillis()) {
- // use the new expiration time from the refreshed token
- expiresAtMillis = session.expiresAtMillis();
- } else {
- // otherwise use the expiration time from the token response
- expiresAtMillis = startTimeMillis +
expiration.second().toMillis(expiration.first());
- }
+ expiresAtMillis = session.expiresAtMillis();
Review Comment:
I believe we need to adjust this in `scheduleTokenRefresh()` in
`refreshStartTime + expiration.second().toMillis(expiration.first()))` as well?
--
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]