kv

package
v0.0.0-...-841f565 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

type Storage interface {
	Get(path string) (secretData map[string]interface{}, err error)
	Put(path string, mergeValues map[string]interface{}) (map[string]interface{}, error)
	Edit(path string) error
	EncryptedDataPath() (kvDataPath string)
	DecryptedDataPath() (tmpPath string)
	DecryptToFile(secretPath string) (secretFile string, err error)
}

Storage is the interface that implements the Get and Put methods of the VaultStorage struct

type VaultStorage

type VaultStorage struct {
	Client        *vault.Client
	FSBasePath    string
	EncryptionKey string
}

VaultStorage holds the configuration using Vault transit via the kv library

func (VaultStorage) DecryptToFile

func (s VaultStorage) DecryptToFile(secret string) (path string, err error)

DecryptToFile writes a secret to a random secret data file on disk

func (*VaultStorage) DecryptedDataPath

func (s *VaultStorage) DecryptedDataPath() string

DecryptedDataPath method return the temp path to decrypt secrets to

func (*VaultStorage) Edit

func (s *VaultStorage) Edit(secretPath string) error

Edit opens a workspace KV file in the user's $EDITOR for modifications and applies those modifications

func (*VaultStorage) EncryptedDataPath

func (s *VaultStorage) EncryptedDataPath() string

EncryptedDataPath returns the base path of VaultStorage

func (*VaultStorage) Get

func (s *VaultStorage) Get(path string) (map[string]interface{}, error)

The Get method reads configuration from the local Vault path

func (*VaultStorage) Put

func (s *VaultStorage) Put(path string, mergeValues map[string]interface{}) (map[string]interface{}, error)

The Put method writes configuration to the local Vault path

Jump to

Keyboard shortcuts

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