vault

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2025 License: Apache-2.0 Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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