vault

package
v1.4.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllEngineTypes []EngineType

AllEngineTypes is a slice of all the engine types known to pentagon.

Functions

This section is empty.

Types

type AuthType

type AuthType string

AuthType is a custom type to represent different Vault authentication methods.

const (
	// AuthTypeToken expects the Token property to be set on the VaultConfig
	// struct with a token to use.
	AuthTypeToken AuthType = "token"

	// AuthTypeGCPDefault expects the Role property of the VaultConfig struct
	// to be populated with the role that vault expects and will use the machine's
	// default service account, running within GCP.
	AuthTypeGCPDefault AuthType = "gcp-default"
)

type EngineType

type EngineType string

EngineType is an identifier for an engine

const (
	// EngineTypeKeyValueV1 is the identifier for version 1 of the key/value engine.
	EngineTypeKeyValueV1 EngineType = "kv"

	// EngineTypeKeyValueV2 is the identifier for version 2 of the key/value engine.
	EngineTypeKeyValueV2 EngineType = "kv-v2"
)

type Logical

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

Logical is a subset of the inner interface that Logical() returns. I'm only implementing two methods because that's all I need.

type Mock

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

Mock is a mock vault of secrets.

func NewMock

func NewMock(engineMounts map[string]EngineType) *Mock

NewMock returns a new mock vault client. engineMounts is a map of the path prefix to the type of secrets engine that is mounted.

func (*Mock) Read

func (m *Mock) Read(path string) (*api.Secret, error)

Read reads secrets from the mock vault.

func (*Mock) Write

func (m *Mock) Write(
	path string,
	data map[string]interface{},
) (*api.Secret, error)

Write writes secrets into the mock vault.

Jump to

Keyboard shortcuts

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