Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidGitURL = fmt.Errorf("invalid git URL")
ErrInvalidGitURL indicates an invalid or unsafe Git URL.
var ErrInvalidPath = fmt.Errorf("invalid path")
ErrInvalidPath indicates an invalid path.
var ErrPathTraversal = fmt.Errorf("path traversal detected")
ErrPathTraversal indicates a path traversal attempt was detected.
Functions ¶
func SanitizePath ¶
SanitizePath cleans a path and returns the sanitized version. Returns an error if the path is invalid.
func ValidateDirectory ¶
ValidateDirectory validates that a directory path is safe. It cleans the path and ensures it doesn't escape the intended boundary.
func ValidateGitURL ¶
ValidateGitURL ensures the URL is safe to use with git clone. It validates the URL format and restricts to safe schemes (https, git, ssh). Local filesystem paths are also allowed for cloning local repositories.
func ValidateLocalPath ¶
ValidateLocalPath ensures a path doesn't contain traversal attempts. It allows both relative and absolute paths but rejects traversal patterns.
Types ¶
This section is empty.