Skip to content

Commit ab7d3a9

Browse files
author
shuxu.li
committed
feat(rest): implement OAuth2 token auto-refresh for REST catalog
Replace the MakeOAuth2 stub with a full OAuth2AuthSession that automatically refreshes tokens before expiration using the client_credentials grant.
1 parent f1dc76a commit ab7d3a9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/iceberg/catalog/rest/auth/auth_session.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ class OAuth2AuthSession : public AuthSession,
141141
props.Set(AuthProperties::kScope, config_.scope);
142142
props.Set(AuthProperties::kOAuth2ServerUri, config_.token_endpoint);
143143
for (const auto& [key, value] : config_.optional_oauth_params) {
144-
props.mutable_configs()[key] = value;
144+
props.mutable_configs().insert_or_assign(key, value);
145145
}
146146

147147
auto result = FetchToken(client_, *empty_session, props);

0 commit comments

Comments
 (0)