Documentation ¶
Index ¶
- Variables
- func NewErrIncorrectTargetPath(path string) error
- func SplitFilepath(path string) (result []string)
- type Filesystem
- type InMemoryFile
- type Interface
- type NonAtomicTufStore
- func (m *NonAtomicTufStore) Clean() error
- func (store *NonAtomicTufStore) Commit(consistentSnapshot bool, versions map[string]int64, _ map[string]data.Hashes) error
- func (store *NonAtomicTufStore) FileIsStaged(filename string) bool
- func (store *NonAtomicTufStore) GetMeta() (map[string]json.RawMessage, error)
- func (store *NonAtomicTufStore) GetSigners(role string) ([]keys.Signer, error)
- func (store *NonAtomicTufStore) SaveSigner(role string, signer keys.Signer) error
- func (store *NonAtomicTufStore) SetMeta(name string, meta json.RawMessage) error
- func (store *NonAtomicTufStore) SignersForKeyIDs(keyIDs []string) []keys.Signer
- func (store *NonAtomicTufStore) StageTargetFile(ctx context.Context, targetPath string, data io.Reader) error
- func (store *NonAtomicTufStore) WalkStagedTargets(targetPathList []string, targetsFn tuf.TargetsWalkFunc) error
- type Publisher
- func (publisher *Publisher) GetExistingReleases(ctx context.Context, repository RepositoryInterface) ([]string, error)
- func (publisher *Publisher) GetRepository(ctx context.Context, storage logical.Storage, options RepositoryOptions) (RepositoryInterface, error)
- func (publisher *Publisher) Paths() []*framework.Path
- func (m *Publisher) PeriodicFunc(_ context.Context, _ *logical.Request) error
- func (publisher *Publisher) RotateRepositoryKeys(ctx context.Context, storage logical.Storage, repository RepositoryInterface, ...) error
- func (publisher *Publisher) StageChannelsConfig(ctx context.Context, repository RepositoryInterface, ...) error
- func (publisher *Publisher) StageInMemoryFiles(ctx context.Context, repository RepositoryInterface, files []*InMemoryFile) error
- func (publisher *Publisher) StageReleaseTarget(ctx context.Context, repository RepositoryInterface, ...) error
- func (publisher *Publisher) UpdateTimestamps(ctx context.Context, storage logical.Storage, repository RepositoryInterface, ...) error
- type RepositoryInterface
- type RepositoryOptions
- type S3Filesystem
- func (fs *S3Filesystem) IsFileExist(ctx context.Context, path string) (bool, error)
- func (fs *S3Filesystem) ReadFile(ctx context.Context, path string, writerAt io.WriterAt) error
- func (fs *S3Filesystem) ReadFileBytes(ctx context.Context, path string) ([]byte, error)
- func (fs *S3Filesystem) ReadFileStream(ctx context.Context, path string, writer io.Writer) error
- func (fs *S3Filesystem) WriteFileBytes(ctx context.Context, path string, data []byte) error
- func (fs *S3Filesystem) WriteFileStream(ctx context.Context, path string, data io.Reader) error
- type S3Options
- type S3Repository
- func (repository *S3Repository) CommitStaged(_ context.Context) error
- func (repository *S3Repository) GenPrivKeys() error
- func (repository *S3Repository) GetPrivKeys() TufRepoPrivKeys
- func (repository *S3Repository) GetTargets(ctx context.Context) ([]string, error)
- func (repository *S3Repository) Init() error
- func (repository *S3Repository) RotatePrivKeys(ctx context.Context) (bool, TufRepoPrivKeys, error)
- func (repository *S3Repository) SetPrivKeys(privKeys TufRepoPrivKeys) error
- func (repository *S3Repository) StageTarget(ctx context.Context, pathInsideTargets string, data io.Reader) error
- func (repository *S3Repository) UpdateTimestamps(_ context.Context, systemClock util.Clock) error
- type TufRepoOptions
- type TufRepoPrivKeys
- func (privKeys TufRepoPrivKeys) GetSigner(role string) (keys.Signer, error)
- func (keys *TufRepoPrivKeys) SetKeyFromSigner(role string, signer keys.Signer) error
- func (privKeys TufRepoPrivKeys) SetupStoreSigners(store tuf.LocalStore) error
- func (privKeys TufRepoPrivKeys) SetupTufRepoSigners(tufRepo *tuf.Repo) error
- type TufRepoRotator
- func (rotator *TufRepoRotator) Commit() error
- func (rotator *TufRepoRotator) GetRootRotateAt() (time.Time, error)
- func (rotator *TufRepoRotator) GetSnapshotRotateAt() (time.Time, error)
- func (rotator *TufRepoRotator) GetTargetsRotateAt() (time.Time, error)
- func (rotator *TufRepoRotator) GetTimestampRotateAt() (time.Time, error)
- func (rotator *TufRepoRotator) Rotate(logger hclog.Logger, now time.Time) error
- func (rotator *TufRepoRotator) RotateRoot(now time.Time) error
- func (rotator *TufRepoRotator) RotateSnapshot(now time.Time) error
- func (rotator *TufRepoRotator) RotateTargets(now time.Time) error
- func (rotator *TufRepoRotator) RotateTimestamp(now time.Time) error
- type TufRepoRotatorAccessor
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUninitializedRepositoryKeys = errors.New("uninitialized repository keys") ErrUninitializedPGPSigningKey = errors.New("uninitialized pgp signing key") )
Functions ¶
func SplitFilepath ¶
TODO: move this to the separate project in github.com/werf
Types ¶
type Filesystem ¶
type Filesystem interface { IsFileExist(ctx context.Context, path string) (bool, error) ReadFile(ctx context.Context, path string, writer io.WriterAt) error ReadFileStream(ctx context.Context, path string, writer io.Writer) error ReadFileBytes(ctx context.Context, path string) ([]byte, error) WriteFileBytes(ctx context.Context, path string, data []byte) error WriteFileStream(ctx context.Context, path string, reader io.Reader) error }
type InMemoryFile ¶
type Interface ¶
type Interface interface { GetRepository(ctx context.Context, storage logical.Storage, options RepositoryOptions) (RepositoryInterface, error) RotateRepositoryKeys(ctx context.Context, storage logical.Storage, repository RepositoryInterface, systemClock util.Clock) error UpdateTimestamps(ctx context.Context, storage logical.Storage, repository RepositoryInterface, systemClock util.Clock) error StageReleaseTarget(ctx context.Context, repository RepositoryInterface, releaseName, path string, data io.Reader) error StageChannelsConfig(ctx context.Context, repository RepositoryInterface, trdlChannelsConfig *config.TrdlChannels) error StageInMemoryFiles(ctx context.Context, repository RepositoryInterface, files []*InMemoryFile) error GetExistingReleases(ctx context.Context, repository RepositoryInterface) ([]string, error) }
type NonAtomicTufStore ¶
type NonAtomicTufStore struct { Filesystem Filesystem PrivKeys TufRepoPrivKeys // contains filtered or unexported fields }
func NewNonAtomicTufStore ¶
func NewNonAtomicTufStore(privKeys TufRepoPrivKeys, filesystem Filesystem, logger hclog.Logger) *NonAtomicTufStore
func (*NonAtomicTufStore) Clean ¶
func (m *NonAtomicTufStore) Clean() error
func (*NonAtomicTufStore) FileIsStaged ¶
func (store *NonAtomicTufStore) FileIsStaged(filename string) bool
func (*NonAtomicTufStore) GetMeta ¶
func (store *NonAtomicTufStore) GetMeta() (map[string]json.RawMessage, error)
func (*NonAtomicTufStore) GetSigners ¶
func (store *NonAtomicTufStore) GetSigners(role string) ([]keys.Signer, error)
func (*NonAtomicTufStore) SaveSigner ¶
func (store *NonAtomicTufStore) SaveSigner(role string, signer keys.Signer) error
func (*NonAtomicTufStore) SetMeta ¶
func (store *NonAtomicTufStore) SetMeta(name string, meta json.RawMessage) error
func (*NonAtomicTufStore) SignersForKeyIDs ¶
func (store *NonAtomicTufStore) SignersForKeyIDs(keyIDs []string) []keys.Signer
func (*NonAtomicTufStore) StageTargetFile ¶
func (*NonAtomicTufStore) WalkStagedTargets ¶
func (store *NonAtomicTufStore) WalkStagedTargets(targetPathList []string, targetsFn tuf.TargetsWalkFunc) error
type Publisher ¶
type Publisher struct { PGPSigningKey *pgp.RSASigningKey // contains filtered or unexported fields }
func NewPublisher ¶
func NewPublisher(logger hclog.Logger) *Publisher
func (*Publisher) GetExistingReleases ¶
func (*Publisher) GetRepository ¶
func (publisher *Publisher) GetRepository(ctx context.Context, storage logical.Storage, options RepositoryOptions) (RepositoryInterface, error)
func (*Publisher) PeriodicFunc ¶
func (*Publisher) RotateRepositoryKeys ¶
func (*Publisher) StageChannelsConfig ¶
func (publisher *Publisher) StageChannelsConfig(ctx context.Context, repository RepositoryInterface, trdlChannelsConfig *config.TrdlChannels) error
func (*Publisher) StageInMemoryFiles ¶
func (publisher *Publisher) StageInMemoryFiles(ctx context.Context, repository RepositoryInterface, files []*InMemoryFile) error
func (*Publisher) StageReleaseTarget ¶
type RepositoryInterface ¶
type RepositoryInterface interface { Init() error SetPrivKeys(privKeys TufRepoPrivKeys) error GetPrivKeys() TufRepoPrivKeys GenPrivKeys() error RotatePrivKeys(ctx context.Context) (bool, TufRepoPrivKeys, error) UpdateTimestamps(ctx context.Context, systemClock util.Clock) error StageTarget(ctx context.Context, pathInsideTargets string, data io.Reader) error CommitStaged(ctx context.Context) error GetTargets(ctx context.Context) ([]string, error) }
type RepositoryOptions ¶
type S3Filesystem ¶
type S3Filesystem struct { AwsConfig *aws.Config BucketName string // contains filtered or unexported fields }
func NewS3Filesystem ¶
func NewS3Filesystem(awsConfig *aws.Config, bucketName string, logger hclog.Logger) *S3Filesystem
func (*S3Filesystem) IsFileExist ¶
func (*S3Filesystem) ReadFileBytes ¶
func (*S3Filesystem) ReadFileStream ¶
func (*S3Filesystem) WriteFileBytes ¶
func (*S3Filesystem) WriteFileStream ¶
type S3Repository ¶
type S3Repository struct { S3Filesystem *S3Filesystem TufStore *NonAtomicTufStore TufRepo *tuf.Repo // contains filtered or unexported fields }
func NewRepository ¶
func NewRepository(s3Filesystem *S3Filesystem, tufStore *NonAtomicTufStore, tufRepo *tuf.Repo, logger hclog.Logger) *S3Repository
func NewRepositoryWithOptions ¶
func NewRepositoryWithOptions(s3Options S3Options, tufRepoOptions TufRepoOptions, logger hclog.Logger) (*S3Repository, error)
func (*S3Repository) CommitStaged ¶
func (repository *S3Repository) CommitStaged(_ context.Context) error
func (*S3Repository) GenPrivKeys ¶
func (repository *S3Repository) GenPrivKeys() error
func (*S3Repository) GetPrivKeys ¶
func (repository *S3Repository) GetPrivKeys() TufRepoPrivKeys
func (*S3Repository) GetTargets ¶
func (repository *S3Repository) GetTargets(ctx context.Context) ([]string, error)
func (*S3Repository) Init ¶
func (repository *S3Repository) Init() error
func (*S3Repository) RotatePrivKeys ¶
func (repository *S3Repository) RotatePrivKeys(ctx context.Context) (bool, TufRepoPrivKeys, error)
func (*S3Repository) SetPrivKeys ¶
func (repository *S3Repository) SetPrivKeys(privKeys TufRepoPrivKeys) error
func (*S3Repository) StageTarget ¶
func (*S3Repository) UpdateTimestamps ¶
type TufRepoOptions ¶
type TufRepoOptions struct {
PrivKeys TufRepoPrivKeys
}
type TufRepoPrivKeys ¶
type TufRepoPrivKeys struct { Root *data.PrivateKey `json:"root"` Snapshot *data.PrivateKey `json:"snapshot"` Targets *data.PrivateKey `json:"targets"` Timestamp *data.PrivateKey `json:"timestamp"` }
func (TufRepoPrivKeys) GetSigner ¶
func (privKeys TufRepoPrivKeys) GetSigner(role string) (keys.Signer, error)
func (*TufRepoPrivKeys) SetKeyFromSigner ¶
func (keys *TufRepoPrivKeys) SetKeyFromSigner(role string, signer keys.Signer) error
func (TufRepoPrivKeys) SetupStoreSigners ¶
func (privKeys TufRepoPrivKeys) SetupStoreSigners(store tuf.LocalStore) error
func (TufRepoPrivKeys) SetupTufRepoSigners ¶
func (privKeys TufRepoPrivKeys) SetupTufRepoSigners(tufRepo *tuf.Repo) error
type TufRepoRotator ¶
type TufRepoRotator struct {
TufRepo TufRepoRotatorAccessor
}
func NewTufRepoRotator ¶
func NewTufRepoRotator(tufRepo TufRepoRotatorAccessor) *TufRepoRotator
func (*TufRepoRotator) Commit ¶
func (rotator *TufRepoRotator) Commit() error
func (*TufRepoRotator) GetRootRotateAt ¶
func (rotator *TufRepoRotator) GetRootRotateAt() (time.Time, error)
Root expires every year, rotate every 3 month
func (*TufRepoRotator) GetSnapshotRotateAt ¶
func (rotator *TufRepoRotator) GetSnapshotRotateAt() (time.Time, error)
Snapshot expires every 7 days, rotate every 2nd day
func (*TufRepoRotator) GetTargetsRotateAt ¶
func (rotator *TufRepoRotator) GetTargetsRotateAt() (time.Time, error)
Targets expires every 3 month, rotate every 3 weeks
func (*TufRepoRotator) GetTimestampRotateAt ¶
func (rotator *TufRepoRotator) GetTimestampRotateAt() (time.Time, error)
Timestamp expires every day, rotate every 4th hour
func (*TufRepoRotator) Rotate ¶
func (rotator *TufRepoRotator) Rotate(logger hclog.Logger, now time.Time) error
func (*TufRepoRotator) RotateRoot ¶
func (rotator *TufRepoRotator) RotateRoot(now time.Time) error
func (*TufRepoRotator) RotateSnapshot ¶
func (rotator *TufRepoRotator) RotateSnapshot(now time.Time) error
func (*TufRepoRotator) RotateTargets ¶
func (rotator *TufRepoRotator) RotateTargets(now time.Time) error
func (*TufRepoRotator) RotateTimestamp ¶
func (rotator *TufRepoRotator) RotateTimestamp(now time.Time) error
type TufRepoRotatorAccessor ¶
type TufRepoRotatorAccessor interface { RootExpires() (time.Time, error) TargetsExpires() (time.Time, error) SnapshotExpires() (time.Time, error) TimestampExpires() (time.Time, error) IncrementRootVersionWithExpires(expires time.Time) error IncrementTargetsVersionWithExpires(expires time.Time) error IncrementSnapshotVersionWithExpires(expires time.Time) error IncrementTimestampVersionWithExpires(expires time.Time) error Commit() error }
Click to show internal directories.
Click to hide internal directories.