vault

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2023 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package vault provides methods for commonly used vault actions that are used in end-to-end tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateKvPasswordCredential

func CreateKvPasswordCredential(t testing.TB, secretPath string, user string, kvPolicyFilePath string) (secretName string, password string)

CreateKvPasswordCredential creates a username/password credential in vault and creates a vault policy to be able to read that credential. Returns the name of the policy

func CreateKvPrivateKeyCredential

func CreateKvPrivateKeyCredential(t testing.TB, secretPath string, user string, keyPath string, kvPolicyFilePath string) string

CreateKvPrivateKeyCredential creates a private key credential in vault and creates a vault policy to be able to read that credential. Returns the name of the policy.

func Setup

func Setup(t testing.TB) (vaultAddr string, boundaryPolicyName string, kvPolicyFilePath string)

Setup verifies if appropriate credentials are set and adds the boundary controller policy to vault. Returns the vault address.

func WritePolicy

func WritePolicy(t testing.TB, ctx context.Context, policyFilePath string) string

WritePolicy adds a policy to vault. Provide a name for the policy that you want to create as well as the path to the file that contains the policy definition. Returns a policy name

Types

type CreateTokenResponse

type CreateTokenResponse struct {
	Auth struct {
		Client_Token string
	}
}

CreateTokenResponse parses the json response from running `vault token create`

Jump to

Keyboard shortcuts

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