rdblue commented on code in PR #6489:
URL: https://github.com/apache/iceberg/pull/6489#discussion_r1056496246
##########
core/src/main/java/org/apache/iceberg/rest/RESTSessionCatalog.java:
##########
@@ -787,9 +762,39 @@ private static ConfigResponse fetchConfig(
private AuthSession newSession(
Map<String, String> credentials, Map<String, String> properties,
AuthSession parent) {
if (credentials != null) {
- // use the bearer token without exchanging
if (credentials.containsKey(OAuth2Properties.TOKEN)) {
- return newSession(credentials.get(OAuth2Properties.TOKEN),
expiresInMs(properties), parent);
+ String token = credentials.get(OAuth2Properties.TOKEN);
+ Optional<JWT> jwt = JWT.of(token);
+
+ if (OAuth2Util.tokenExpired(jwt)) {
Review Comment:
The logic for token expiration should be handled in `sessionFromToken` and
other OAuth2Util methods.
--
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]