trust

package
v20.10.5+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2021 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ReleasesRole is the role named "releases"
	ReleasesRole = data.RoleName(path.Join(data.CanonicalTargetsRole.String(), "releases"))
	// ActionsPullOnly defines the actions for read-only interactions with a Notary Repository
	ActionsPullOnly = []string{"pull"}
	// ActionsPushAndPull defines the actions for read-write interactions with a Notary Repository
	ActionsPushAndPull = []string{"pull", "push"}
	// NotaryServer is the endpoint serving the Notary trust server
	NotaryServer = "https://notary.docker.io"
)

Functions

func GetNotaryRepository

func GetNotaryRepository(in io.Reader, out io.Writer, userAgent string, repoInfo *registry.RepositoryInfo, authConfig *types.AuthConfig, actions ...string) (client.Repository, error)

GetNotaryRepository returns a NotaryRepository which stores all the information needed to operate on a notary repository. It creates an HTTP transport providing authentication support.

func GetPassphraseRetriever

func GetPassphraseRetriever(in io.Reader, out io.Writer) notary.PassRetriever

GetPassphraseRetriever returns a passphrase retriever that utilizes Content Trust env vars

func GetSignableRoles

func GetSignableRoles(repo client.Repository, target *client.Target) ([]data.RoleName, error)

GetSignableRoles returns a list of roles for which we have valid signing keys, given a notary repository and a target

func GetTrustDirectory

func GetTrustDirectory() string

GetTrustDirectory returns the base trust directory name

func NotaryError

func NotaryError(repoName string, err error) error

NotaryError formats an error message received from the notary service

func Server

func Server(index *registrytypes.IndexInfo) (string, error)

Server returns the base URL for the trust server.

Types

type ImageRefAndAuth

type ImageRefAndAuth struct {
	// contains filtered or unexported fields
}

ImageRefAndAuth contains all reference information and the auth config for an image request

func GetImageReferencesAndAuth

func GetImageReferencesAndAuth(ctx context.Context, rs registry.Service,
	authResolver func(ctx context.Context, index *registrytypes.IndexInfo) types.AuthConfig,
	imgName string,
) (ImageRefAndAuth, error)

GetImageReferencesAndAuth retrieves the necessary reference and auth information for an image name as an ImageRefAndAuth struct

func (*ImageRefAndAuth) AuthConfig

func (imgRefAuth *ImageRefAndAuth) AuthConfig() *types.AuthConfig

AuthConfig returns the auth information (username, etc) for a given ImageRefAndAuth

func (*ImageRefAndAuth) Digest

func (imgRefAuth *ImageRefAndAuth) Digest() digest.Digest

Digest returns the Image digest for a given ImageRefAndAuth

func (*ImageRefAndAuth) Name

func (imgRefAuth *ImageRefAndAuth) Name() string

Name returns the image name used to initialize the ImageRefAndAuth

func (*ImageRefAndAuth) Reference

func (imgRefAuth *ImageRefAndAuth) Reference() reference.Named

Reference returns the Image reference for a given ImageRefAndAuth

func (*ImageRefAndAuth) RepoInfo

func (imgRefAuth *ImageRefAndAuth) RepoInfo() *registry.RepositoryInfo

RepoInfo returns the repository information for a given ImageRefAndAuth

func (*ImageRefAndAuth) Tag

func (imgRefAuth *ImageRefAndAuth) Tag() string

Tag returns the Image tag for a given ImageRefAndAuth

Jump to

Keyboard shortcuts

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