Documentation
¶
Index ¶
- Constants
- Variables
- func GetCheckFunction(ctx IntegrityCtx) (func(data []byte, hashes map[string][]byte, sign []byte) error, error)
- func GetSignFunction(privateKeyPath string) (func(data []byte) (map[string][]byte, []byte, error), error)
- func RegisterIntegrityCheckFlag(flagset *pflag.FlagSet, dst *string)
- func RegisterIntegrityCheckPeriodFlag(flagset *pflag.FlagSet, dst *int)
- func RegisterWithIntegrityFlag(flagset *pflag.FlagSet, dst *string)
- type IntegrityCtx
- type Repository
- type Signer
Constants ¶
const HashesFileName = ""
HashesFileName is a name of a file containing file hashes that require checking.
Variables ¶
var ErrNotConfigured = errors.New("integrity check is not configured")
ErrNotConfigured is reported when integrity check is not configured in the command context.
Functions ¶
func GetCheckFunction ¶
func GetCheckFunction(ctx IntegrityCtx) ( func(data []byte, hashes map[string][]byte, sign []byte) error, error, )
GetCheckFunction returns a function that checks a map of hashes and a signature of a data.
func GetSignFunction ¶
func GetSignFunction(privateKeyPath string) ( func(data []byte) (map[string][]byte, []byte, error), error, )
GetSignFunction returns a function that creates a map of hashes and a signature for a data for the private key in the path.
func RegisterIntegrityCheckFlag ¶
RegisterIntegrityCheckFlag is a noop function that is intended to add root flag enabling integrity checks.
func RegisterIntegrityCheckPeriodFlag ¶
RegisterIntegrityCheckPeriodFlag is a noop function that is intended to add flag specifying how often should integrity checks run in watchdog.
func RegisterWithIntegrityFlag ¶
RegisterWithIntegrityFlag is a noop function that is intended to add flags to `tt pack` command.
Types ¶
type IntegrityCtx ¶
type IntegrityCtx struct { // Repository is a repository used to check integrity of files. Repository Repository }
IntegrityCtx is context required for integrity checks.
func InitializeIntegrityCheck ¶
func InitializeIntegrityCheck(publicKeyPath, configDir string) (IntegrityCtx, error)
InitializeIntegrityCheck is a noop setup of integrity checking.
type Repository ¶
type Repository interface { // Read makes sure the file is not modified and reads it. Read(path string) (io.ReadCloser, error) // ValidateAll checks that all the files stored in the repository // were not modified. ValidateAll() error }
Repository provides utilities for working with files and ensuring that they were not compromised.