vault

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*Transit
	*KV
	*vaultapi.Client
}

Client is the vault client

func NewClient

func NewClient() (*Client, error)

NewClient returns a new vault client

type KV

type KV struct {
	*vaultapi.Client
}

KV is the kv secret engine

func (*KV) GetKeys

func (kv *KV) GetKeys(key string) ([]string, error)

GetKeys returns all keys for the mount and path recursively

func (*KV) GetSecrets

func (kv *KV) GetSecrets(key string) ([]map[string]interface{}, error)

GetSecrets returns vault secrets on the given path

func (*KV) Put

func (kv *KV) Put(key string, data map[string]interface{}) error

Put writes the secret to the kv path

func (*KV) ReadSecretData

func (kv *KV) ReadSecretData(key string) (map[string]interface{}, error)

Read reads the secret for the input key

type Transit

type Transit struct {
	*vaultapi.Client
}

Transit is the transit engine vault client

func (*Transit) Decrypt

func (t *Transit) Decrypt(mountpath, key string, ciphertext []byte) ([]byte, error)

Decrypt decrypts the given encrypted value using the specified transit engine path and key

func (*Transit) Encrypt

func (t *Transit) Encrypt(mountpath, key string, value []byte) ([]byte, error)

Encrypt encrypts the given value using the specified transit engine path and key

func (*Transit) IsEncrypted

func (t *Transit) IsEncrypted(value string) bool

IsEncrypted check with regexp that value encrypter by Vault transit secret engine

Jump to

Keyboard shortcuts

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