(root_dir: Path, rel_path: str)
| 196 | return file_path |
| 197 | |
| 198 | def _resolve_under_dir(root_dir: Path, rel_path: str) -> Path: |
| 199 | file_path = root_dir / rel_path |
| 200 | resolved_root_dir = root_dir.resolve() |
| 201 | resolved_file_path = file_path.resolve() |
| 202 | if not resolved_file_path.is_relative_to(resolved_root_dir): |
| 203 | raise ValueError(f"Path escapes root_dir: {rel_path!r}") |
| 204 | return file_path |
| 205 | |
| 206 | def _get_tmp_agent_root(app_root: Path, app_name: str) -> Path: |
| 207 | tmp_agent_root = app_root / "tmp" / app_name |
no test coverage detected