Documentation
¶
Index ¶
- Constants
- func DescriptorFromBytes(data []byte) notation.Descriptor
- func GetManifestDescriptor(ctx context.Context, tr http.RoundTripper, ref Reference, plainHTTP bool) (notation.Descriptor, error)
- func NewAuthtransport(base http.RoundTripper, username, password string) http.RoundTripper
- type Reference
- type RegistryClient
- type RepositoryClient
- func (r *RepositoryClient) Get(ctx context.Context, signatureDigest digest.Digest) ([]byte, error)
- func (r *RepositoryClient) GetManifestDescriptor(ctx context.Context, ref string) (notation.Descriptor, error)
- func (r *RepositoryClient) Link(ctx context.Context, manifest, signature notation.Descriptor) (notation.Descriptor, error)
- func (r *RepositoryClient) Lookup(ctx context.Context, manifestDigest digest.Digest) ([]digest.Digest, error)
- func (r *RepositoryClient) Put(ctx context.Context, signature []byte) (notation.Descriptor, error)
- type SignatureRegistry
- type SignatureRepository
Constants ¶
const ArtifactTypeNotation = "application/vnd.cncf.notary.v2.signature"
ArtifactTypeNotation specifies the artifact type for a notation object.
const MediaTypeNotationSignature = "application/jose+json"
MediaTypeNotationSignature specifies the media type for the notation signature.
Variables ¶
This section is empty.
Functions ¶
func DescriptorFromBytes ¶
func DescriptorFromBytes(data []byte) notation.Descriptor
DescriptorFromBytes computes the basic descriptor from the given bytes
func GetManifestDescriptor ¶
func GetManifestDescriptor(ctx context.Context, tr http.RoundTripper, ref Reference, plainHTTP bool) (notation.Descriptor, error)
GetManifestDescriptor returns signature manifest information.
func NewAuthtransport ¶
func NewAuthtransport(base http.RoundTripper, username, password string) http.RoundTripper
NewAuthtransport creates wraps a round tripper with auth strategies. It tries basic auth first and then falls back to token auth.
Types ¶
type Reference ¶
type Reference struct {
// Registry is the name of the registry.
// It is usually the domain name of the registry.
Registry string
// Repository is the name of the repository
Repository string
// Reference is the reference of the object in the repository.
// A reference can be a tag and / or a digest.
Reference string
}
Reference references to a descriptor in the registry
func ParseReference ¶
func (Reference) ReferenceOrDefault ¶
ReferenceOrDefault returns the reference or the default reference if empty
type RegistryClient ¶
type RegistryClient struct {
// contains filtered or unexported fields
}
RegistryClient is a customized registry client.
func NewClient ¶
func NewClient(tr http.RoundTripper, name string, plainHTTP bool) *RegistryClient
NewClient creates a new registry client.
func (*RegistryClient) Repository ¶
func (r *RegistryClient) Repository(ctx context.Context, name string) *RepositoryClient
type RepositoryClient ¶
type RepositoryClient struct {
// contains filtered or unexported fields
}
func (*RepositoryClient) GetManifestDescriptor ¶
func (r *RepositoryClient) GetManifestDescriptor(ctx context.Context, ref string) (notation.Descriptor, error)
GetManifestDescriptor returns signature manifest information by tag or digest.
func (*RepositoryClient) Link ¶
func (r *RepositoryClient) Link(ctx context.Context, manifest, signature notation.Descriptor) (notation.Descriptor, error)
func (*RepositoryClient) Put ¶
func (r *RepositoryClient) Put(ctx context.Context, signature []byte) (notation.Descriptor, error)
type SignatureRegistry ¶
type SignatureRegistry interface {
Repository(ctx context.Context, name string) SignatureRepository
}
SignatureRegistry provides signature repositories
type SignatureRepository ¶
type SignatureRepository interface {
// Lookup finds all signatures for the specified manifest
Lookup(ctx context.Context, manifestDigest digest.Digest) ([]digest.Digest, error)
// Get downloads the signature by the specified digest
Get(ctx context.Context, signatureDigest digest.Digest) ([]byte, error)
// Put uploads the signature to the registry
Put(ctx context.Context, signature []byte) (notation.Descriptor, error)
// Link creates an signature artifact linking the manifest and the signature
Link(ctx context.Context, manifest, signature notation.Descriptor) (notation.Descriptor, error)
}
SignatureRepository provides a storage for signatures