adutra commented on code in PR #10753:
URL: https://github.com/apache/iceberg/pull/10753#discussion_r1877564371
##########
aws/src/main/java/org/apache/iceberg/aws/s3/signer/S3V4RestSignerClient.java:
##########
@@ -204,73 +185,51 @@ private AuthSession authSession() {
String token = token().get();
if (null != token) {
return authSessionCache()
- .get(
+ .cachedSession(
token,
- id ->
- AuthSession.fromAccessToken(
- httpClient(),
- tokenRefreshExecutor(),
- token,
- expiresAtMillis(properties()),
- new AuthSession(
- ImmutableMap.of(),
- AuthConfig.builder()
- .token(token)
- .credential(credential())
- .scope(SCOPE)
- .oauth2ServerUri(oauth2ServerUri())
- .optionalOAuthParams(optionalOAuthParams())
- .build())));
+ () -> {
+ Map<String, String> properties =
+ ImmutableMap.<String, String>builder()
+ .putAll(properties())
+ .putAll(optionalOAuthParams())
+ .put(OAuth2Properties.OAUTH2_SERVER_URI,
oauth2ServerUri())
+ .put(
+ OAuth2Properties.TOKEN_REFRESH_ENABLED,
+ String.valueOf(keepTokenRefreshed()))
+ .put(OAuth2Properties.TOKEN, token)
+ .put(OAuth2Properties.SCOPE, SCOPE)
+ .buildKeepingLast();
+ return authManager().catalogSession(httpClient(), properties);
Review Comment:
I think not, because in spite of its generic name, `AuthConfig` is only
meaningful for the OAuth2 scheme. It doesn't make sense e.g. for SigV4.
--
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]