signaturediscovery

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2025 License: Apache-2.0, BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package signaturediscovery contains functionalities to discover container image signatures.

Index

Constants

View Source
const (
	// FakeRepoWithSignatures represents an OCI registry with container image signatures for testing.
	FakeRepoWithSignatures = "repo with signatures"
	// FakeRepoWithNoSignatures represents an OCI registry with no container image signatures for testing.
	FakeRepoWithNoSignatures = "repo with no signatures"
	// FakeNonExistRepo represents a non-exist OCI registry for testing.
	FakeNonExistRepo = "nonexist repo"
	// FakeRepoWithAllInvalidSignatures represents an OCI registry with all invalid container image signatures for testing.
	FakeRepoWithAllInvalidSignatures = "repo with all invalid signatures"
	// FakeRepoWithPartialValidSignatures represents an OCI registry with parital valid container image signatures for testing.
	FakeRepoWithPartialValidSignatures = "repo with parital valid signatures"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	OriginalImageDesc v1.Descriptor
	// contains filtered or unexported fields
}

Client is a wrapper of containerd.Client to interact with signed image manifest.

func (*Client) FetchImageSignatures

func (c *Client) FetchImageSignatures(ctx context.Context, targetRepository string) ([]oci.Signature, error)

FetchImageSignatures returns a list of valid image signatures associated with the target OCI image.

func (*Client) FetchSignedImageManifest

func (c *Client) FetchSignedImageManifest(ctx context.Context, targetRepository string) (v1.Manifest, error)

FetchSignedImageManifest fetches a signed image manifest using a tag-based discovery mechanism.

type Fetcher

type Fetcher interface {
	FetchImageSignatures(ctx context.Context, targetRepository string) ([]oci.Signature, error)
}

Fetcher discovers and fetches OCI signatures from the target repository.

func New

func New(originalImageDesc v1.Descriptor, resolverFetcher remoteResolverFetcher, imageFetcher imageFetcher) Fetcher

New creates a new client that implements Fetcher interface.

func NewFakeClient

func NewFakeClient() Fetcher

NewFakeClient constructs a new fake signature discovery client.

Jump to

Keyboard shortcuts

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