Skip to main content

Module path_jail

Module path_jail 

Source

Functionsยง

canonical_workspace_root
Canonicalize a workspace root directory.
discover_git_repo_root
Discover a git repository root from any of the given workspace paths.
ensure_extract_path_within
Resolve a relative path for extraction under extract_root (e.g. git tree checkout).
file_uri_to_path
Resolve a file:// URI to a path (not necessarily canonical).
is_path_within
Returns true if path is workspace_root or nested under it.
is_path_within_any
Returns true if path is under any of the workspace roots.
path_has_parent_escape
Reject paths that escape upward via .. before canonicalize (symlink-free check).
paths_refer_to_same
True when two paths refer to the same filesystem location.
resolve_document_path
Resolve a document URI and ensure it lies under workspace_root (both canonical).
resolve_lsp_document_path
Resolve an LSP document URI under workspace_root without requiring the file to exist.
resolve_lsp_document_path_any
Resolve an LSP document URI under any registered workspace root.
validate_workspace_scope
Ensure path is the workspace root or a subdirectory of it (after canonicalization).
validate_workspace_scope_any
Ensure path is under at least one workspace root.
workspace_uri_to_path
Resolve a file:// workspace URI to a canonical directory path.