azkv

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package azkv provides an Azure Key Vault secrets provider for configurer.

The provider authenticates with Azure's default credential chain. A vault URL can be supplied with the AZURE_KEY_VAULT_URL environment variable or through the CLI. When no secret names are configured, the provider lists the vault and loads every secret.

JSON-object secret values are exported as individual environment variables. Plain values use the Azure secret name as their environment key, with dashes converted to underscores. Writing performs the reverse conversion because Azure Key Vault secret names support dashes but not underscores.

Index

Constants

View Source
const Name = "azkv"

Name of the provider.

Variables

This section is empty.

Functions

func New

func New(
	override, rawValue bool,
	config *Config,
) (provider.IProvider, error)

New creates an Azure Key Vault provider using Azure's default credential chain.

The AZURE_KEY_VAULT_URL environment variable can be used by CLI callers to configure the vault URL. When SecretNames is empty, Load lists and retrieves every secret in the vault.

func NewWithConfig

func NewWithConfig(
	override, rawValue bool,
	config *Config,
	credential azcore.TokenCredential,
	clientOptions *azsecrets.ClientOptions,
) (provider.IProvider, error)

NewWithConfig creates an Azure Key Vault provider with a supplied credential and Azure client options.

Types

type AZKV

type AZKV struct {
	*provider.Provider `json:"-" validate:"required"`

	*Config `json:"-" validate:"required"`
	// contains filtered or unexported fields
}

AZKV provider definition.

func (*AZKV) Load

func (a *AZKV) Load(ctx context.Context, opts ...option.LoadKeyFunc) (map[string]string, error)

Load retrieves secrets from Azure Key Vault and exports them to the environment.

func (*AZKV) Write

func (a *AZKV) Write(ctx context.Context, values map[string]interface{}, opts ...option.WriteFunc) error

Write stores each value as an Azure Key Vault secret.

type Config

type Config struct {
	VaultURL    string   `json:"vault_url"    validate:"required,url"`
	SecretNames []string `json:"secret_names" validate:"omitempty,dive,required"`
}

Config contains Azure Key Vault configuration.

Jump to

Keyboard shortcuts

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