keyvault

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package keyvault provides an in-memory mock implementation of Azure Key Vault.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mock

type Mock struct {
	// contains filtered or unexported fields
}

Mock is an in-memory mock implementation of Azure Key Vault.

func New

func New(opts *config.Options) *Mock

New creates a new Key Vault mock with the given configuration options.

func (*Mock) CreateSecret

func (m *Mock) CreateSecret(_ context.Context, cfg driver.SecretConfig, value []byte) (*driver.SecretInfo, error)

CreateSecret creates a new secret with an initial value.

func (*Mock) DeleteSecret

func (m *Mock) DeleteSecret(_ context.Context, name string) error

DeleteSecret soft-deletes a secret by name, scheduling it for deletion after a recovery window.

func (*Mock) GetSecret

func (m *Mock) GetSecret(_ context.Context, name string) (*driver.SecretInfo, error)

GetSecret retrieves secret metadata by name.

func (*Mock) GetSecretValue

func (m *Mock) GetSecretValue(_ context.Context, name, versionID string) (*driver.SecretVersion, error)

GetSecretValue retrieves a secret value. Empty versionID returns the current version.

func (*Mock) ListSecretVersions

func (m *Mock) ListSecretVersions(_ context.Context, name string) ([]driver.SecretVersion, error)

ListSecretVersions lists all versions of a secret.

func (*Mock) ListSecrets

func (m *Mock) ListSecrets(_ context.Context) ([]driver.SecretInfo, error)

ListSecrets lists all secrets, excluding soft-deleted ones.

func (*Mock) PutSecretValue

func (m *Mock) PutSecretValue(_ context.Context, name string, value []byte) (*driver.SecretVersion, error)

PutSecretValue stores a new version of a secret value.

Jump to

Keyboard shortcuts

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