fake

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	SetSecretArgs   map[string]SetSecretCallArgs
	NewFn           func(context.Context, esv1beta1.GenericStore, client.Client, string) (esv1beta1.SecretsClient, error)
	GetSecretFn     func(context.Context, esv1beta1.ExternalSecretDataRemoteRef) ([]byte, error)
	GetSecretMapFn  func(context.Context, esv1beta1.ExternalSecretDataRemoteRef) (map[string][]byte, error)
	GetAllSecretsFn func(context.Context, esv1beta1.ExternalSecretFind) (map[string][]byte, error)
	SecretExistsFn  func(context.Context, esv1beta1.PushSecretRemoteRef) (bool, error)
	SetSecretFn     func() error
	DeleteSecretFn  func() error
}

Client is a fake client for testing.

func New

func New() *Client

New returns a fake provider/client.

func (*Client) Capabilities added in v0.7.0

func (v *Client) Capabilities() esv1beta1.SecretStoreCapabilities

Capabilities return the provider supported capabilities (ReadOnly, WriteOnly, ReadWrite).

func (*Client) Close

func (v *Client) Close(_ context.Context) error

func (*Client) DeleteSecret added in v0.7.0

func (v *Client) DeleteSecret(_ context.Context, _ esv1beta1.PushSecretRemoteRef) error

func (*Client) GetAllSecrets added in v0.5.0

func (v *Client) GetAllSecrets(ctx context.Context, ref esv1beta1.ExternalSecretFind) (map[string][]byte, error)

GetAllSecrets implements the provider.Provider interface.

func (*Client) GetSecret

GetSecret implements the provider.Provider interface.

func (*Client) GetSecretMap

func (v *Client) GetSecretMap(ctx context.Context, ref esv1beta1.ExternalSecretDataRemoteRef) (map[string][]byte, error)

GetSecretMap implements the provider.Provider interface.

func (*Client) NewClient

func (v *Client) NewClient(ctx context.Context, store esv1beta1.GenericStore, kube client.Client, namespace string) (esv1beta1.SecretsClient, error)

NewClient returns a new fake provider.

func (*Client) PushSecret added in v0.7.0

func (v *Client) PushSecret(_ context.Context, secret *corev1.Secret, data esv1beta1.PushSecretData) error

func (*Client) RegisterAs

func (v *Client) RegisterAs(provider *esv1beta1.SecretStoreProvider)

RegisterAs registers the fake client in the schema.

func (*Client) Reset added in v0.5.0

func (v *Client) Reset()

func (*Client) SecretExists added in v0.9.14

func (v *Client) SecretExists(ctx context.Context, ref esv1beta1.PushSecretRemoteRef) (bool, error)

func (*Client) Validate added in v0.4.2

func (v *Client) Validate() (esv1beta1.ValidationResult, error)

func (*Client) ValidateStore added in v0.5.0

func (v *Client) ValidateStore(_ esv1beta1.GenericStore) (admission.Warnings, error)

func (*Client) WithGetAllSecrets added in v0.5.0

func (v *Client) WithGetAllSecrets(secData map[string][]byte, err error) *Client

WithGetAllSecrets wraps the secret data map returned by this fake provider.

func (*Client) WithGetSecret

func (v *Client) WithGetSecret(secData []byte, err error) *Client

WithGetSecret wraps secret data returned by this provider.

func (*Client) WithGetSecretMap

func (v *Client) WithGetSecretMap(secData map[string][]byte, err error) *Client

WithGetSecretMap wraps the secret data map returned by this fake provider.

func (*Client) WithNew

WithNew wraps the fake provider factory function.

func (*Client) WithSetSecret added in v0.7.0

func (v *Client) WithSetSecret(err error) *Client

WithSetSecret wraps the secret response to the fake provider.

type PushSecretData added in v0.9.9

type PushSecretData struct {
	Metadata  *apiextensionsv1.JSON
	SecretKey string
	RemoteKey string
	Property  string
}

func (PushSecretData) GetMetadata added in v0.9.9

func (f PushSecretData) GetMetadata() *apiextensionsv1.JSON

func (PushSecretData) GetProperty added in v0.9.9

func (f PushSecretData) GetProperty() string

func (PushSecretData) GetRemoteKey added in v0.9.9

func (f PushSecretData) GetRemoteKey() string

func (PushSecretData) GetSecretKey added in v0.9.9

func (f PushSecretData) GetSecretKey() string

type SetSecretCallArgs added in v0.7.0

type SetSecretCallArgs struct {
	Value     []byte
	RemoteRef esv1beta1.PushSecretRemoteRef
}

Jump to

Keyboard shortcuts

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