Documentation
¶
Overview ¶
Package pathutil provides shared path security utilities.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrPathTraversal = errors.New("path traversal detected") ErrPathOutsideBase = errors.New("path outside allowed base directory") )
Security-related errors.
Functions ¶
func ContainsTraversal ¶
ContainsTraversal checks if a path contains obvious traversal patterns.
func SanitizeError ¶
SanitizeError returns a user-safe error message that doesn't expose sensitive path information. The original error is preserved for logging. Use this when returning errors that might contain full file paths.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.