Repository navigation
Conversation
uros-b
left a comment
There was a problem hiding this comment.
@waterWang Is this already in progress (#17601)? cc @bharos
@waterWang I already have a PR out for the fix. |
|
This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@iceberg.apache.org list. Thank you for your contributions. |
|
This pull request has been closed due to lack of activity. This is not a judgement on the merit of the PR in any way. It is just a way of keeping the PR queue manageable. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time. |
Fixes #17600
Problem
When
token-exchange-enabledis set tofalse, a session created by token exchange (AuthSession.fromTokenExchange) inherits the parent catalog config — includingcredentialandexchangeEnabled=false. On refresh,OAuth2Util.refreshTokenchecksexchangeEnabled, finds itfalse, and falls back to theclient_credentialsflow using the inherited credential. The refreshed token now identifies the catalog client rather than the exchanged subject, silently changing the session identity.Root cause
AuthSession.fromTokenExchangecallsfromTokenResponse, which copies the parent config viaAuthConfig.builder().from(parent.config()). This propagates bothcredentialandexchangeEnabled=falseto the child session. TheexchangeEnabledflag was intended by #13809 to control how credential-derived sessions refresh, but applying it to token-exchange-derived sessions changes which principal the session represents.Fix
After building the session from
fromTokenResponse, clear the inheritedcredentialand setexchangeEnabled=trueon the child session. This ensures that:exchangeEnabledflag only affects catalog-level credential-derived sessions as intended