Skip to content

Commit fbe7659

Browse files
google-genai-botcopybara-github
authored andcommitted
ADK changes
PiperOrigin-RevId: 886119834
1 parent 78e5a90 commit fbe7659

8 files changed

Lines changed: 2 additions & 173 deletions

File tree

src/google/adk/auth/auth_schemes.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
from fastapi.openapi.models import SecuritySchemeType
2727
from pydantic import Field
2828

29-
from ..integrations._iam_connectors.gcp_iam_connector_auth import GcpIamConnectorAuth
3029
from ..utils.feature_decorator import experimental
3130

3231

@@ -43,9 +42,8 @@ class OpenIdConnectWithConfig(SecurityBase):
4342
scopes: Optional[List[str]] = None
4443

4544

46-
# AuthSchemes contains SecuritySchemes from OpenAPI 3.0, an extra flattened
47-
# OpenIdConnectWithConfig, and GCP managed auth.
48-
AuthScheme = Union[SecurityScheme, OpenIdConnectWithConfig, GcpIamConnectorAuth]
45+
# AuthSchemes contains SecuritySchemes from OpenAPI 3.0 and an extra flattened OpenIdConnectWithConfig.
46+
AuthScheme = Union[SecurityScheme, OpenIdConnectWithConfig]
4947

5048

5149
class OAuthGrantType(str, Enum):

src/google/adk/auth/credential_manager.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@
2020
from fastapi.openapi.models import OAuth2
2121

2222
from ..agents.callback_context import CallbackContext
23-
from ..features import FeatureName
24-
from ..features import is_feature_enabled
25-
from ..integrations._iam_connectors.gcp_auth_provider import GcpAuthProvider
26-
from ..integrations._iam_connectors.gcp_iam_connector_auth import GcpIamConnectorAuth
2723
from ..tools.openapi_tool.auth.credential_exchangers.service_account_exchanger import ServiceAccountCredentialExchanger
2824
from ..utils.feature_decorator import experimental
2925
from .auth_credential import AuthCredential
@@ -91,12 +87,6 @@ def __init__(
9187
self._refresher_registry = CredentialRefresherRegistry()
9288
self._discovery_manager = OAuth2DiscoveryManager()
9389

94-
# Register auth providers
95-
if is_feature_enabled(FeatureName.GCP_IAM_CONNECTOR_AUTH):
96-
self._auth_provider_registry.register(
97-
GcpIamConnectorAuth, GcpAuthProvider()
98-
)
99-
10090
# Register default exchangers and refreshers
10191
from .exchanger.oauth2_credential_exchanger import OAuth2CredentialExchanger
10292
from .refresher.oauth2_credential_refresher import OAuth2CredentialRefresher

src/google/adk/features/_feature_registry.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ class FeatureName(str, Enum):
3838
DATA_AGENT_TOOL_CONFIG = "DATA_AGENT_TOOL_CONFIG"
3939
DATA_AGENT_TOOLSET = "DATA_AGENT_TOOLSET"
4040
ENVIRONMENT_SIMULATION = "ENVIRONMENT_SIMULATION"
41-
GCP_IAM_CONNECTOR_AUTH = "GCP_IAM_CONNECTOR_AUTH"
4241
GOOGLE_CREDENTIALS_CONFIG = "GOOGLE_CREDENTIALS_CONFIG"
4342
GOOGLE_TOOL = "GOOGLE_TOOL"
4443
JSON_SCHEMA_FOR_FUNC_DECL = "JSON_SCHEMA_FOR_FUNC_DECL"
@@ -127,9 +126,6 @@ class FeatureConfig:
127126
FeatureName.GOOGLE_TOOL: FeatureConfig(
128127
FeatureStage.EXPERIMENTAL, default_on=True
129128
),
130-
FeatureName.GCP_IAM_CONNECTOR_AUTH: FeatureConfig(
131-
FeatureStage.EXPERIMENTAL, default_on=False
132-
),
133129
FeatureName.JSON_SCHEMA_FOR_FUNC_DECL: FeatureConfig(
134130
FeatureStage.WIP, default_on=False
135131
),

src/google/adk/integrations/_iam_connectors/README.md

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/google/adk/integrations/_iam_connectors/__init__.py

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/google/adk/integrations/_iam_connectors/gcp_auth_provider.py

Lines changed: 0 additions & 40 deletions
This file was deleted.

src/google/adk/integrations/_iam_connectors/gcp_iam_connector_auth.py

Lines changed: 0 additions & 57 deletions
This file was deleted.

tests/unittests/auth/test_credential_manager.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@
3737
from google.adk.auth.credential_manager import CredentialManager
3838
from google.adk.auth.credential_manager import ServiceAccountCredentialExchanger
3939
from google.adk.auth.oauth2_discovery import AuthorizationServerMetadata
40-
from google.adk.features import FeatureName
41-
from google.adk.features._feature_registry import temporary_feature_override
42-
from google.adk.integrations._iam_connectors import GcpIamConnectorAuth
43-
from google.adk.integrations._iam_connectors.gcp_auth_provider import GcpAuthProvider
4440
from google.adk.sessions.in_memory_session_service import InMemorySessionService
4541
from google.adk.tools.tool_context import ToolContext
4642
import pytest
@@ -51,28 +47,12 @@
5147
class TestCredentialManager:
5248
"""Test suite for CredentialManager."""
5349

54-
@pytest.fixture(autouse=True)
55-
def enable_gcp_iam_connector_auth(self):
56-
with temporary_feature_override(FeatureName.GCP_IAM_CONNECTOR_AUTH, True):
57-
yield
58-
5950
def test_init(self):
6051
"""Test CredentialManager initialization."""
6152
auth_config = Mock(spec=AuthConfig)
6253
manager = CredentialManager(auth_config)
6354
assert manager._auth_config == auth_config
6455

65-
def test_init_registers_gcp_auth_provider(self):
66-
"""Test that GcpIamConnectorAuth is registered with GcpAuthProvider."""
67-
auth_config = Mock(spec=AuthConfig)
68-
manager = CredentialManager(auth_config)
69-
70-
provider = manager._auth_provider_registry.get_provider(
71-
GcpIamConnectorAuth(connector_name="test")
72-
)
73-
74-
assert isinstance(provider, GcpAuthProvider)
75-
7656
@pytest.mark.asyncio
7757
async def test_request_credential(self):
7858
"""Test request_credential method."""

0 commit comments

Comments
 (0)