azurekv

package
v0.96.23 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrValidation = errors.New("credentials validation error")

Functions

func ValidateReaderClient

func ValidateReaderClient(m *Manager, pathPrefix string) error

func ValidateWriterClient

func ValidateWriterClient(m *Manager, pathPrefix string) error

ValidateWriterClient checks if the client is valid by writing and deleting a secret in the provided mount path.

Types

type Manager

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

func NewManager

func NewManager(opts *NewManagerOpts) (*Manager, error)

func (*Manager) DeleteCredentials

func (m *Manager) DeleteCredentials(ctx context.Context, secretName string) error

DeleteCredentials deletes credentials and versions

func (*Manager) ReadCredentials

func (m *Manager) ReadCredentials(ctx context.Context, secretName string, creds any) error

ReadCredentials reads the latest version of the credentials

func (*Manager) SaveCredentials

func (m *Manager) SaveCredentials(ctx context.Context, orgID string, creds any) (string, error)

SaveCredentials saves credentials

type NewManagerOpts

type NewManagerOpts struct {
	// Active Directory Tenant ID
	TenantID string
	// Registered application / service principal client ID
	ClientID string
	// Registered application / service principal client secret
	ClientSecret string
	// Vault URL
	VaultURI string
	// Optional secret prefix
	SecretPrefix string
	Logger       log.Logger
	Role         credentials.Role
}

func (*NewManagerOpts) Validate

func (o *NewManagerOpts) Validate() error

type SecretsRW

type SecretsRW interface {
	SetSecret(ctx context.Context, secretName string, params azsecrets.SetSecretParameters, options *azsecrets.SetSecretOptions) (azsecrets.SetSecretResponse, error)
	GetSecret(ctx context.Context, secretName string, version string, options *azsecrets.GetSecretOptions) (azsecrets.GetSecretResponse, error)
	DeleteSecret(ctx context.Context, secretName string, options *azsecrets.DeleteSecretOptions) (azsecrets.DeleteSecretResponse, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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