feat: add auth preprocessor and update auth handler.#227
Open
kalenkevich wants to merge 3 commits intofeat/oauth_part2from
Open
feat: add auth preprocessor and update auth handler.#227kalenkevich wants to merge 3 commits intofeat/oauth_part2from
kalenkevich wants to merge 3 commits intofeat/oauth_part2from
Conversation
2aec29d to
14b0376
Compare
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.
Overview
This PR improves the test coverage and fixes inconsistencies in the authentication handling logic for the ADK-JS project. It addresses a bug in
AuthHandlerwhere exchange results were stored incorrectly, enhances existing tests to verify actual generated values (like URLs and states), and introduces a new unit test suite for theAuthPreprocessor.Key Changes
Bug Fixes
AuthHandler
parseAndStoreAuthResponsewhere the fullExchangeResultobject was unintentionally stored in session state. Now, it correctly stores only the nestedAuthCredential(exchangedCredential.credential), aligning with howgetAuthResponseretrieves it.Testing Enhancements
AuthHandler Tests
parseAndStoreAuthResponseto cover:generateAuthUritests now assert the actual generated URL string and query parameters (such asclient_id,redirect_uri,scope, and dynamicstate) rather than returning stubs.generateAuthRequesttests assert usage of the generated credentials.[NEW] AuthPreprocessor Tests
AuthPreprocessor.runAsyncgenerator logic:LlmAgent.adk_request_credentialtool-resume responses.handleFunctionCallsAsync.handleFunctionCallsAsync.