container

package
v0.0.32 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package container provides the tools to verify a container artifact using sigstore

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrProvenanceNotFoundOrIncomplete is returned when there's no provenance info (missing .sig or attestation) or
	// has incomplete data
	ErrProvenanceNotFoundOrIncomplete = errors.New("provenance not found or incomplete")
	// ErrAuthNotProvided is returned when the selected authentication is not provided
	ErrAuthNotProvided = errors.New("selected auth method not provided")
)

Functions

func BuildImageRef

func BuildImageRef(registry, owner, artifact, version string) string

BuildImageRef returns the OCI image reference

func Verify

func Verify(
	ctx context.Context,
	sev *verify.SignedEntityVerifier,
	registry, owner, artifact, version string,
	authOpts ...AuthMethod,
) ([]verifyif.Result, error)

Verify verifies a container artifact using sigstore isSigned is true only if we were able to find a signature/attestation and it had everything needed to construct the sigstore bundle. isVerified is true only if we were able to verify the constructed bundle against the configured sigstore instance.

Types

type Attestation added in v0.0.27

type Attestation struct {
	Bundle json.RawMessage `json:"bundle"`
}

Attestation is the attestation from the GitHub attestation endpoint

type AttestationReply added in v0.0.27

type AttestationReply struct {
	Attestations []Attestation `json:"attestations"`
}

AttestationReply is the reply from the GitHub attestation endpoint

type AuthMethod added in v0.0.27

type AuthMethod func(auth *containerAuth)

AuthMethod is an option for containerAuth

func WithAccessToken added in v0.0.27

func WithAccessToken(accessToken string) AuthMethod

WithAccessToken sets the access token as an authentication option we want to use during verification

func WithGitHubClient added in v0.0.27

func WithGitHubClient(ghClient provifv1.GitHub) AuthMethod

WithGitHubClient sets the GitHub client as an authentication option we want to use during verification

Jump to

Keyboard shortcuts

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