vault

package
v0.0.0-...-54413df Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: Apache-2.0 Imports: 8 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 {
	// contains filtered or unexported fields
}

Client enhances official Vault API client that does not provide easy capabilities to determine whether kv1 or kv2 secret engine is used.

func NewClient

func NewClient(logger logger.Logger, vaultClient VaultClient, privateKey *stdRsa.PrivateKey) *Client

func (*Client) Delete

func (c *Client) Delete(path string) (*api.Secret, error)

Delete deletes secret at `path` and handles both V1 and V2 KV secret API of Vault.

func (*Client) PrivateKey

func (c *Client) PrivateKey() *stdRsa.PrivateKey

func (*Client) RawWrite

func (c *Client) RawWrite(path string, data map[string]interface{}) (*api.Secret, error)

RawWrite writes `data` to `path` and DOES NOT handle both V1 and V2 KV secret API of Vault. It just writes.

func (*Client) Read

func (c *Client) Read(path string) (*api.Secret, error)

Read reads **latest** version of secret at `path` and handles both V1 and V2 KV secret API of Vault.

func (*Client) SetToken

func (c *Client) SetToken(v string)

func (*Client) Write

func (c *Client) Write(path string, data map[string]interface{}) (*api.Secret, error)

Write writes `data` to `path` and handles both V1 and V2 KV secret API of Vault.

type VaultClient

type VaultClient interface {
	Logical() *api.Logical
	SetToken(v string)
	CurrentWrappingLookupFunc() api.WrappingLookupFunc
	SetWrappingLookupFunc(lookupFunc api.WrappingLookupFunc)
	NewRequest(method, requestPath string) *api.Request
	RawRequest(r *api.Request) (*api.Response, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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