vault

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSecretNotFound = errors.New("no secret at given path")
	ErrVaultConfig    = errors.New("secret does not contain a valid vault configuration")
)

Functions

func Delete

func Delete(c *Client, path string) error

func Read

func Read[T any](c *Client, path string) (*T, error)

func Write

func Write[T any](c *Client, path string, params *T) error

Types

type Client

type Client struct {
	Logical Logical
	Mount   string
}

func NewRootClient

func NewRootClient(creds []byte) (*Client, error)

type Config

type Config struct {
	// Token is the Vault token to use for authentication.
	Token string `json:"token"`
	// Address is the Vault address to use for authentication.
	Address string `json:"address"`
	// Insecure enables or disables SSL verification
	Insecure bool `json:"insecure,omitempty"`
	// TLS is a flag that address is a TLS address.
	TLS bool `json:"tls,omitempty"`
	// Path is the mount root of the nats secrets engine.
	Path string `json:"path"`
}

type Logical

type Logical interface {
	List(path string) (*api.Secret, error)
	Read(path string) (*api.Secret, error)
	Write(path string, data map[string]interface{}) (*api.Secret, error)
	Delete(path string) (*api.Secret, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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