Documentation ¶
Overview ¶
Package testing provides utilities for testing code that requires a Vault client
Index ¶
- type FakeVaultServer
- func (s *FakeVaultServer) ConfigureClient(clientConfig *vaultapi.Config)
- func (s *FakeVaultServer) ExpectGithubLogin(githubToken string, vaultToken string)
- func (s *FakeVaultServer) GetClient() *vaultapi.Client
- func (s *FakeVaultServer) Server() *httptest.Server
- func (s *FakeVaultServer) SetSecret(path string, data map[string]interface{})
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) GetClient ¶ added in v1.0.55
func (s *FakeVaultServer) GetClient() *vaultapi.Client
GetClient can be used to quickly construct a vault client connected to this fake vault server instance
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