security

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2026 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package security provides path validation, input sanitization, and shell metacharacter detection.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyPath = errors.New("empty path")
)

Path validation errors.

Functions

func ErrInputContainsShellMetacharacters

func ErrInputContainsShellMetacharacters(input string) error

ErrInputContainsShellMetacharacters returns an error for input containing shell metacharacters.

func ErrInvalidInput

func ErrInvalidInput(input string) error

ErrInvalidInput returns an error for input that fails validation checks.

func ErrPathContainsDangerousPattern

func ErrPathContainsDangerousPattern(path string) error

ErrPathContainsDangerousPattern returns an error for a path containing dangerous traversal or injection patterns.

func ErrPathContainsNullByte

func ErrPathContainsNullByte(path string) error

ErrPathContainsNullByte returns an error for a path containing a null byte.

func ErrPathContainsShellMetacharacters

func ErrPathContainsShellMetacharacters(path string) error

ErrPathContainsShellMetacharacters returns an error for a path containing shell metacharacters.

func ErrPathDoesNotMatchPattern

func ErrPathDoesNotMatchPattern(path string) error

ErrPathDoesNotMatchPattern returns an error for a path that does not match the required validation pattern.

func ValidateConfigPath

func ValidateConfigPath(path string) error

ValidateConfigPath validates paths used for configuration files.

func ValidateInput

func ValidateInput(input string, pattern *regexp.Regexp) error

ValidateInput validates input for command injection prevention.

func ValidatePath

func ValidatePath(path string) error

ValidatePath validates a file path for security.

func ValidatePathWithPattern

func ValidatePathWithPattern(path string, pattern *regexp.Regexp) error

ValidatePathWithPattern validates a path against a specific pattern.

func ValidateSSHKeyPath

func ValidateSSHKeyPath(path string) error

ValidateSSHKeyPath validates SSH key file paths.

Types

This section is empty.

Jump to

Keyboard shortcuts

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