remote

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

README

COSIGN

The oci.remote package has been copied from the cosign package. The following changes have been made.

Additional files

api.go

Exposes a method for mocking in unit tests.

Changed files

digest.go

Returns a pointer to the name.Digest value to enable nil references in unit tests.

Other changes

Package renaming to enable the copy.

Reference

https://github.com/sigstore/cosign/tree/main/pkg/oci

Documentation

Index

Constants

View Source
const (
	SignatureTagSuffix   = "sig"
	SBOMTagSuffix        = "sbom"
	AttestationTagSuffix = "att"
	CustomTagPrefix      = ""

	RepoOverrideEnvKey = "COSIGN_REPOSITORY"
)

Variables

This section is empty.

Functions

func GetEnvTargetRepository

func GetEnvTargetRepository() (name.Repository, error)

GetEnvTargetRepository returns the Repository specified by `os.Getenv(RepoOverrideEnvKey)`, or the empty value if not set. Returns an error if the value is set but cannot be parsed.

func SBOMTag

func SBOMTag(ref name.Reference, opts ...Option) (name.Tag, error)

SBOMTag returns the name.Tag that associated SBOMs with a particular digest.

func Signatures

func Signatures(ref name.Reference, opts ...Option) (oci.Signatures, error)

Signatures fetches the signatures image represented by the named reference. If the tag is not found, this returns an empty oci.Signatures.

func SignedEntity

func SignedEntity(ref name.Reference, options ...Option) (oci.SignedEntity, error)

SignedEntity provides access to a remote reference, and its signatures. The SignedEntity will be one of SignedImage or SignedImageIndex.

func SignedImage

func SignedImage(ref name.Reference, options ...Option) (oci.SignedImage, error)

SignedImage provides access to a remote image reference, and its signatures.

func SignedImageIndex

func SignedImageIndex(ref name.Reference, options ...Option) (oci.SignedImageIndex, error)

SignedImageIndex provides access to a remote index reference, and its signatures.

Types

type Option

type Option func(*options)

Option is a functional option for remote operations.

func WithAttestationSuffix

func WithAttestationSuffix(suffix string) Option

WithAttestationSuffix is a functional option for overriding the default attestation tag suffix.

func WithPrefix

func WithPrefix(prefix string) Option

WithPrefix is a functional option for overriding the default tag prefix.

func WithRemoteOptions

func WithRemoteOptions(opts ...remote.Option) Option

WithRemoteOptions is a functional option for overriding the default remote options passed to GGCR.

func WithSBOMSuffix

func WithSBOMSuffix(suffix string) Option

WithSBOMSuffix is a functional option for overriding the default SBOM tag suffix.

func WithSignatureSuffix

func WithSignatureSuffix(suffix string) Option

WithSignatureSuffix is a functional option for overriding the default signature tag suffix.

func WithTargetRepository

func WithTargetRepository(repo name.Repository) Option

WithTargetRepository is a functional option for overriding the default target repository hosting the signature and attestation tags.

type Remote

type Remote struct{}

func (*Remote) ResolveDigest

func (r *Remote) ResolveDigest(ref name.Reference, opts ...Option) (*name.Digest, error)

ResolveDigest returns the digest of the image at the reference.

If the reference is by digest already, it simply extracts the digest. Otherwise, it looks up the digest from the registry.

type RemoteApi

type RemoteApi interface {
	ResolveDigest(ref name.Reference, opts ...Option) (*name.Digest, error)
}

Jump to

Keyboard shortcuts

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