Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/check-file-contents.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ jobs:
# 1. Identify files containing any googleapis.com URL.
set +e
FILES_WITH_ENDPOINTS=$(grep -lE 'https?://[a-zA-Z0-9.-]+\.googleapis\.com' $CHANGED_FILES)

# 2. From those, identify files that are MISSING the required mTLS version.
if [ -n "$FILES_WITH_ENDPOINTS" ]; then
FILES_MISSING_MTLS=$(grep -L '.mtls.googleapis.com' $FILES_WITH_ENDPOINTS)
Expand Down
21 changes: 14 additions & 7 deletions src/google/adk/agents/config_agent_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,14 +538,21 @@ def resolve_agent_reference(
"""
if ref_config.config_path:
if os.path.isabs(ref_config.config_path):
return from_config(ref_config.config_path)
else:
return from_config(
os.path.join(
os.path.dirname(referencing_agent_config_abs_path),
ref_config.config_path,
)
raise ValueError(
"Absolute paths are not allowed in AgentTool config_path:"
f" {ref_config.config_path!r}"
)
agent_dir = os.path.dirname(referencing_agent_config_abs_path)
resolved_path = os.path.normpath(
os.path.join(agent_dir, ref_config.config_path)
)
canonical_agent_dir = os.path.normpath(agent_dir)
if not resolved_path.startswith(canonical_agent_dir + os.path.sep):
raise ValueError(
f"Path traversal detected: config_path {ref_config.config_path!r}"
" resolves outside the agent directory"
)
return from_config(resolved_path)
elif ref_config.code:
return _resolve_agent_code_reference(ref_config.code)
else:
Expand Down
3 changes: 2 additions & 1 deletion src/google/adk/cli/utils/evals.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
from __future__ import annotations

import os
from typing import Any, TYPE_CHECKING
from typing import Any
from typing import TYPE_CHECKING

from pydantic import alias_generators
from pydantic import BaseModel
Expand Down
2 changes: 0 additions & 2 deletions tests/unittests/skills/test__utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,5 +393,3 @@ def mock_import(name, globals=None, locals=None, fromlist=(), level=0):
with mock.patch("builtins.__import__", mock_import):
with pytest.raises(ImportError, match="google-cloud-storage is required"):
_load_skill_from_gcs_dir("my-bucket", "skills/my-skill/")


Loading