c-thiel opened a new pull request, #3769: URL: https://github.com/apache/iceberg-rust/pull/3769
## Which issue does this PR close? - Closes #3768. ## What changes are included in this PR? An auth session can now recover when the server rejects its token with 401 or 419. The built-in OAuth2 session does so when it has a client credential. - New `AuthSession::on_unauthorized` hook. If it returns `UnauthorizedAction::Retry`, the request is authenticated again and sent once more. The default keeps the rejection, so existing sessions are unchanged. - `OAuth2Session` with a client credential drops the rejected token, so the retry fetches a new one. Concurrent rejections share one token fetch. - Behaviour change: with both `token` and `credential` configured, the credential takes over once the token is rejected. Java has no such hook; it refreshes tokens before they expire. That is still a TODO here and complements this change, but it cannot help with revoked tokens. ## Are these changes tested? Yes: unit tests for the retry in `HttpClient` and for the OAuth2 hook, plus two end-to-end catalog tests (a rejected token is replaced; 8 concurrent rejections cause one token fetch). ## AI Disclosure Supported by Claude Code. Reviewed and checked by me. -- 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]
