vault

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var VaultDatabaseConfigPrefix = []string{"/database/config/"}
View Source
var VaultPolicyPrefix = []string{"/sys/policy/"}
View Source
var VaultPolicyProtected = []string{"/sys/policy/default", "/sys/policy/root"}

Functions

func AddPrefixToVKVPath

func AddPrefixToVKVPath(p, mountPath, apiPrefix string) string

AddPrefixToVKVPath mutates the provided path

func EnsureNoLeadingSlash

func EnsureNoLeadingSlash(s string) string

EnsureNoLeadingSlash ensures the given string has a trailing slash.

func EnsureNoTrailingSlash

func EnsureNoTrailingSlash(s string) string

EnsureNoTrailingSlash ensures the given string has a trailing slash.

func EnsureTrailingSlash

func EnsureTrailingSlash(s string) string

EnsureTrailingSlash ensures the given string has a trailing slash.

func ExtractListData

func ExtractListData(secret *api.Secret) ([]interface{}, bool)

ExtractListData reads the secret and returns a typed list of data and a boolean indicating whether the extraction was successful.

func IsDatabaseConfig

func IsDatabaseConfig(key string) bool

IsDatabaseConfig

func IsKVv2

func IsKVv2(path string, client *api.Client) (string, bool, error)

IsKVv2 determines if the given path is of secret engine version 2

func IsPolicy

func IsPolicy(key string) bool

IsPolicy

func IsPolicyRoot

func IsPolicyRoot(key string) bool

IsPolicyRoot

func SanitizePath

func SanitizePath(s string) string

SanitizePath removes any leading or trailing things from a "path".

Types

type Config

type Config struct {
	Address string
	Token   string
	Client  *vaultapi.Client
	Retries int
	Ignore  *Ignore
	// contains filtered or unexported fields
}

Config

func NewClient

func NewClient(vc *Config) (*Config, error)

NewClient

func (*Config) DeletePolicy

func (vc *Config) DeletePolicy(name string) error

DeletePolicy

func (*Config) DeleteSecret

func (vc *Config) DeleteSecret(key string) error

DeleteSecret

func (*Config) ListPolicies

func (vc *Config) ListPolicies() ([]string, error)

ListPolicies

func (*Config) ListSecrets

func (vc *Config) ListSecrets(key string) ([]string, error)

ListSecrets

func (*Config) OverwritePolicy

func (vc *Config) OverwritePolicy(name string, rules string) error

OverwritePolicy

func (*Config) OverwriteSecret

func (vc *Config) OverwriteSecret(path string, secret map[string]interface{}) error

OverwriteSecret

func (*Config) PurgePaths

func (vc *Config) PurgePaths(paths []string) error

PurgePaths

type Ignore

type Ignore struct {
	Keys  []string
	Paths []string
}

Ignore

type PurgeContext

type PurgeContext struct {
	// contains filtered or unexported fields
}

PurgeContext

Jump to

Keyboard shortcuts

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