Expand description
Shared path resolution utilities for tool implementations.
Path resolution functions (expand_home, strip_curdir, normalize_path,
resolve_file_path, resolve_dir_path) are defined in opendev-tools-core::path
and re-exported here for backward compatibility. This module additionally provides
security-boundary functions (validate_path_access, is_sensitive_file) that
are tool-level concerns.
Functionsยง
- expand_
home - Expand tilde (
~) and$HOMEprefixes in a path string. - is_
sensitive_ file - Check if a file is likely to contain sensitive data (secrets, credentials, keys).
- normalize_
path - Normalize a path by collapsing
.and..components without touching the filesystem. - resolve_
dir_ path - Resolve a user-provided directory path against the working directory.
- resolve_
file_ path - Resolve a user-provided file path against the working directory.
- strip_
curdir - Strip leading
.and./components from a path, returning the meaningful portion. E.g.,./myproject/src->myproject/src. - validate_
path_ access - Validate that a resolved path is safe to access.