notary

package
v0.0.0-...-f0373c1 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2022 License: Apache-2.0, Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEmptyTargetsNotaryRepository

func GetEmptyTargetsNotaryRepository(imgRefAndAuth trust.ImageRefAndAuth, actions []string) (client.Repository, error)

GetEmptyTargetsNotaryRepository returns an EmptyTargetsNotaryRepository

func GetLoadedNotaryRepository

func GetLoadedNotaryRepository(imgRefAndAuth trust.ImageRefAndAuth, actions []string) (client.Repository, error)

GetLoadedNotaryRepository returns a LoadedNotaryRepository

func GetLoadedWithNoSignersNotaryRepository

func GetLoadedWithNoSignersNotaryRepository(imgRefAndAuth trust.ImageRefAndAuth, actions []string) (client.Repository, error)

GetLoadedWithNoSignersNotaryRepository returns a LoadedWithNoSignersNotaryRepository

func GetOfflineNotaryRepository

func GetOfflineNotaryRepository(imgRefAndAuth trust.ImageRefAndAuth, actions []string) (client.Repository, error)

GetOfflineNotaryRepository returns a OfflineNotaryRepository

func GetUninitializedNotaryRepository

func GetUninitializedNotaryRepository(imgRefAndAuth trust.ImageRefAndAuth, actions []string) (client.Repository, error)

GetUninitializedNotaryRepository returns an UninitializedNotaryRepository

Types

type EmptyTargetsNotaryRepository

type EmptyTargetsNotaryRepository struct {
	OfflineNotaryRepository
}

EmptyTargetsNotaryRepository is a mock Notary repository that is initialized but does not have any signed targets

func (EmptyTargetsNotaryRepository) GetAllTargetMetadataByName

func (e EmptyTargetsNotaryRepository) GetAllTargetMetadataByName(name string) ([]client.TargetSignedStruct, error)

GetAllTargetMetadataByName searches the entire delegation role tree to find the specified target by name for all roles, and returns a list of TargetSignedStructs for each time it finds the specified target.

func (EmptyTargetsNotaryRepository) GetDelegationRoles

func (e EmptyTargetsNotaryRepository) GetDelegationRoles() ([]data.Role, error)

GetDelegationRoles returns the keys and roles of the repository's delegations

func (EmptyTargetsNotaryRepository) GetTargetByName

func (e EmptyTargetsNotaryRepository) GetTargetByName(name string, roles ...data.RoleName) (*client.TargetWithRole, error)

GetTargetByName returns a target by the given name.

func (EmptyTargetsNotaryRepository) Initialize

func (e EmptyTargetsNotaryRepository) Initialize(rootKeyIDs []string, serverManagedRoles ...data.RoleName) error

Initialize creates a new repository by using rootKey as the root Key for the TUF repository.

func (EmptyTargetsNotaryRepository) InitializeWithCertificate

func (e EmptyTargetsNotaryRepository) InitializeWithCertificate(rootKeyIDs []string, rootCerts []data.PublicKey, serverManagedRoles ...data.RoleName) error

InitializeWithCertificate initializes the repository with root keys and their corresponding certificates

func (EmptyTargetsNotaryRepository) ListRoles

ListRoles returns a list of RoleWithSignatures objects for this repo

func (EmptyTargetsNotaryRepository) ListTargets

func (e EmptyTargetsNotaryRepository) ListTargets(roles ...data.RoleName) ([]*client.TargetWithRole, error)

ListTargets lists all targets for the current repository. The list of roles should be passed in order from highest to lowest priority.

func (EmptyTargetsNotaryRepository) Publish

func (e EmptyTargetsNotaryRepository) Publish() error

Publish pushes the local changes in signed material to the remote notary-server Conceptually it performs an operation similar to a `git rebase`

func (EmptyTargetsNotaryRepository) RotateKey

func (e EmptyTargetsNotaryRepository) RotateKey(role data.RoleName, serverManagesKey bool, keyList []string) error

