security

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package security manages trust decisions and persistence for repository config files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TrustManager

type TrustManager struct {
	// contains filtered or unexported fields
}

TrustManager stores trusted hashes and enforces TOFU (Trust On First Use).

func NewTrustManager

func NewTrustManager() *TrustManager

NewTrustManager creates and loads the persisted trust database.

func (*TrustManager) CheckTrust

func (tm *TrustManager) CheckTrust(filePath string) TrustStatus

CheckTrust validates the given path against the trust database.

func (*TrustManager) TrustFile

func (tm *TrustManager) TrustFile(filePath string) error

TrustFile records the current hash of a file as trusted.

type TrustStatus

type TrustStatus int

TrustStatus represents the outcome of a trust check on a file.

const (
	// TrustStatusTrusted indicates the file matches a known hash.
	TrustStatusTrusted TrustStatus = iota
	// TrustStatusUntrusted means the file either changed or has not been trusted yet.
	TrustStatusUntrusted
	// TrustStatusNotFound is returned when the file does not exist.
	TrustStatusNotFound
)

Jump to

Keyboard shortcuts

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