registry

package
v0.12.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2022 License: Apache-2.0 Imports: 12 Imported by: 17

Documentation

Index

Constants

View Source
const ArtifactTypeNotation = "application/vnd.cncf.notary.v2.signature"

ArtifactTypeNotation specifies the artifact type for a notation object.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

type Repository interface {
	SignatureRepository

	// Resolve resolves a reference(tag or digest) to a manifest descriptor
	Resolve(ctx context.Context, reference string) (notation.Descriptor, error)
}

Repository provides functions for verification and signing workflows

type RepositoryClient

type RepositoryClient struct {
	remote.Repository
}

func NewRepositoryClient

func NewRepositoryClient(client remote.Client, ref registry.Reference, plainHTTP bool) *RepositoryClient

NewRepositoryClient creates a new registry client.

func (*RepositoryClient) GetBlob

func (c *RepositoryClient) GetBlob(ctx context.Context, digest digest.Digest) ([]byte, error)

GetBlob downloads the content of the specified digest's Blob

func (*RepositoryClient) ListSignatureManifests

func (c *RepositoryClient) ListSignatureManifests(ctx context.Context, manifestDigest digest.Digest) ([]SignatureManifest, error)

ListSignatureManifests returns all signature manifests given the manifest digest

func (*RepositoryClient) PutSignatureManifest

func (c *RepositoryClient) PutSignatureManifest(ctx context.Context, signature []byte, signatureMediaType string, subjectManifest notation.Descriptor, annotations map[string]string) (notation.Descriptor, SignatureManifest, error)

PutSignatureManifest creates and uploads an signature artifact linking the manifest and the signature

func (*RepositoryClient) Resolve

func (c *RepositoryClient) Resolve(ctx context.Context, reference string) (notation.Descriptor, error)

Resolve resolves a reference(tag or digest) to a manifest descriptor

type SignatureManifest

type SignatureManifest struct {
	Blob        notation.Descriptor
	Annotations map[string]string
}

type SignatureRepository

type SignatureRepository interface {
	// ListSignatureManifests returns all signature manifests given the manifest digest
	ListSignatureManifests(ctx context.Context, manifestDigest digest.Digest) ([]SignatureManifest, error)

	// GetBlob downloads the content of the specified digest's Blob
	GetBlob(ctx context.Context, digest digest.Digest) ([]byte, error)

	// PutSignatureManifest creates and uploads an signature artifact linking the manifest and the signature
	PutSignatureManifest(ctx context.Context, signature []byte, signatureMediaType string, manifest notation.Descriptor, annotations map[string]string) (notation.Descriptor, SignatureManifest, error)
}

SignatureRepository provides a storage for signatures

Jump to

Keyboard shortcuts

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