You've already forked adk-python
mirror of
https://github.com/encounter/adk-python.git
synced 2026-03-30 10:57:20 -07:00
fix: Initialize self._auth_config inside BaseAuthenticatedTool
So that we can access self._auth_config in McpTool for getting auth headers Co-authored-by: Kathy Wu <wukathy@google.com> PiperOrigin-RevId: 856451693
This commit is contained in:
committed by
Copybara-Service
parent
cce430da79
commit
d4da1bb733
@@ -66,6 +66,7 @@ class BaseAuthenticatedTool(BaseTool):
|
||||
name=name,
|
||||
description=description,
|
||||
)
|
||||
self._auth_config = auth_config
|
||||
|
||||
if auth_config and auth_config.auth_scheme:
|
||||
self._credentials_manager = CredentialManager(auth_config=auth_config)
|
||||
|
||||
@@ -90,6 +90,7 @@ class TestBaseAuthenticatedTool:
|
||||
assert tool.description == "Test description"
|
||||
assert tool._credentials_manager is not None
|
||||
assert tool._response_for_auth_required == unauthenticated_response
|
||||
assert tool._auth_config == auth_config
|
||||
|
||||
def test_init_with_no_auth_config(self):
|
||||
"""Test initialization without auth_config."""
|
||||
@@ -99,6 +100,7 @@ class TestBaseAuthenticatedTool:
|
||||
assert tool.description == "Test authenticated tool"
|
||||
assert tool._credentials_manager is None
|
||||
assert tool._response_for_auth_required is None
|
||||
assert tool._auth_config is None
|
||||
|
||||
def test_init_with_empty_auth_scheme(self):
|
||||
"""Test initialization with auth_config but no auth_scheme."""
|
||||
|
||||
Reference in New Issue
Block a user