Validate if path is within workspace
(path: str)
| 90 | |
| 91 | |
| 92 | def validate_path(path: str) -> Path: |
| 93 | """Validate if path is within workspace""" |
| 94 | if WORKSPACE_DIR is None: |
| 95 | initialize_workspace() |
| 96 | |
| 97 | full_path = (WORKSPACE_DIR / path).resolve() |
| 98 | if not str(full_path).startswith(str(WORKSPACE_DIR)): |
| 99 | raise ValueError(f"Path {path} is outside workspace scope") |
| 100 | return full_path |
| 101 | |
| 102 | |
| 103 | def log_operation(action: str, details: Dict[str, Any]): |
no test coverage detected