Documentation
¶
Index ¶
- func CopyOne(ctx context.Context, params CopyParams) (err error)
- func CopyRecursive(ctx context.Context, params CopyParams) (err error)
- type CipherText
- type CopyFunc
- type CopyParams
- type Crypter
- type CrypterFactoryFunc
- type Decrypter
- type DirectoryFS
- type EditParams
- type EncryptedFileEditor
- type Encrypter
- type EncryptionKey
- type FS
- type FileStore
- func (s *FileStore) Get(ctx context.Context, params GetParams) (ciphertext *CipherText, err error)
- func (s *FileStore) GetByKey(ctx context.Context, key string, target any) (*CipherText, error)
- func (s *FileStore) List(_ context.Context, params ListParams) (Iterator, error)
- func (s *FileStore) Set(ctx context.Context, params SetParams) (ciphertext *CipherText, err error)
- type FileStoreIterResult
- func (f FileStoreIterResult) Error() error
- func (f FileStoreIterResult) Get(ctx context.Context, target any) (ciphertext *CipherText, err error)
- func (f FileStoreIterResult) Path() string
- func (f FileStoreIterResult) Set(ctx context.Context, key EncryptionKey, target any) (ciphertext *CipherText, err error)
- type FileStoreIterator
- type GCPSecretManagerStore
- func (c GCPSecretManagerStore) Get(ctx context.Context, params GetParams) (ciphertext *CipherText, err error)
- func (c GCPSecretManagerStore) GetByKey(ctx context.Context, key string, target any) (*CipherText, error)
- func (c GCPSecretManagerStore) List(ctx context.Context, params ListParams) (iter Iterator, err error)
- func (c GCPSecretManagerStore) Set(ctx context.Context, params SetParams) (ciphertext *CipherText, err error)
- type GetParams
- type Iterator
- type IteratorResult
- type ListParams
- type OpenParams
- type SetParams
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyRecursive ¶
func CopyRecursive(ctx context.Context, params CopyParams) (err error)
Types ¶
type CipherText ¶
type CopyParams ¶
type CopyParams struct { Source Store SourcePath string Destination Store DestinationKey EncryptionKey }
type Crypter ¶
func DefaultCrypterFactory ¶
func DefaultCrypterFactory(ctx context.Context, key EncryptionKey) (Crypter, error)
type CrypterFactoryFunc ¶
type CrypterFactoryFunc func(ctx context.Context, key EncryptionKey) (Crypter, error)
type DirectoryFS ¶
type DirectoryFS struct {
Path string
}
func (DirectoryFS) OpenReadable ¶
func (d DirectoryFS) OpenReadable(ctx context.Context, params OpenParams) (stream io.ReadCloser, err error)
func (DirectoryFS) OpenWritable ¶
func (d DirectoryFS) OpenWritable(ctx context.Context, params OpenParams) (stream io.WriteCloser, err error)
func (DirectoryFS) Root ¶
func (d DirectoryFS) Root() string
type EditParams ¶
type EditParams struct { Path string EncryptionKey EncryptionKey }
type EncryptedFileEditor ¶
type EncryptedFileEditor struct {
Store Store
}
func NewEncryptedFileEditor ¶
func NewEncryptedFileEditor(store Store) *EncryptedFileEditor
func (*EncryptedFileEditor) DecryptToFile ¶
func (e *EncryptedFileEditor) DecryptToFile(ctx context.Context, secretPath string) (decryptedPath string, err error)
DecryptToFile writes a secret to a random secret data file on disk
func (*EncryptedFileEditor) Edit ¶
func (e *EncryptedFileEditor) Edit(ctx context.Context, params EditParams) error
Edit opens a workspace KV file in the user's $EDITOR for modifications and applies those modifications
type EncryptionKey ¶
type EncryptionKey struct { Engine string `json:"engine"` Env string `json:"env"` Key string `json:"key"` }
func (EncryptionKey) String ¶
func (k EncryptionKey) String() string
type FS ¶
type FS interface { Root() string OpenReadable(ctx context.Context, params OpenParams) (stream io.ReadCloser, err error) OpenWritable(ctx context.Context, params OpenParams) (stream io.WriteCloser, err error) }
type FileStore ¶
type FileStore struct { FS FS CrypterFactoryFunc CrypterFactoryFunc }
func NewDefaultFileStore ¶
func (*FileStore) GetByKey ¶
GetByKey is a convenience method for getting a value by key A simpler alias interface to Get
type FileStoreIterResult ¶
type FileStoreIterResult struct {
// contains filtered or unexported fields
}
func (FileStoreIterResult) Error ¶
func (f FileStoreIterResult) Error() error
func (FileStoreIterResult) Get ¶
func (f FileStoreIterResult) Get(ctx context.Context, target any) (ciphertext *CipherText, err error)
func (FileStoreIterResult) Path ¶
func (f FileStoreIterResult) Path() string
func (FileStoreIterResult) Set ¶
func (f FileStoreIterResult) Set(ctx context.Context, key EncryptionKey, target any) (ciphertext *CipherText, err error)
type FileStoreIterator ¶
type FileStoreIterator struct {
// contains filtered or unexported fields
}
func NewFileStoreIterator ¶
func NewFileStoreIterator(store *FileStore) *FileStoreIterator
func (FileStoreIterator) Next ¶
func (f FileStoreIterator) Next() <-chan IteratorResult
type GCPSecretManagerStore ¶
type GCPSecretManagerStore struct {
// contains filtered or unexported fields
}
func NewGCPSecretManagerStore ¶
func NewGCPSecretManagerStore(ctx context.Context, projectID string) (store *GCPSecretManagerStore, err error)
func (GCPSecretManagerStore) Get ¶
func (c GCPSecretManagerStore) Get(ctx context.Context, params GetParams) (ciphertext *CipherText, err error)
func (GCPSecretManagerStore) GetByKey ¶
func (c GCPSecretManagerStore) GetByKey(ctx context.Context, key string, target any) (*CipherText, error)
GetByKey is a convenience method for getting a value by key A simpler alias interface to Get
func (GCPSecretManagerStore) List ¶
func (c GCPSecretManagerStore) List(ctx context.Context, params ListParams) (iter Iterator, err error)
func (GCPSecretManagerStore) Set ¶
func (c GCPSecretManagerStore) Set(ctx context.Context, params SetParams) (ciphertext *CipherText, err error)
type Iterator ¶
type Iterator interface {
Next() <-chan IteratorResult
}
type IteratorResult ¶
type IteratorResult interface { Path() string Error() error Get(ctx context.Context, target any) (ciphertext *CipherText, err error) Set(ctx context.Context, key EncryptionKey, target any) (ciphertext *CipherText, err error) }
type ListParams ¶
type ListParams struct {
Path string
}
type OpenParams ¶
type OpenParams struct {
Path string
}
type SetParams ¶
type SetParams struct { Data any Path string EncryptionKey EncryptionKey }
type Store ¶
type Store interface { Get(ctx context.Context, params GetParams) (ciphertext *CipherText, err error) Set(ctx context.Context, params SetParams) (ciphertext *CipherText, err error) GetByKey(ctx context.Context, key string, target any) (ciphertext *CipherText, err error) List(ctx context.Context, params ListParams) (iter Iterator, err error) }
Click to show internal directories.
Click to hide internal directories.