vault

package
v0.0.0-...-6df56f3 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddPrefixToVKVPath

func AddPrefixToVKVPath(p, mountPath, apiPrefix string) string

AddPrefixToVKVPath in v2 di/bluh will become di/data/bluh and an optional version param in the url

func KvPreflightVersionRequest

func KvPreflightVersionRequest(client *vaultApi.Client, path string) (string, int, error)

KvPreflightVersionRequest taken from vault/command/kv_helpers.go check if the path given is kv v2 or v1

Types

type ApproleAuth

type ApproleAuth struct {
	RoleID string `yaml:"approle"`
}

type AuthType

type AuthType string
const (
	ApproleAuthType AuthType = "approle"
)

type Client

type Client interface {
	ReadAsVal(secretPath, optionalSecretVersion string) (*VaultPayload, error)
	Read(secretPath, optionalSecretVersion string) (map[string]interface{}, error)
}

func NewClientFromApprole

func NewClientFromApprole(vaultAddr, appRole string) Client

type SecretInfo

type SecretInfo struct {
	Path                  string `yaml:"path"`
	SecretValuePath       string `yaml:"valPath"`
	OptionalSecretVersion string `yaml:"secretVersion"`
}

type SourceInput

type SourceInput struct {
	VaultAddr     string       `yaml:"address"`
	VaultAuthType AuthType     `yaml:"authType"`
	Approle       *ApproleAuth `yaml:"-"`
	Secret        SecretInfo   `yaml:"value"`
}

func (*SourceInput) UnmarshalYAML

func (s *SourceInput) UnmarshalYAML(n *yaml.Node) error

type VaultPayload

type VaultPayload struct {
	// Attribute name in module
	// +optional
	Key string `json:"key"`

	JsonVal   *ctyjson.SimpleJSONValue
	JsonBytes []byte
	// contains filtered or unexported fields
}

OutputStatus outputs the values of Vault output

type Vaultclient

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

func (*Vaultclient) Read

func (v *Vaultclient) Read(secretPath, optionalSecretVersion string) (map[string]interface{}, error)

func (*Vaultclient) ReadAsVal

func (v *Vaultclient) ReadAsVal(secretPath, optionalSecretVersion string) (*VaultPayload, error)

Jump to

Keyboard shortcuts

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