trust

package
v0.0.0-...-98e473a Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2020 License: MIT Imports: 28 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(ref name.Reference, auth authn.Authenticator, repoInfo *name.Registry, config *Config) (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, rootPassphrase string, repoPassphrase string) notary.PassRetriever

GetPassphraseRetriever returns a passphrase retriever that utilizes configuration

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 NotaryError

func NotaryError(repoName string, err error) error

NotaryError formats an error message received from the notary service

func Server

func Server(serverUrl string, repoInfo *name.Registry) (string, error)

Server returns the base URL for the trust server.

Types

type Config

type Config struct {
	RootPath             string
	ServerUrl            string `json:"server_url"`
	RootPassphrase       string `json:"root_passphrase"`
	RepositoryPassphrase string `json:"repository_passphrase"`
}

func ParseConfig

func ParseConfig(configDir string) (*Config, error)

ParseConfig read configfile (${configDir}/${configFileName}) returns a Config object and error.

type TrustedRepository

type TrustedRepository interface {
	ListTarget() ([]*client.Target, error)
	Verify() (*client.Target, error)
	TrustPush(img v1.Image) error
	SignImage(img v1.Image) error
	RevokeTag(tag string) error
}

Jump to

Keyboard shortcuts

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