Merged
Conversation
ScottMansfield
approved these changes
Apr 1, 2026
Member
ScottMansfield
left a comment
There was a problem hiding this comment.
LGTM with some minor comments.
core/src/auth/credential_service/session_state_credential_service.ts
Outdated
Show resolved
Hide resolved
9a2145c to
d22a0d1
Compare
Open
kalenkevich
added a commit
that referenced
this pull request
Apr 1, 2026
* feat: add auth related base classes
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.
Link to Issue or Description of Change
1. Link to an existing issue (if applicable):
2. Or, if no issue exists, describe the change:
Problem:
The TypeScript SDK was missing several authentication abstractions and features required to align with other language implementations (like the Python ADK). Specifically, it lacked a standard way to manage multiple authentication providers, stateful credential services for persisted sessions, and credential refreshers. Furthermore,
BaseCredentialExchangerdid not report whether a credential was actually exchanged or just passthrough.Solution:
Implemented several new authentication utilities and components to extend the authentication infrastructure within
core/src/auth/and unified them viacommon.tsexports:BaseCredentialExchangerRefactor: Updated theexchangemethod to return anExchangeResultinterface (contains thecredentialand awasExchangedflag), allowing callers to track whether state changes occurred.AuthProviderRegistryandBaseAuthProvider: Centralized registry for managing authentication providers of different schemes.SessionStateCredentialService: For loading/saving credentials from state (enabling persisted tool sessions).CredentialRefresherRegistryandBaseCredentialRefresher: For managing run-time credential renewal.HttpAuth&ServiceAccount: Added support foradditionalHeadersand OIDC identity tokens (supportinguseIdTokenandaudience).AuthHandler,AuthProviderRegistry,AuthSchemes,InMemoryCredentialService,SessionStateCredentialService, andCredentialRefresherRegistry.Testing Plan
Unit Tests:
Unit tests pass via
npm run testfor the auth suite.Manual End-to-End (E2E) Tests:
Not applicable for this structural PR; verification was performed via unit tests and validation of type-safety.
Checklist
Additional context
This PR establishes the foundation for more advanced authentication modules (such as Google/REST API handlers) by providing unified registries and stateful services.