Documentation ¶
Overview ¶
This package contains code that makes it easy to test code that interacts with Hashicorp Vault, by enabling the creation of an in-memory Vault
cluster that is easily disposed of once testing is complete.
Index ¶
- Constants
- func CreateTestCluster(t *testing.T) (net.Listener, *api.Client)
- func GetVaultClientE(config *api.Config, token string) (client.VaultLogicalClient, error)
- func MountVaultSecretEngine(t *testing.T, client client.VaultSysClient, path string, mountType string, ...)
- func ReadVaultSecretE(client client.VaultLogicalClient, path string) (*api.Secret, error)
Constants ¶
View Source
const ( ColorRed = "\033[31m" ColorReset = "\033[0m" )
Variables ¶
This section is empty.
Functions ¶
func CreateTestCluster ¶
CreateTestCluster creates an in-memory Vault cluster that can be used for testing code that interacts with Vault.
func GetVaultClientE ¶
func MountVaultSecretEngine ¶
func MountVaultSecretEngine(t *testing.T, client client.VaultSysClient, path string, mountType string, options map[string]string)
MountVaultSecretEngine configures a new mount within a Vault cluster. It can be used to configure the in-memory Vault client with other mounts beyond the default KV at the `secret/` path.
func ReadVaultSecretE ¶
ReadVaultSecretE reads a secret at the given path from Vault. It is basically a thin wrapper around the built in [Read](https://pkg.go.dev/github.com/hashicorp/vault/api#Logical.Read) method, done for the purpose of making testing of this library easier.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.