Skip to content

Commit 4e8cf2d

Browse files
authored
Merge branch 'main' into fix/4768-mcp-traceparent
2 parents c002ade + c910961 commit 4e8cf2d

File tree

69 files changed

+6177
-4534
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+6177
-4534
lines changed

.github/workflows/release-cherry-pick.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
cherry-pick:
1919
runs-on: ubuntu-latest
2020
steps:
21-
- uses: actions/checkout@v4
21+
- uses: actions/checkout@v6
2222
with:
2323
ref: release/candidate
2424
fetch-depth: 0

.github/workflows/release-cut.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
cut-release:
1919
runs-on: ubuntu-latest
2020
steps:
21-
- uses: actions/checkout@v4
21+
- uses: actions/checkout@v6
2222
with:
2323
ref: ${{ inputs.commit_sha || 'main' }}
2424

.github/workflows/release-finalize.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
echo "is_release_pr=false" >> $GITHUB_OUTPUT
3030
fi
3131
32-
- uses: actions/checkout@v4
32+
- uses: actions/checkout@v6
3333
if: steps.check.outputs.is_release_pr == 'true'
3434
with:
3535
ref: release/candidate

.github/workflows/release-please.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
echo "exists=false" >> $GITHUB_OUTPUT
2828
fi
2929
30-
- uses: actions/checkout@v4
30+
- uses: actions/checkout@v6
3131
if: steps.check.outputs.exists == 'true'
3232
with:
3333
ref: release/candidate

.github/workflows/release-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
echo "version=$VERSION" >> $GITHUB_OUTPUT
2929
echo "Publishing version: $VERSION"
3030
31-
- uses: actions/checkout@v4
31+
- uses: actions/checkout@v6
3232

3333
- name: Install uv
3434
uses: astral-sh/setup-uv@v4

contributing/samples/gepa/OWNERS

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

scripts/unittests.sh

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,9 @@ restore_venv() {
5858
deactivate
5959
fi
6060

61-
if [[ -d ".unittest_venv" ]]; then
62-
echo "Cleaning up .unittest_venv..."
63-
rm -rf .unittest_venv
64-
fi
61+
echo "Cleaning up temporary directories..."
62+
[[ -n "${VENV_DIR:-}" ]] && rm -rf "$VENV_DIR"
63+
[[ -n "${UV_CACHE_DIR:-}" ]] && rm -rf "$UV_CACHE_DIR"
6564

6665
if [[ -n "$ORIGINAL_VENV" ]]; then
6766
echo "Reactivating pre-existing venv: $ORIGINAL_VENV"
@@ -72,6 +71,15 @@ restore_venv() {
7271
# Ensure the environment is restored when the script exits.
7372
trap restore_venv EXIT
7473

74+
# Temporary directory for the virtual environment.
75+
VENV_DIR=$(mktemp -d "${TMPDIR:-/tmp}/unittest_venv.XXXXXX")
76+
77+
# Move uv cache to temp to prevent workspace bloat and IDE performance issues.
78+
export UV_CACHE_DIR=$(mktemp -d "${TMPDIR:-/tmp}/uv_cache.XXXXXX")
79+
80+
# Force 'copy' mode; hardlinks (uv default) fail on many virtual filesystems.
81+
export UV_LINK_MODE=copy
82+
7583
# 1. deactivate the current venv
7684
if [[ -n "${VIRTUAL_ENV:-}" ]]; then
7785
echo "Deactivating current venv: $VIRTUAL_ENV"
@@ -88,12 +96,12 @@ for version in "${versions_to_run[@]}"; do
8896
echo "=================================================="
8997

9098
# 2. create a unittest_venv just for unit tests
91-
echo "Creating/Using unittest_venv for python${version} in .unittest_venv..."
92-
uv venv --python "${version}" .unittest_venv --clear
93-
source .unittest_venv/bin/activate
99+
echo "Creating/Using unittest_venv for python${version} in $VENV_DIR..."
100+
uv venv --python "${version}" "$VENV_DIR" --clear
101+
source "$VENV_DIR/bin/activate"
94102

95103
# 3. perform the unit tests
96-
echo "Setting up test environment in .unittest_venv..."
104+
echo "Setting up test environment in $VENV_DIR..."
97105
uv sync --extra test --active
98106

99107
echo "Running unit tests..."

src/google/adk/auth/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@
2020
from .auth_schemes import AuthSchemeType
2121
from .auth_schemes import OpenIdConnectWithConfig
2222
from .auth_tool import AuthConfig
23+
from .base_auth_provider import BaseAuthProvider
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Copyright 2026 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
"""Auth provider registry."""
16+
17+
from __future__ import annotations
18+
19+
from ..features import experimental
20+
from ..features import FeatureName
21+
from .auth_schemes import AuthScheme
22+
from .base_auth_provider import BaseAuthProvider
23+
24+
25+
@experimental(FeatureName.PLUGGABLE_AUTH)
26+
class AuthProviderRegistry:
27+
"""Registry for auth provider instances."""
28+
29+
def __init__(self):
30+
self._providers: dict[type[AuthScheme], BaseAuthProvider] = {}
31+
32+
def register(
33+
self,
34+
auth_scheme_type: type[AuthScheme],
35+
provider_instance: BaseAuthProvider,
36+
) -> None:
37+
"""Register a provider instance for an auth scheme type.
38+
39+
Args:
40+
auth_scheme_type: The auth scheme type to register for.
41+
provider_instance: The provider instance to register.
42+
"""
43+
self._providers[auth_scheme_type] = provider_instance
44+
45+
def get_provider(self, auth_scheme: AuthScheme) -> BaseAuthProvider | None:
46+
"""Get the provider instance for an auth scheme.
47+
48+
Args:
49+
auth_scheme: The auth scheme to get provider for.
50+
51+
Returns:
52+
The provider instance if registered, None otherwise.
53+
"""
54+
return self._providers.get(type(auth_scheme))
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Copyright 2026 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
from __future__ import annotations
16+
17+
from abc import ABC
18+
from abc import abstractmethod
19+
20+
from ..agents.callback_context import CallbackContext
21+
from ..features import experimental
22+
from ..features import FeatureName
23+
from .auth_credential import AuthCredential
24+
from .auth_tool import AuthConfig
25+
26+
27+
@experimental(FeatureName.PLUGGABLE_AUTH)
28+
class BaseAuthProvider(ABC):
29+
"""Abstract base class for custom authentication providers."""
30+
31+
@abstractmethod
32+
async def get_auth_credential(
33+
self, auth_config: AuthConfig, context: CallbackContext
34+
) -> AuthCredential | None:
35+
"""Provide an AuthCredential asynchronously.
36+
37+
Args:
38+
auth_config: The current authentication configuration.
39+
context: The current callback context.
40+
41+
Returns:
42+
The retrieved AuthCredential, or None if unavailable.
43+
"""

0 commit comments

Comments
 (0)