RotateKey rotates a private key and returns the public component from the remote server

type LoadedNotaryRepository

type LoadedNotaryRepository struct {
	EmptyTargetsNotaryRepository
	// contains filtered or unexported fields
}

LoadedNotaryRepository is a mock Notary repository that is loaded with targets, delegations, and keys

func (LoadedNotaryRepository) GetAllTargetMetadataByName

func (l LoadedNotaryRepository) GetAllTargetMetadataByName(name string) ([]client.TargetSignedStruct, error)

GetAllTargetMetadataByName searches the entire delegation role tree to find the specified target by name for all roles, and returns a list of TargetSignedStructs for each time it finds the specified target.

func (LoadedNotaryRepository) GetCryptoService

func (l LoadedNotaryRepository) GetCryptoService() signed.CryptoService

GetCryptoService is the getter for the repository's CryptoService

func (LoadedNotaryRepository) GetDelegationRoles

func (l LoadedNotaryRepository) GetDelegationRoles() ([]data.Role, error)

GetDelegationRoles returns the keys and roles of the repository's delegations

func (LoadedNotaryRepository) GetGUN

func (l LoadedNotaryRepository) GetGUN() data.GUN

GetGUN is a getter for the GUN object from a Repository

func (LoadedNotaryRepository) GetTargetByName

func (l LoadedNotaryRepository) GetTargetByName(name string, roles ...data.RoleName) (*client.TargetWithRole, error)

GetTargetByName returns a target by the given name.

func (LoadedNotaryRepository) ListRoles

ListRoles returns a list of RoleWithSignatures objects for this repo

func (LoadedNotaryRepository) ListTargets

func (l LoadedNotaryRepository) ListTargets(roles ...data.RoleName) ([]*client.TargetWithRole, error)

ListTargets lists all targets for the current repository. The list of roles should be passed in order from highest to lowest priority.

type LoadedWithNoSignersNotaryRepository

type LoadedWithNoSignersNotaryRepository struct {
	LoadedNotaryRepository
}

LoadedWithNoSignersNotaryRepository is a mock Notary repository that is loaded with targets but no delegations it only contains the green target

func (LoadedWithNoSignersNotaryRepository) GetAllTargetMetadataByName

func (l LoadedWithNoSignersNotaryRepository) GetAllTargetMetadataByName(name string) ([]client.TargetSignedStruct, error)

GetAllTargetMetadataByName searches the entire delegation role tree to find the specified target by name for all roles, and returns a list of TargetSignedStructs for each time it finds the specified target.

func (LoadedWithNoSignersNotaryRepository) GetDelegationRoles

func (l LoadedWithNoSignersNotaryRepository) GetDelegationRoles() ([]data.Role, error)

GetDelegationRoles returns the keys and roles of the repository's delegations

func (LoadedWithNoSignersNotaryRepository) GetTargetByName

func (l LoadedWithNoSignersNotaryRepository) GetTargetByName(name string, roles ...data.RoleName) (*client.TargetWithRole, error)

GetTargetByName returns a target by the given name.

func (LoadedWithNoSignersNotaryRepository) ListTargets

ListTargets lists all targets for the current repository. The list of roles should be passed in order from highest to lowest priority.

type OfflineNotaryRepository

type OfflineNotaryRepository struct{}

OfflineNotaryRepository is a mock Notary repository that is offline

func (OfflineNotaryRepository) AddDelegation

func (o OfflineNotaryRepository) AddDelegation(name data.RoleName, delegationKeys []data.PublicKey, paths []string) error

AddDelegation creates changelist entries to add provided delegation public keys and paths.

func (OfflineNotaryRepository) AddDelegationPaths

func (o OfflineNotaryRepository) AddDelegationPaths(name data.RoleName, paths []string) error

AddDelegationPaths creates a changelist entry to add provided paths to an existing delegation.

func (OfflineNotaryRepository) AddDelegationRoleAndKeys

