keyvault

package
v0.0.64 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const KeyVaultCachedId = "azure-keyvault-cached"
View Source
const KeyVaultId = "azure-keyvault"

Variables

This section is empty.

Functions

func LoadEnvironment

func LoadEnvironment(ctx context.Context) (*cloudy.Environment, error)

Types

type KeyVault

type KeyVault struct {
	cloudyazure.AzureCredentials
	VaultURL string
	Client   *azsecrets.Client
}

func NewKeyVault

func NewKeyVault(ctx context.Context, vaultURL string, credentials cloudyazure.AzureCredentials) (*KeyVault, error)

func NewKeyVaultFromEnv

func NewKeyVaultFromEnv(env *cloudy.Environment) (*KeyVault, error)

func (*KeyVault) Configure

func (k *KeyVault) Configure(ctx context.Context) error

func (*KeyVault) DeleteSecret

func (k *KeyVault) DeleteSecret(ctx context.Context, key string) error

func (*KeyVault) GetAllSecrets

func (k *KeyVault) GetAllSecrets(ctx context.Context) (map[string]string, error)

func (*KeyVault) GetSecret

func (k *KeyVault) GetSecret(ctx context.Context, key string) (string, error)

func (*KeyVault) GetSecretBinary

func (k *KeyVault) GetSecretBinary(ctx context.Context, key string) ([]byte, error)

func (*KeyVault) IsConflictErr

func (k *KeyVault) IsConflictErr(err error) bool

func (*KeyVault) IsNotFound

func (k *KeyVault) IsNotFound(err error) bool

func (*KeyVault) SaveSecret

func (k *KeyVault) SaveSecret(ctx context.Context, key string, data string) error

SaveSecret saves the secret in key vault. There are a few funny things that can happen here.

func (*KeyVault) SaveSecretBinary

func (k *KeyVault) SaveSecretBinary(ctx context.Context, key string, secret []byte) error

type KeyVaultConfig

type KeyVaultConfig struct {
	cloudyazure.AzureCredentials
	VaultURL string `cloudyenv:"AZ_VAULT_URL"`
}

type KeyVaultEnvironment

type KeyVaultEnvironment struct {
	Vault  *KeyVault
	Prefix string
}

func NewKeyVaultEnvironmentService

func NewKeyVaultEnvironmentService(ctx context.Context, vaultURL string, credentials cloudyazure.AzureCredentials, prefix string) (*KeyVaultEnvironment, error)

func (*KeyVaultEnvironment) Get

func (kve *KeyVaultEnvironment) Get(name string) (string, error)

func (*KeyVaultEnvironment) SaveAll

func (kve *KeyVaultEnvironment) SaveAll(ctx context.Context, items map[string]string) error

type KeyVaultEnvironmentCachedFactory

type KeyVaultEnvironmentCachedFactory struct{}

func (*KeyVaultEnvironmentCachedFactory) Create

func (c *KeyVaultEnvironmentCachedFactory) Create(cfg interface{}) (cloudy.EnvironmentService, error)

func (*KeyVaultEnvironmentCachedFactory) FromEnv

func (c *KeyVaultEnvironmentCachedFactory) FromEnv(env *cloudy.Environment) (interface{}, error)

type KeyVaultEnvironmentConfig

type KeyVaultEnvironmentConfig struct {
	cloudyazure.AzureCredentials
	VaultURL string
	Prefix   string
}

type KeyVaultEnvironmentFactory

type KeyVaultEnvironmentFactory struct{}

func (*KeyVaultEnvironmentFactory) Create

func (c *KeyVaultEnvironmentFactory) Create(cfg interface{}) (cloudy.EnvironmentService, error)

func (*KeyVaultEnvironmentFactory) FromEnv

func (c *KeyVaultEnvironmentFactory) FromEnv(env *cloudy.Environment) (interface{}, error)

type KeyVaultFactory

type KeyVaultFactory struct{}

func (*KeyVaultFactory) Create

func (c *KeyVaultFactory) Create(cfg interface{}) (secrets.SecretProvider, error)

func (*KeyVaultFactory) FromEnv

func (c *KeyVaultFactory) FromEnv(env *cloudy.Environment) (interface{}, error)

func (*KeyVaultFactory) ListRequiredEnv

func (c *KeyVaultFactory) ListRequiredEnv(env *cloudy.Environment) []string

type KeyVaultKvConfig

type KeyVaultKvConfig struct {
	cloudyazure.AzureCredentials
	VaultURL string
	Prefix   string
}

type KeyVaultKvStore

type KeyVaultKvStore struct {
	Vault  *KeyVault
	Prefix string
}

func NewAzureKeyVault

func NewAzureKeyVault(ctx context.Context, cfg *KeyVaultKvConfig) (*KeyVaultKvStore, error)

func NewKeyVaultKvStoreService

func NewKeyVaultKvStoreService(ctx context.Context, vaultURL string, credentials cloudyazure.AzureCredentials, prefix string) (*KeyVaultKvStore, error)

func (*KeyVaultKvStore) Delete

func (kve *KeyVaultKvStore) Delete(key string) error

func (*KeyVaultKvStore) Get

func (kve *KeyVaultKvStore) Get(key string) (string, error)

func (*KeyVaultKvStore) GetAll

func (kve *KeyVaultKvStore) GetAll() (map[string]string, error)

func (*KeyVaultKvStore) GetSecure

func (kve *KeyVaultKvStore) GetSecure(key string) (strfmt.Password, error)

func (*KeyVaultKvStore) Set

func (kve *KeyVaultKvStore) Set(key string, value string) error

func (*KeyVaultKvStore) SetMany

func (kve *KeyVaultKvStore) SetMany(items map[string]string) error

func (*KeyVaultKvStore) SetSecure

func (kve *KeyVaultKvStore) SetSecure(key string, value strfmt.Password) error

Jump to

Keyboard shortcuts

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