Help us shape the future of Go! Take the 2026 Go Developer Survey

update

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package update checks a release's signature before a product installs anything from it: the keyless cosign signature of an artifact (typically checksums.txt) against the identity of the release workflow, then the checksums of the files. A product's `update` command and lockfile's plugin install share it.

Verification runs the cosign CLI (verify-blob with a sigstore bundle). A missing cosign is a refusal, never a skip.

Index

Constants

This section is empty.

Variables

View Source
var ErrCosignMissing = errors.New("cosign is not installed")

ErrCosignMissing means cosign is not installed: the signature cannot be checked, so nothing may be installed.

Functions

func CheckSHA256

func CheckSHA256(data []byte, want string) error

CheckSHA256 reports whether data has the hex sha256 want.

func ChecksumFor

func ChecksumFor(sums []byte, name string) (string, error)

ChecksumFor returns the sha256 (lower case) a checksums.txt lists for name ("<hex> <name>" or "<hex> *<name>").

func Verify

func Verify(ctx context.Context, artifact, bundle []byte, id Identity, o Options) error

Verify checks that bundle (a sigstore bundle) is a valid keyless signature of artifact by id.

func VerifyFiles

func VerifyFiles(ctx context.Context, artifact, bundle string, id Identity, o Options) error

VerifyFiles is Verify for files already on disk.

Types

type Identity

type Identity struct {
	CertIdentityRegexp string
	OIDCIssuer         string
}

Identity is who must have signed: the certificate identity (a regular expression over the signing workflow's URL, anchored at "^https://") and the OIDC issuer of the certificate.

type Options

type Options struct {
	// Cosign is the cosign binary; "" looks it up in PATH.
	Cosign string
}

Options configure Verify.

type VerifyError

type VerifyError struct {
	Err    error
	Output string
}

VerifyError is a signature that does not verify; Output is cosign's.

func (*VerifyError) Error

func (e *VerifyError) Error() string

func (*VerifyError) Unwrap

func (e *VerifyError) Unwrap() error

Jump to

Keyboard shortcuts

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