Repository navigation
fix: add directory traversal restriction for local_path in save_prese… - #2765
whisper88-lgtm wants to merge 7 commits into
Conversation
|
Ready for review. All checks pass and the review comments are resolved. Re-requested review from |
|
@happyhuman fixed https://buganizer.corp.google.com/issues/565095907, please review. Thanks so much! |
happyhuman
left a comment
There was a problem hiding this comment.
Just reviewed the PR and left a few comments. PTAL
| if not local_path: | ||
| return "Error: No local file path provided." | ||
|
|
||
| base_dir = Path.cwd().resolve() |
There was a problem hiding this comment.
get_artifact_as_local_path and get_gcs_file_as_local_path above both hand back tempfile.NamedTemporaryFile paths. Do those ever land under Path.cwd()?
| # Subdirectory inside current directory (exists, but is not a file) | ||
| test_subdir = tmp_path / "subdir" | ||
| test_subdir.mkdir(parents=True, exist_ok=True) | ||
| from unittest.mock import patch |
There was a problem hiding this comment.
Can we move patch into the unittest.mock import at the top?
|
|
||
| """Attach A2A (Agent2Agent) endpoints to the FastAPI app. | ||
|
|
||
| func:`attach_a2a_routes` registers the dynamic |
There was a problem hiding this comment.
func: is missing its leading colon
|
|
||
| COPY ./pyproject.toml ./README.md ./uv.lock* ./ | ||
|
|
||
| COPY ./app ./app |
There was a problem hiding this comment.
pyproject.toml lists packages = ["eval", "app"] under [tool.hatch.build.targets.wheel], but only ./app is copied here. Should pyproject.toml only package app, or does ./eval need to be copied before uv sync --frozen?
The PR/commit is resolving the unconstrained local_path.