pathutil

package
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package pathutil provides path validation and traversal detection utilities.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidPath = errors.New("invalid path")

ErrInvalidPath is returned when a path contains invalid characters or patterns.

Functions

func HasTraversal

func HasTraversal(path string) bool

HasTraversal reports whether path contains an explicit parent-directory segment.

func ValidatePath added in v1.1.1

func ValidatePath(path string) error

ValidatePath validates a path for use in vault entry operations. It rejects paths containing:

  • Parent directory traversal (..)
  • Null bytes (\x00)
  • Control characters (< 0x20)

Returns nil if the path is valid, or an error describing the specific issue.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL