Documentation ¶
Overview ¶
Package testing provides utilities for testing code that requires a Vault client
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakeVaultServer ¶
type FakeVaultServer struct {
// contains filtered or unexported fields
}
func NewFakeVaultServer ¶
func NewFakeVaultServer(t *testing.T) *FakeVaultServer
NewFakeVaultServer returns a new fake vault server that can be used to fake vault secret lookups
func (*FakeVaultServer) ConfigureClient ¶
func (s *FakeVaultServer) ConfigureClient(clientConfig *vaultapi.Config)
ConfigureClient can be used to configure a vault client to talk to this fake vault server instance
func (*FakeVaultServer) ExpectGithubLogin ¶
func (s *FakeVaultServer) ExpectGithubLogin(githubToken string, vaultToken string)
ExpectGithubLogin configures the server to expect a github login with a specific Github token (by default any token is expected)
func (*FakeVaultServer) Server ¶ added in v0.0.53
func (s *FakeVaultServer) Server() *httptest.Server
Server returns the underlying httptest.Server associated with this fake vault server instance
func (*FakeVaultServer) SetSecret ¶
func (s *FakeVaultServer) SetSecret(path string, data map[string]interface{})
SetSecret adds a secret to the fake server
Click to show internal directories.
Click to hide internal directories.