func (o OfflineNotaryRepository) AddDelegationRoleAndKeys(name data.RoleName, delegationKeys []data.PublicKey) error

AddDelegationRoleAndKeys creates a changelist entry to add provided delegation public keys.

func (OfflineNotaryRepository) AddTarget

func (o OfflineNotaryRepository) AddTarget(target *client.Target, roles ...data.RoleName) error

AddTarget creates new changelist entries to add a target to the given roles in the repository when the changelist gets applied at publish time.

func (OfflineNotaryRepository) ClearDelegationPaths

func (o OfflineNotaryRepository) ClearDelegationPaths(name data.RoleName) error

ClearDelegationPaths creates a changelist entry to remove all paths from an existing delegation.

func (OfflineNotaryRepository) GetAllTargetMetadataByName

func (o OfflineNotaryRepository) GetAllTargetMetadataByName(name string) ([]client.TargetSignedStruct, error)

GetAllTargetMetadataByName searches the entire delegation role tree to find the specified target by name for all roles, and returns a list of TargetSignedStructs for each time it finds the specified target.

func (OfflineNotaryRepository) GetChangelist

func (o OfflineNotaryRepository) GetChangelist() (changelist.Changelist, error)

GetChangelist returns the list of the repository's unpublished changes

func (OfflineNotaryRepository) GetCryptoService

func (o OfflineNotaryRepository) GetCryptoService() signed.CryptoService

GetCryptoService is the getter for the repository's CryptoService

func (OfflineNotaryRepository) GetDelegationRoles

func (o OfflineNotaryRepository) GetDelegationRoles() ([]data.Role, error)

GetDelegationRoles returns the keys and roles of the repository's delegations

func (OfflineNotaryRepository) GetGUN

func (o OfflineNotaryRepository) GetGUN() data.GUN

GetGUN is a getter for the GUN object from a Repository

func (OfflineNotaryRepository) GetTargetByName

func (o OfflineNotaryRepository) GetTargetByName(name string, roles ...data.RoleName) (*client.TargetWithRole, error)

GetTargetByName returns a target by the given name.

func (OfflineNotaryRepository) Initialize

func (o OfflineNotaryRepository) Initialize(rootKeyIDs []string, serverManagedRoles ...data.RoleName) error

Initialize creates a new repository by using rootKey as the root Key for the TUF repository.

func (OfflineNotaryRepository) InitializeWithCertificate

func (o OfflineNotaryRepository) InitializeWithCertificate(rootKeyIDs []string, rootCerts []data.PublicKey, serverManagedRoles ...data.RoleName) error

InitializeWithCertificate initializes the repository with root keys and their corresponding certificates

func (OfflineNotaryRepository) ListRoles

ListRoles returns a list of RoleWithSignatures objects for this repo

func (OfflineNotaryRepository) ListTargets

func (o OfflineNotaryRepository) ListTargets(roles ...data.RoleName) ([]*client.TargetWithRole, error)

ListTargets lists all targets for the current repository. The list of roles should be passed in order from highest to lowest priority.

func (OfflineNotaryRepository) Publish

func (o OfflineNotaryRepository) Publish() error

Publish pushes the local changes in signed material to the remote notary-server Conceptually it performs an operation similar to a `git rebase`

func (OfflineNotaryRepository) RemoveDelegationKeys

func (o OfflineNotaryRepository) RemoveDelegationKeys(name data.RoleName, keyIDs []string) error

RemoveDelegationKeys creates a changelist entry to remove provided keys from an existing delegation.

func (OfflineNotaryRepository) RemoveDelegationKeysAndPaths

func (o OfflineNotaryRepository) RemoveDelegationKeysAndPaths(name data.RoleName, keyIDs, paths []string) error

RemoveDelegationKeysAndPaths creates changelist entries to remove provided delegation key IDs and paths.

func (OfflineNotaryRepository) RemoveDelegationPaths

