backend

package
v1.12.5 Latest Latest
Warning

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

Go to latest
Published: May 1, 2023 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AKV added in v1.11.0

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

func NewAKV added in v1.11.0

func NewAKV(client *azsecrets.Client) *AKV

func (*AKV) CheckExists added in v1.11.0

func (b *AKV) CheckExists(ctx context.Context, _ *Profile, key string) (bool, error)

func (*AKV) Close added in v1.11.0

func (b *AKV) Close() error

func (*AKV) Delete added in v1.11.0

func (b *AKV) Delete(ctx context.Context, _ *Profile, key string) error

func (*AKV) Get added in v1.11.0

func (b *AKV) Get(ctx context.Context, _ *Profile, key string) ([]byte, error)

func (*AKV) List added in v1.11.0

func (b *AKV) List(ctx context.Context, _ *Profile) ([]Key, error)

func (*AKV) Put added in v1.11.0

func (b *AKV) Put(ctx context.Context, _ *Profile, key, value string, overwrite bool) error

func (*AKV) SetParameter added in v1.11.0

func (b *AKV) SetParameter(key string, value interface{})

type AWSParameterStore added in v1.10.0

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

AWSParameterStore implements Backend for AWS Parameter Store service.

func NewAWSParameterStore added in v1.10.0

func NewAWSParameterStore(ctx context.Context, p *Profile) (*AWSParameterStore, error)

NewAWSParameterStore returns a new AWSParameterStore with an initialized AWS SSM client.

func (*AWSParameterStore) CheckExists added in v1.10.0

func (s *AWSParameterStore) CheckExists(ctx context.Context, p *Profile, key string) (bool, error)

CheckExists returns true if there exists a value for a given key.

func (*AWSParameterStore) Close added in v1.10.0

func (s *AWSParameterStore) Close() error

Close is not effictive for this backend

func (*AWSParameterStore) Delete added in v1.10.0

func (s *AWSParameterStore) Delete(ctx context.Context, p *Profile, key string) error

Delete removes the parameter by its key

func (*AWSParameterStore) Get added in v1.10.0

func (s *AWSParameterStore) Get(ctx context.Context, p *Profile, key string) ([]byte, error)

Get returns the decrypted value for a parameter by key.

func (*AWSParameterStore) List added in v1.10.0

func (s *AWSParameterStore) List(ctx context.Context, p *Profile) (list []Key, err error)

List returns all keys available.

func (*AWSParameterStore) Put added in v1.10.0

func (s *AWSParameterStore) Put(ctx context.Context, p *Profile, key, value string, overwrite bool) error

Put write the parameter and its value using encryption ;either the default key or the one specified in the profile.

func (*AWSParameterStore) SetParameter added in v1.11.0

func (s *AWSParameterStore) SetParameter(key string, value interface{})

type Backend

type Backend interface {
	Get(ctx context.Context, p *Profile, key string) ([]byte, error)
	List(ctx context.Context, p *Profile) ([]Key, error)
	CheckExists(ctx context.Context, p *Profile, key string) (bool, error)
	Put(ctx context.Context, p *Profile, key, value string, overwrite bool) error
	Delete(ctx context.Context, p *Profile, key string) error
	SetParameter(key string, value interface{})
	Close() error
}

type FileStore added in v1.11.0

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

func NewFileStore added in v1.11.0

func NewFileStore(storeLocation, projectID string) *FileStore

func (*FileStore) CheckExists added in v1.11.0

func (f *FileStore) CheckExists(_ context.Context, _ *Profile, key string) (bool, error)

CheckExists checks if given key exists in the (file)store

func (*FileStore) Close added in v1.11.0

func (f *FileStore) Close() error

func (*FileStore) Delete added in v1.11.0

func (f *FileStore) Delete(_ context.Context, _ *Profile, key string) error

Delete a key from the store. Delete overwrites the entire store file with the updated store values

func (*FileStore) Get added in v1.11.0

func (f *FileStore) Get(_ context.Context, _ *Profile, key string) ([]byte, error)

Get reads the store from file, fetches and decrypt the value for given key

func (*FileStore) List added in v1.11.0

func (f *FileStore) List(_ context.Context, _ *Profile) (keys []Key, err error)

List reads the store from file, and fetch all keys

func (*FileStore) Put added in v1.11.0

func (f *FileStore) Put(_ context.Context, _ *Profile, key, value string, overwrite bool) error

Put a new Key with encrypted password in the store. Put overwrites the entire store file with the updated store

func (*FileStore) SetMasterPassword added in v1.11.0

func (f *FileStore) SetMasterPassword(password []byte)

SetMasterPassword is not relevant for this backend

func (*FileStore) SetParameter added in v1.11.0

func (f *FileStore) SetParameter(key string, value interface{})

type FileStoreEntry added in v1.11.0

type FileStoreEntry struct {
	Value   []byte
	KeyInfo Key
}

type GSM

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

func NewGSM

func NewGSM(client *secretmanager.Client) *GSM

func (*GSM) CheckExists

func (b *GSM) CheckExists(ctx context.Context, p *Profile, key string) (bool, error)

func (*GSM) Close

func (b *GSM) Close() error

func (*GSM) Delete

func (b *GSM) Delete(ctx context.Context, p *Profile, key string) error

func (*GSM) Get

func (b *GSM) Get(ctx context.Context, p *Profile, key string) ([]byte, error)

func (*GSM) List

func (b *GSM) List(ctx context.Context, p *Profile) ([]Key, error)

func (*GSM) Put

func (b *GSM) Put(ctx context.Context, p *Profile, key, value string, overwrite bool) error

func (*GSM) SetParameter added in v1.11.0

func (b *GSM) SetParameter(key string, value interface{})

type KMS

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

func NewKMS

func NewKMS(kmsService *cloudkms.Service, storageClient *storage.Client) *KMS

func (*KMS) CheckExists

func (b *KMS) CheckExists(ctx context.Context, p *Profile, key string) (bool, error)

func (*KMS) Close

func (b *KMS) Close() error

func (*KMS) Delete

func (b *KMS) Delete(ctx context.Context, p *Profile, key string) error

func (*KMS) Get

func (b *KMS) Get(ctx context.Context, p *Profile, key string) ([]byte, error)

func (*KMS) List

func (b *KMS) List(ctx context.Context, p *Profile) ([]Key, error)

func (*KMS) Put

func (b *KMS) Put(ctx context.Context, p *Profile, key, value string, overwrite bool) error

func (*KMS) SetParameter added in v1.11.0

func (b *KMS) SetParameter(key string, value interface{})

type Key

type Key struct {
	Name      string
	CreatedAt time.Time
	Owner     string
	Info      string
}

type Profile

type Profile struct {
	Backend     string
	Label       string
	ProjectID   string
	Location    string
	Keyring     string
	CryptoKey   string
	Bucket      string
	VaultUrl    string
	SecretRunes []rune
}

Profile describes a single profile in a .kiya configuration

Jump to

Keyboard shortcuts

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