fake

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientWithLoginMock added in v0.7.3

func ClientWithLoginMock(c *vault.Config) (util.Client, error)

Types

type Auth added in v0.5.2

type Auth struct {
	LoginFn LoginFn
}

func NewVaultAuth added in v0.5.2

func NewVaultAuth() Auth

func (Auth) Login added in v0.5.2

func (f Auth) Login(ctx context.Context, authMethod vault.AuthMethod) (*vault.Secret, error)

type DeleteWithContextFn added in v0.7.0

type DeleteWithContextFn func(ctx context.Context, path string) (*vault.Secret, error)

func NewDeleteWithContextFn added in v0.7.0

func NewDeleteWithContextFn(secret map[string]interface{}, err error) DeleteWithContextFn

type ListWithContextFn added in v0.5.2

type ListWithContextFn func(ctx context.Context, path string) (*vault.Secret, error)

type Logical added in v0.5.2

type Logical struct {
	ReadWithDataWithContextFn ReadWithDataWithContextFn
	ListWithContextFn         ListWithContextFn
	WriteWithContextFn        WriteWithContextFn
	DeleteWithContextFn       DeleteWithContextFn
}

func NewVaultLogical added in v0.5.2

func NewVaultLogical() Logical

func (Logical) DeleteWithContext added in v0.7.0

func (f Logical) DeleteWithContext(ctx context.Context, path string) (*vault.Secret, error)

func (Logical) ListWithContext added in v0.5.2

func (f Logical) ListWithContext(ctx context.Context, path string) (*vault.Secret, error)

func (Logical) ReadWithDataWithContext added in v0.5.2

func (f Logical) ReadWithDataWithContext(ctx context.Context, path string, data map[string][]string) (*vault.Secret, error)

func (Logical) WriteWithContext added in v0.5.2

func (f Logical) WriteWithContext(ctx context.Context, path string, data map[string]interface{}) (*vault.Secret, error)

type LoginFn added in v0.5.2

type LoginFn func(ctx context.Context, authMethod vault.AuthMethod) (*vault.Secret, error)

type LookupSelfWithContextFn added in v0.5.2

type LookupSelfWithContextFn func(ctx context.Context) (*vault.Secret, error)

type MockAddHeaderFn added in v0.4.0

type MockAddHeaderFn func(key, value string)

func NewAddHeaderFn added in v0.4.0

func NewAddHeaderFn() MockAddHeaderFn

type MockClearTokenFn added in v0.3.6

type MockClearTokenFn func()

func NewClearTokenFn added in v0.3.6

func NewClearTokenFn() MockClearTokenFn

type MockSetNamespaceFn

type MockSetNamespaceFn func(namespace string)

func NewSetNamespaceFn

func NewSetNamespaceFn() MockSetNamespaceFn

type MockSetTokenFn

type MockSetTokenFn func(v string)

func NewSetTokenFn

func NewSetTokenFn(ofn ...func(v string)) MockSetTokenFn

type MockTokenFn added in v0.3.6

type MockTokenFn func() string

func NewTokenFn added in v0.3.6

func NewTokenFn(v string) MockTokenFn

type ReadWithDataWithContextFn added in v0.5.2

type ReadWithDataWithContextFn func(ctx context.Context, path string, data map[string][]string) (*vault.Secret, error)

func NewReadMetadataWithContextFn added in v0.7.3

func NewReadMetadataWithContextFn(secret map[string]interface{}, err error) ReadWithDataWithContextFn

func NewReadWithContextFn added in v0.5.2

func NewReadWithContextFn(secret map[string]interface{}, err error) ReadWithDataWithContextFn

type RevokeSelfWithContextFn added in v0.5.2

type RevokeSelfWithContextFn func(ctx context.Context, token string) error

type Token added in v0.5.2

type Token struct {
	RevokeSelfWithContextFn RevokeSelfWithContextFn
	LookupSelfWithContextFn LookupSelfWithContextFn
}

func NewAuthTokenFn added in v0.6.0

func NewAuthTokenFn() Token

func (Token) LookupSelfWithContext added in v0.5.2

func (f Token) LookupSelfWithContext(ctx context.Context) (*vault.Secret, error)

func (Token) RevokeSelfWithContext added in v0.5.2

func (f Token) RevokeSelfWithContext(ctx context.Context, token string) error

type VaultClient

type VaultClient struct {
	MockLogical      Logical
	MockAuth         Auth
	MockAuthToken    Token
	MockSetToken     MockSetTokenFn
	MockToken        MockTokenFn
	MockClearToken   MockClearTokenFn
	MockSetNamespace MockSetNamespaceFn
	MockAddHeader    MockAddHeaderFn
}

func (*VaultClient) AddHeader added in v0.4.0

func (c *VaultClient) AddHeader(key, value string)

func (*VaultClient) Auth added in v0.5.2

func (c *VaultClient) Auth() Auth

func (*VaultClient) AuthToken added in v0.5.2

func (c *VaultClient) AuthToken() Token

func (*VaultClient) ClearToken added in v0.3.6

func (c *VaultClient) ClearToken()

func (*VaultClient) Logical added in v0.5.2

func (c *VaultClient) Logical() Logical

func (*VaultClient) SetNamespace

func (c *VaultClient) SetNamespace(namespace string)

func (*VaultClient) SetToken

func (c *VaultClient) SetToken(v string)

func (*VaultClient) Token added in v0.3.6

func (c *VaultClient) Token() string

type VaultListResponse added in v0.5.0

type VaultListResponse struct {
	Metadata *vault.Response
	Data     *vault.Response
}

type WriteWithContextFn added in v0.5.2

type WriteWithContextFn func(ctx context.Context, path string, data map[string]interface{}) (*vault.Secret, error)

func NewWriteWithContextFn added in v0.7.0

func NewWriteWithContextFn(secret map[string]interface{}, err error) WriteWithContextFn

func WriteChangingReadContext added in v0.7.0

func WriteChangingReadContext(secret map[string]interface{}, l Logical) WriteWithContextFn

Jump to

Keyboard shortcuts

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