Repository navigation
Conversation
lishuxu
force-pushed
the
feature/oauth-2
branch
4 times, most recently
from
October 9, 2026 12:22
672cb4d to
6f4d8c9
Compare
shangxinli
reviewed
Oct 17, 2026
shangxinli
reviewed
Oct 17, 2026
| ICEBERG_ASSIGN_OR_RAISE(auto config, | ||
| ChildConfig(*parent_info, parent_info->credential)); | ||
| ChildConfig(parent_info, parent_info.credential)); | ||
| return MakeSession(response, config, /*keep_refreshed=*/false); |
Contributor
There was a problem hiding this comment.
Token-exchange children are pinned to keep_refreshed false, so an exchanged token just expires. Java builds this one through fromTokenExchange with refreshExecutor at OAuth2Manager.java:271, the same as the credential path, so it should probably follow keep_refreshed_ too.
Contributor
Author
There was a problem hiding this comment.
Agreed, but enabling refresh now would switch the child to the catalog identity, because refresh only uses the parent's credential. I'll enable it once refresh via token exchange lands (TODO in DoRefreshAttempt).
shangxinli
reviewed
Oct 17, 2026
lishuxu
force-pushed
the
feature/oauth-2
branch
from
October 20, 2026 09:48
6b19c11 to
870be7d
Compare
added 2 commits
October 24, 2026 16:51
Cache contextual and table-scoped OAuth2 child sessions so that context credentials do not trigger a token request on every catalog call (apache#962). AuthSessionCache: - Expire entries after auth.session-timeout-ms without access (default 1 hour), and when the token of an OAuth2 session expires. - Load each key once under concurrent Get() calls, with the loader running outside the lock. Failed loads are not cached. - Hand every removed session to the removal listener exactly once. A session loaded after Close() is removed immediately. - Sweep expired entries periodically on the auth refresh executor, every session timeout clamped to [1s, 60s]. Without an executor, entries are reclaimed when accessed again or on Close(). OAuth2Manager: - Cache contextual sessions by session_id and table sessions by token. - Authenticate child token requests with the parent session's headers. - Credential child sessions follow token-refresh-enabled and, with refresh enabled, require the auth executor. Token and exchange child sessions do not refresh until refresh via token exchange is supported. - Token child sessions no longer carry the parent's credential. OAuth2Session: - Add StopRefreshing(), a non-blocking stop used on cache removal. - Add ExpiresAt() and IsRefreshable(), and include the session headers in OAuth2Info().
- Cache table sessions that use typed tokens. The child credential is now selected once by SelectChildCredential, and the table cache key is the value of the token actually used. Previously only the plain token property produced a key, so typed tokens (jwt, id_token, ...) skipped the cache and ran a token exchange on every table load. - Evict only non-refreshable sessions when their token expires. Evicting a refreshable session could land before an in-flight refresh completed and stop refreshing for callers still holding it, such as loaded tables. Refreshable sessions now expire only after the idle timeout.
lishuxu
force-pushed
the
feature/oauth-2
branch
from
October 24, 2026 09:17
870be7d to
21991c0
Compare
Since apache#1033, refreshing a session requires an auth executor. Credential child sessions followed token-refresh-enabled unconditionally, so a static-token catalog without an executor failed to create them. They now refresh only when an executor is provided and otherwise keep their initial token, as before, with a one-time warning.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.