notary

package
v25.0.4+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: 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(trust.ImageRefAndAuth, []string) (client.Repository, error)

GetEmptyTargetsNotaryRepository returns an EmptyTargetsNotaryRepository

func GetLoadedNotaryRepository

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

GetLoadedNotaryRepository returns a LoadedNotaryRepository

func GetLoadedWithNoSignersNotaryRepository

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

GetLoadedWithNoSignersNotaryRepository returns a LoadedWithNoSignersNotaryRepository

func GetOfflineNotaryRepository

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

GetOfflineNotaryRepository returns a OfflineNotaryRepository

func GetUninitializedNotaryRepository

func GetUninitializedNotaryRepository(trust.ImageRefAndAuth, []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, _ ...data.RoleName) (*client.TargetWithRole, error)

GetTargetByName returns a target by the given name.

func (EmptyTargetsNotaryRepository) Initialize

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

func (EmptyTargetsNotaryRepository) InitializeWithCertificate

func (e EmptyTargetsNotaryRepository) InitializeWithCertificate([]string, []data.PublicKey, ...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

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

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

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

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

func (OfflineNotaryRepository) AddDelegationPaths

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

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

func (OfflineNotaryRepository) AddDelegationRoleAndKeys

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

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

func (OfflineNotaryRepository) AddTarget

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(data.RoleName) error

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

func (OfflineNotaryRepository) GetAllTargetMetadataByName

func (o OfflineNotaryRepository) GetAllTargetMetadataByName(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

GetTargetByName returns a target by the given name.

func (OfflineNotaryRepository) Initialize

func (o OfflineNotaryRepository) Initialize([]string, ...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([]string, []data.PublicKey, ...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

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(data.RoleName, []string) error

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

func (OfflineNotaryRepository) RemoveDelegationKeysAndPaths

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

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

func (OfflineNotaryRepository) RemoveDelegationPaths

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

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

func (OfflineNotaryRepository) RemoveDelegationRole

func (o OfflineNotaryRepository) RemoveDelegationRole(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(string, ...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

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

func (OfflineNotaryRepository) SetLegacyVersions

func (o OfflineNotaryRepository) SetLegacyVersions(int)

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

func (OfflineNotaryRepository) Witness

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(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

GetTargetByName returns a target by the given name.

func (UninitializedNotaryRepository) Initialize

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

func (UninitializedNotaryRepository) InitializeWithCertificate

func (u UninitializedNotaryRepository) InitializeWithCertificate([]string, []data.PublicKey, ...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

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

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