client

package
v0.0.90 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SecretUnsealKeys name of the secret for unsealing keys
	SecretUnsealKeys = "vault-unseal-keys"

	// KeyUnsealKeys secret key for the unseal key
	KeyUnsealKeys = "vault-root"

	// SecretVaultTLS secret name for TLS
	SecretVaultTLS = "vault-tls"

	// KeyVaultTLS secret key for TLS cert
	KeyVaultTLS = "ca.crt"
)

Variables

This section is empty.

Functions

func ReadYaml

func ReadYaml(client Client, path string) (string, error)

ReadYaml reads the secrets yaml from the vault client

func WriteYAML

func WriteYAML(client Client, path string, yaml string) error

WriteYAML writes the vault YAML to the given path

Types

type Client

type Client interface {

	// Read reads a tree of values from the vault
	Read(name string) (map[string]interface{}, error)

	// Write writes the given tree of values to the given name
	Write(name string, values map[string]interface{}) error

	// String returns the textual representation
	String() string
}

Client interface for vault clients

func NewVaultClient

func NewVaultClient(f *Factory) (Client, error)

NewVaultClient creates a new client from the factory

type Factory

type Factory struct {
	CertFile    string
	DisableCert bool
	// contains filtered or unexported fields
}

Factory is a simple vault client factory which initialises a vault client

func NewFactory

func NewFactory(kubeClient kubernetes.Interface, namespace string) *Factory

NewFactory creates a new factory

func NewFactoryFromJX

func NewFactoryFromJX(f jxfactory.Factory) (*Factory, error)

NewFactoryFromJX creates a new vault factory from a jx client factory

func (*Factory) NewClient

func (f *Factory) NewClient() (*vaultapi.Client, error)

NewClient creates a new vault client

type VaultClient

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

VaultClient a client for vault

func (*VaultClient) Read

func (v *VaultClient) Read(name string) (map[string]interface{}, error)

Read reads a tree of data from a path

func (*VaultClient) String

func (v *VaultClient) String() string

String returns a textual representation

func (*VaultClient) Write

func (v *VaultClient) Write(name string, values map[string]interface{}) error

Write writes a tree of data to vault

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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