azure

package
v6.2.13 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Overview

Package azure is a generated GoMock package.

Index

Constants

View Source
const (
	DefaultChainCredentialType    string = "default"
	ManagedIdentityCredentialType string = "managed_identity"
)
View Source
const StorageType = "azure-keyvault"

StorageType is the name of this storage type, used in health check reports and configuration.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthConfig

type AuthConfig struct {
	// Type specifies the type of credential to use for authentication to the Azure Key Vault.
	Type string `koanf:"type"`
}

AuthConfig contains the config options to configure the credential to use for authentication to the Azure Key Vault.

type Config

type Config struct {
	// Token to authenticate to the Vault cluster.
	URL string `koanf:"url"`
	// Timeout specifies the Vault client timeout.
	Timeout time.Duration `koanf:"timeout"`
	// UseHSM specifies whether	to store the key in a hardware security module (HSM).
	// If true, the Azure Key Vault must be configured for HSM usage.
	UseHSM bool `koanf:"hsm"`
	// Auth specifies the credential to use for authentication to the Azure Key Vault.
	Auth AuthConfig `koanf:"auth"`
}

Config contains the config options to configure the vaultKVStorage backend

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns the default configuration for the Azure Key Vault storage backend.

type Keyvault

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

func New

func New(config Config) (*Keyvault, error)

New creates a new Azure Key Vault storage backend. If useHSM is true, the key type will be azkeys.KeyTypeECHSM, otherwise azkeys.KeyTypeEC.

func (Keyvault) CheckHealth

func (a Keyvault) CheckHealth() map[string]core.Health

func (Keyvault) DeletePrivateKey

func (a Keyvault) DeletePrivateKey(ctx context.Context, keyName string) error

func (Keyvault) GetPrivateKey

func (a Keyvault) GetPrivateKey(ctx context.Context, keyName string, version string) (crypto.Signer, error)

func (Keyvault) ListPrivateKeys

func (a Keyvault) ListPrivateKeys(ctx context.Context) []spi.KeyNameVersion

func (Keyvault) Name

func (a Keyvault) Name() string

func (Keyvault) NewPrivateKey

func (a Keyvault) NewPrivateKey(ctx context.Context, keyName string) (crypto.PublicKey, string, error)

NewPrivateKey creates a new EC key in Azure Key Vault. Azure Key Vault EC keys can only be used for signing, they can't be used for decryption/ECDH.

func (Keyvault) PrivateKeyExists

func (a Keyvault) PrivateKeyExists(ctx context.Context, keyName string, version string) (bool, error)

func (Keyvault) SavePrivateKey

func (a Keyvault) SavePrivateKey(ctx context.Context, kid string, key crypto.PrivateKey) error

type MockkeyVaultClient

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

MockkeyVaultClient is a mock of keyVaultClient interface.

func NewMockkeyVaultClient

func NewMockkeyVaultClient(ctrl *gomock.Controller) *MockkeyVaultClient

NewMockkeyVaultClient creates a new mock instance.

func (*MockkeyVaultClient) CreateKey

CreateKey mocks base method.

func (*MockkeyVaultClient) DeleteKey

DeleteKey mocks base method.

func (*MockkeyVaultClient) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockkeyVaultClient) GetKey

func (m *MockkeyVaultClient) GetKey(ctx context.Context, name, version string, options *azkeys.GetKeyOptions) (azkeys.GetKeyResponse, error)

GetKey mocks base method.

func (*MockkeyVaultClient) NewListKeyPropertiesPager

NewListKeyPropertiesPager mocks base method.

func (*MockkeyVaultClient) Sign

func (m *MockkeyVaultClient) Sign(ctx context.Context, name, version string, parameters azkeys.SignParameters, options *azkeys.SignOptions) (azkeys.SignResponse, error)

Sign mocks base method.

type MockkeyVaultClientMockRecorder

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

MockkeyVaultClientMockRecorder is the mock recorder for MockkeyVaultClient.

func (*MockkeyVaultClientMockRecorder) CreateKey

func (mr *MockkeyVaultClientMockRecorder) CreateKey(ctx, name, parameters, options any) *gomock.Call

CreateKey indicates an expected call of CreateKey.

func (*MockkeyVaultClientMockRecorder) DeleteKey

func (mr *MockkeyVaultClientMockRecorder) DeleteKey(ctx, name, options any) *gomock.Call

DeleteKey indicates an expected call of DeleteKey.

func (*MockkeyVaultClientMockRecorder) GetKey

func (mr *MockkeyVaultClientMockRecorder) GetKey(ctx, name, version, options any) *gomock.Call

GetKey indicates an expected call of GetKey.

func (*MockkeyVaultClientMockRecorder) NewListKeyPropertiesPager

func (mr *MockkeyVaultClientMockRecorder) NewListKeyPropertiesPager(options any) *gomock.Call

NewListKeyPropertiesPager indicates an expected call of NewListKeyPropertiesPager.

func (*MockkeyVaultClientMockRecorder) Sign

func (mr *MockkeyVaultClientMockRecorder) Sign(ctx, name, version, parameters, options any) *gomock.Call

Sign indicates an expected call of Sign.

Jump to

Keyboard shortcuts

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