vaulttest

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const VAULT_CONFIG_TEMPLATE = `` /* 127-byte string literal not displayed */

VAULT_CONFIG_TEMPLATE A very minimal Vault config. Not even a true 'template', since all we're doing is interpolating the address into the mix.

Variables

This section is empty.

Functions

This section is empty.

Types

type VaultServer

type VaultServer struct {
	Command       *exec.Cmd
	Running       bool
	UnsealKey     string
	RootToken     string
	UserToken     string
	UserTokenFile string
	Address       string
}

VaultServer Representation of a Vault Server

func NewVaultServer

func NewVaultServer(address string) *VaultServer

NewVaultServer creates a VaultServer struct with either the address provided, or the default address of 127.0.0.1:8200

func (*VaultServer) DevServerStart

func (t *VaultServer) DevServerStart()

DevServerStart Starts a 'dev mode' server, and parses it's output to record the Unseal Keys and Root Token in the VaultServer object

func (*VaultServer) ServerShutDown

func (t *VaultServer) ServerShutDown()

ServerShutDown shuts the server down

func (*VaultServer) ServerStart

func (t *VaultServer) ServerStart()

ServerStart starts the VaultServer in normal mode. This server is sealed by default.

func (*VaultServer) VaultTestClient

func (t *VaultServer) VaultTestClient() *api.Client

VaultTestClient returns a configured vault client for the test vault server. By default the client returned has the root token for the test vault instance set. If you want something else, you will need to reconfigure it.

Jump to

Keyboard shortcuts

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