Documentation
¶
Overview ¶
Package pathutil provides utilities for safe path handling.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustSanitizeName ¶
func MustSanitizeName(name string)
MustSanitizeName is like SanitizeName but panics on error. Use only in contexts where the name has already been validated.
func SanitizeName ¶
SanitizeName validates and sanitizes a resource name (server, command, skill, rule) to prevent path traversal attacks when used in filepath.Join().
The function: - Rejects empty names - Rejects names containing path separators (/, \) - Rejects names containing ".." sequences - Rejects names that don't match the safe character pattern
Returns an error if the name is invalid.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.