keyvault

package
v0.0.0-...-6806e21 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckKeyVaultAccessibility

func CheckKeyVaultAccessibility(ctx context.Context, client secrets.SecretClient) error

TODO: This method is awkward -- move to interface? TODO: or even better, delete this method entirely

func GetKeyVaultName

func GetKeyVaultName(instance runtime.Object) string

GetKeyVaultName extracts the KeyVault name from the generic runtime object

func GetVaultsURL

func GetVaultsURL(vaultName string) string

Types

type SecretClient

type SecretClient struct {
	KeyVaultClient      keyvaults.BaseClient
	KeyVaultName        string
	SecretNamingVersion secrets.SecretNamingVersion

	PurgeDeletedSecrets       bool
	RecoverSoftDeletedSecrets bool
}

SecretClient struct has the Key vault BaseClient that Azure uses and the KeyVault name

func New

func New(
	keyVaultName string,
	creds config.Credentials,
	secretNamingVersion secrets.SecretNamingVersion,
	purgeDeletedSecrets bool,
	recoverSoftDeletedSecrets bool) *SecretClient

New instantiates a new KeyVaultSecretClient instance. TODO(creds-refactor): The keyvaultName argument seems seems redundant since that's in the credentials, but it's used to override the one specified in credentials so it might be right to keep it. Confirm this.

func (*SecretClient) Delete

func (k *SecretClient) Delete(ctx context.Context, key secrets.SecretKey, opts ...secrets.SecretOption) error

Delete deletes a key in KeyVault

func (*SecretClient) Get

func (k *SecretClient) Get(ctx context.Context, key secrets.SecretKey, opts ...secrets.SecretOption) (map[string][]byte, error)

Get gets a key from KeyVault

func (*SecretClient) GetSecretNamingVersion

func (k *SecretClient) GetSecretNamingVersion() secrets.SecretNamingVersion

func (*SecretClient) IsKeyVault

func (k *SecretClient) IsKeyVault() bool

func (*SecretClient) Upsert

func (k *SecretClient) Upsert(ctx context.Context, key secrets.SecretKey, data map[string][]byte, opts ...secrets.SecretOption) error

Upsert updates a key in KeyVault even if it exists already, creates if it doesn't exist

Jump to

Keyboard shortcuts

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