func (o OfflineNotaryRepository) RemoveDelegationPaths(name data.RoleName, paths []string) error

RemoveDelegationPaths creates a changelist entry to remove provided paths from an existing delegation.

func (OfflineNotaryRepository) RemoveDelegationRole

func (o OfflineNotaryRepository) RemoveDelegationRole(name data.RoleName) error

RemoveDelegationRole creates a changelist to remove all paths and keys from a role, and delete the role in its entirety.

func (OfflineNotaryRepository) RemoveTarget

func (o OfflineNotaryRepository) RemoveTarget(targetName string, roles ...data.RoleName) error

RemoveTarget creates new changelist entries to remove a target from the given roles in the repository when the changelist gets applied at publish time.

func (OfflineNotaryRepository) RotateKey

func (o OfflineNotaryRepository) RotateKey(role data.RoleName, serverManagesKey bool, keyList []string) error

RotateKey rotates a private key and returns the public component from the remote server

func (OfflineNotaryRepository) SetLegacyVersions

func (o OfflineNotaryRepository) SetLegacyVersions(version int)

SetLegacyVersions allows the number of legacy versions of the root to be inspected for old signing keys to be configured.

func (OfflineNotaryRepository) Witness

func (o OfflineNotaryRepository) Witness(roles ...data.RoleName) ([]data.RoleName, error)

Witness creates change objects to witness (i.e. re-sign) the given roles on the next publish. One change is created per role

type UninitializedNotaryRepository

type UninitializedNotaryRepository struct {
	OfflineNotaryRepository
}

UninitializedNotaryRepository is a mock Notary repository that is uninintialized it builds on top of the OfflineNotaryRepository, instead returning ErrRepositoryNotExist for any online operation

func (UninitializedNotaryRepository) GetAllTargetMetadataByName

func (u UninitializedNotaryRepository) GetAllTargetMetadataByName(name string) ([]client.TargetSignedStruct, error)

GetAllTargetMetadataByName searches the entire delegation role tree to find the specified target by name for all roles, and returns a list of TargetSignedStructs for each time it finds the specified target.

func (UninitializedNotaryRepository) GetDelegationRoles

func (u UninitializedNotaryRepository) GetDelegationRoles() ([]data.Role, error)

GetDelegationRoles returns the keys and roles of the repository's delegations

func (UninitializedNotaryRepository) GetTargetByName

func (u UninitializedNotaryRepository) GetTargetByName(name string, roles ...data.RoleName) (*client.TargetWithRole, error)

GetTargetByName returns a target by the given name.

func (UninitializedNotaryRepository) Initialize

func (u UninitializedNotaryRepository) Initialize(rootKeyIDs []string, serverManagedRoles ...data.RoleName) error

Initialize creates a new repository by using rootKey as the root Key for the TUF repository.

func (UninitializedNotaryRepository) InitializeWithCertificate

func (u UninitializedNotaryRepository) InitializeWithCertificate(rootKeyIDs []string, rootCerts []data.PublicKey, serverManagedRoles ...data.RoleName) error

InitializeWithCertificate initializes the repository with root keys and their corresponding certificates

func (UninitializedNotaryRepository) ListRoles

ListRoles returns a list of RoleWithSignatures objects for this repo

func (UninitializedNotaryRepository) ListTargets

func (u UninitializedNotaryRepository) ListTargets(roles ...data.RoleName) ([]*client.TargetWithRole, error)

ListTargets lists all targets for the current repository. The list of roles should be passed in order from highest to lowest priority.

func (UninitializedNotaryRepository) Publish

Publish pushes the local changes in signed material to the remote notary-server Conceptually it performs an operation similar to a `git rebase`

func (UninitializedNotaryRepository) RotateKey

func (u UninitializedNotaryRepository) RotateKey(role data.RoleName, serverManagesKey bool, keyList []string) error

RotateKey rotates a private key and returns the public component from the remote server

Jump to

Keyboard shortcuts

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