utils

package
v2.1.21 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCertificateInfo

func AddCertificateInfo(path, content string, validBases []string, strictSourceResolution bool) map[string]interface{}

AddCertificateInfo gets and adds certificate information of a certificate file

func CheckCertificate

func CheckCertificate(content string) string

CheckCertificate verifies if the attribute 'certificate_body' refers a file

func SanitizePath added in v2.1.21

func SanitizePath(allowedBases []string, path string) (string, error)

SanitizePath resolves path to an absolute, cleaned form and ensures it stays within at least one of allowedBases. Both path and each base are resolved independently via filepath.Abs (so relative inputs are interpreted against the current working directory). If a base entry resolves to an existing regular file, its parent directory is used as the boundary. Returns an error if the resolved path escapes every allowed base (e.g. via "..") or if allowedBases is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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