stores

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: BSD-3-Clause Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientInjector

type ClientInjector interface {
	InjectClient(client.Client)
}

type EncryptedToken added in v0.3.0

type EncryptedToken struct {
	Secrets []EncryptedTokenSecret `json:"secrets"`
}

EncryptedToken is the JSON structure of an encrypted token.

type EncryptedTokenSecret added in v0.3.0

type EncryptedTokenSecret struct {
	Data string `json:"data"`
}

EncryptedTokenSecret is the JSON structure of an encrypted token secret.

type LogStore

type LogStore struct {
	LogStoreSpec emcv1beta1.LogStoreSpec
	Client       client.Client
}

LogStore is a store that logs the token but does not store it anywhere Retreiving the token is thus not implemented

func NewLogStore

func NewLogStore(sts emcv1beta1.LogStoreSpec) *LogStore

func (*LogStore) StoreToken

func (ss *LogStore) StoreToken(ctx context.Context, ea emcv1beta1.EmergencyAccount, token string) (string, error)

type MinioClient added in v0.3.0

type MinioClient interface {
	PutObject(ctx context.Context, bucketName string, objectName string, reader io.Reader, objectSize int64, opts minio.PutObjectOptions) (info minio.UploadInfo, err error)
}

MinioClient partially implements the minio.Client interface.

func DefaultClientFactory added in v0.3.0

func DefaultClientFactory(spec emcv1beta1.S3StoreSpec) (MinioClient, error)

DefaultClientFactory is the default factory for creating a MinioClient.

type S3Store added in v0.3.0

type S3Store struct {
	// contains filtered or unexported fields
}

func NewS3Store added in v0.3.0

func NewS3Store(spec emcv1beta1.S3StoreSpec) *S3Store

NewS3Store creates a new S3Store

func NewS3StoreWithClientFactory added in v0.3.0

func NewS3StoreWithClientFactory(spec emcv1beta1.S3StoreSpec, minioClientFactory func(emcv1beta1.S3StoreSpec) (MinioClient, error)) *S3Store

NewS3StoreWithClientFactory creates a new S3Store with the given client factory.

func (*S3Store) StoreToken added in v0.3.0

func (ss *S3Store) StoreToken(ctx context.Context, ea emcv1beta1.EmergencyAccount, token string) (string, error)

StoreToken stores the token in the S3 bucket. If encryption is enabled, the token is encrypted with the given PGP public keys.

type SecretStore

type SecretStore struct {
	SecretStoreSpec emcv1beta1.SecretStoreSpec
	Client          client.Client
}

func NewSecretStore

func NewSecretStore(sts emcv1beta1.SecretStoreSpec) *SecretStore

func (*SecretStore) InjectClient

func (ss *SecretStore) InjectClient(c client.Client)

InjectClient injects the client into the SecretStore

func (*SecretStore) RetrieveToken

func (ss *SecretStore) RetrieveToken(ctx context.Context, ea emcv1beta1.EmergencyAccount, ref string) (string, error)

func (*SecretStore) StoreToken

func (ss *SecretStore) StoreToken(ctx context.Context, ea emcv1beta1.EmergencyAccount, token string) (string, error)

type TokenRetriever

type TokenRetriever interface {
	RetrieveToken(ctx context.Context, ea emcv1beta1.EmergencyAccount, ref string) (token string, err error)
}

type TokenStorer

type TokenStorer interface {
	StoreToken(ctx context.Context, ea emcv1beta1.EmergencyAccount, token string) (ref string, err error)
}

func FromSpec

func FromSpec(sts emcv1beta1.TokenStoreSpec) (TokenStorer, error)

Jump to

Keyboard shortcuts

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