testing

package
v1.0.47 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2023 License: BSD-3-Clause Imports: 9 Imported by: 0

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

Jump to

Keyboard shortcuts

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