Documentation ¶
Overview ¶
Package fake contains a fake Vault signer for use in tests
Index ¶
- type FakeClient
- func (c *FakeClient) NewRequest(method, requestPath string) *vault.Request
- func (c *FakeClient) RawRequest(r *vault.Request) (*vault.Response, error)
- func (c *FakeClient) SetToken(v string)
- func (c *FakeClient) WithNewRequest(r *vault.Request) *FakeClient
- func (c *FakeClient) WithRawRequest(resp *vault.Response, err error) *FakeClient
- func (c *FakeClient) WithRawRequestFn(fn func(t *testing.T, r *vault.Request) (*vault.Response, error)) *FakeClient
- type Vault
- func (v *Vault) IsVaultInitializedAndUnsealed() error
- func (v *Vault) New(ns string, sl internalinformers.SecretLister, iss cmapi.GenericIssuer) (*Vault, error)
- func (v *Vault) Sign(csrPEM []byte, duration time.Duration) ([]byte, []byte, error)
- func (v *Vault) WithNew(...) *Vault
- func (v *Vault) WithSign(certPEM, caPEM []byte, err error) *Vault
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakeClient ¶ added in v1.12.0
type FakeClient struct { NewRequestS *vault.Request RawRequestFn func(r *vault.Request) (*vault.Response, error) GotToken string T *testing.T }
func NewFakeClient ¶
func NewFakeClient() *FakeClient
func (*FakeClient) NewRequest ¶ added in v1.12.0
func (c *FakeClient) NewRequest(method, requestPath string) *vault.Request
func (*FakeClient) RawRequest ¶ added in v1.12.0
func (*FakeClient) SetToken ¶ added in v1.12.0
func (c *FakeClient) SetToken(v string)
func (*FakeClient) WithNewRequest ¶ added in v1.12.0
func (c *FakeClient) WithNewRequest(r *vault.Request) *FakeClient
func (*FakeClient) WithRawRequest ¶ added in v1.12.0
func (c *FakeClient) WithRawRequest(resp *vault.Response, err error) *FakeClient
func (*FakeClient) WithRawRequestFn ¶ added in v1.12.0
func (c *FakeClient) WithRawRequestFn(fn func(t *testing.T, r *vault.Request) (*vault.Response, error)) *FakeClient
type Vault ¶
type Vault struct { NewFn func(string, internalinformers.SecretLister, cmapi.GenericIssuer) (*Vault, error) SignFn func([]byte, time.Duration) ([]byte, []byte, error) IsVaultInitializedAndUnsealedFn func() error }
Vault is a mock implementation of the Vault interface
func (*Vault) IsVaultInitializedAndUnsealed ¶
IsVaultInitializedAndUnsealed always returns nil
func (*Vault) New ¶
func (v *Vault) New(ns string, sl internalinformers.SecretLister, iss cmapi.GenericIssuer) (*Vault, error)
New call NewFn and returns a pointer to the fake Vault.
func (*Vault) WithNew ¶
func (v *Vault) WithNew(f func(string, internalinformers.SecretLister, cmapi.GenericIssuer) (*Vault, error)) *Vault
WithNew sets the fake Vault's New function.
Click to show internal directories.
Click to hide internal directories.