vault

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Capability added in v0.1.1

type Capability struct {
	Create bool
	Read   bool
	Update bool
	Delete bool
	List   bool
	Root   bool
}

Capability represents a tokens caps for a specific path.

func (*Capability) String added in v0.1.1

func (c *Capability) String() string

type Engines added in v0.2.0

type Engines map[string][]string

Engines struct that hols all engines key is the namespace.

type Namespaces added in v0.2.0

type Namespaces map[string][]string

Namespaces represents vault hierarchical namespaces.

type Secrets added in v0.0.11

type Secrets map[string]interface{}

Secrets holds all recursive secrets of a certain path.

type Vault

type Vault struct {
	Client *api.Client
}

Vault represents a vault struct used for reading and writing secrets.

func NewClient

func NewClient(addr, token string) (*Vault, error)

NewClient returns a new vault client wrapper.

func NewDefaultClient added in v0.2.0

func NewDefaultClient() (*Vault, error)

NewDefaultClient returns a new vault client wrapper.

func (*Vault) CreateNamespaceErrorIfNotForced added in v0.2.0

func (v *Vault) CreateNamespaceErrorIfNotForced(parentNS, nsName string, force bool) error

CreateNamespaceErrorIfNotForced creates a namespace returns no error if force is true.

func (*Vault) DeleteNamespace added in v0.2.0

func (v *Vault) DeleteNamespace(parentns, ns string) error

DeleteNamespace deletes a namespace.

func (*Vault) DisableKV2Engine added in v0.0.2

func (v *Vault) DisableKV2Engine(rootPath string) error

DisableKV2Engine disables the kv2 engine at a specified path.

func (*Vault) EnableKV1Engine added in v0.6.0

func (v *Vault) EnableKV1Engine(rootPath string) error

EnableKV1Engine enables the kv1 engine at a specified path.

func (*Vault) EnableKV2Engine added in v0.0.2

func (v *Vault) EnableKV2Engine(rootPath string) error

EnableKV2Engine enables the kv2 engine at a specified path.

func (*Vault) EnableKV2EngineErrorIfNotForced added in v0.1.1

func (v *Vault) EnableKV2EngineErrorIfNotForced(force bool, path string) error

EnableKV2EngineErrorIfNotForced enables a KVv2 Engine and errors if already enabled, unless force is set to true.

func (*Vault) GetCapabilities added in v0.1.1

func (v *Vault) GetCapabilities(path string) (*Capability, error)

GetCapabilities returns the current authenticated tokens capabilities for a given path.

func (*Vault) IsKVv1 added in v0.6.0

func (v *Vault) IsKVv1(rootPath string) (bool, error)

IsKVv1 returns true if the current path is a KVv1 Engine.

func (*Vault) ListAllKVSecretEngines added in v0.2.0

func (v *Vault) ListAllKVSecretEngines(ns string) (Engines, error)

ListAllKVSecretEngines returns a list of all visible KV secret engines.

func (*Vault) ListAllNamespaces added in v0.2.0

func (v *Vault) ListAllNamespaces(ns string) (Namespaces, error)

ListAllNamespaces lists all namespaces of a specified namespace recursively.

func (*Vault) ListKVSecretEngines added in v0.2.0

func (v *Vault) ListKVSecretEngines(ns string) ([]string, error)

ListKVSecretEngines returns a list of all visible KV secret engines.

func (*Vault) ListKeys added in v0.1.0

func (v *Vault) ListKeys(rootPath, subPath string) ([]string, error)

ListKeys returns all keys from vault kv secret path.

func (*Vault) ListNamespaces added in v0.2.0

func (v *Vault) ListNamespaces(ns string) ([]string, error)

ListNamespaces list the namespaces of the specified namespace.

func (*Vault) ListRecursive added in v0.0.2

func (v *Vault) ListRecursive(rootPath, subPath string, skipErrors bool) (*Secrets, error)

ListRecursive returns secrets to a path recursive. nolint: cyclop

func (*Vault) ReadSecretMetadata added in v0.1.2

func (v *Vault) ReadSecretMetadata(rootPath, subPath string) (interface{}, error)

ReadSecretMetadata read the metadata of the secret.

func (*Vault) ReadSecretVersion added in v0.1.2

func (v *Vault) ReadSecretVersion(rootPath, subPath string) (interface{}, error)

ReadSecretVersion read the version of the secret.

func (*Vault) ReadSecrets

func (v *Vault) ReadSecrets(rootPath, subPath string) (map[string]interface{}, error)

ReadSecrets returns a map with all secrets from a kv engine path.

func (*Vault) WriteSecrets added in v0.0.2

func (v *Vault) WriteSecrets(rootPath, subPath string, secrets map[string]interface{}) error

WriteSecrets writes kv secrets to a specified path.

Jump to

Keyboard shortcuts

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