secret

package
v0.0.0-...-a1c22f6 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidSecretURI indicates the secretURI does not match keyvault secret pattern
	ErrInvalidSecretURI = errors.New("invalid secret URI")
	// ErrInvalidCertificateURI indicates the certificateURI does not match keyvault certificate pattern
	ErrInvalidCertificateURI = errors.New("invalid certificate URI")
	// ErrEmptyResource  indicates resourceID is empty
	ErrEmptyResource = errors.New("resource should not be empty")
	// ErrEmptyValue indicates the value to set is empty
	ErrEmptyValue = errors.New("value to set should not be empty")
)

Functions

This section is empty.

Types

type KeyvaultSecretProvider

type KeyvaultSecretProvider interface {
	Get(logger *log.Logger, secretURI string) (keyvault.SecretBundle, error)
	// Set set the value into the keyvault
	Set(logger *log.Logger, secretURI string, secretSetParameter keyvault.SecretSetParameters) (keyvault.SecretBundle, error)
}

KeyvaultSecretProvider is an interface to retrieve a Keyvault secret

func NewClientSecretKeyvaultSecretProvider

func NewClientSecretKeyvaultSecretProvider(
	aadEndpoint, tenantID, clientID string,
	clientSecret datastructs.RedactedString,
	resource string) (KeyvaultSecretProvider, error)

NewClientSecretKeyvaultSecretProvider returns an instance of keyvaultSecretProvider using client secret auth

func NewKeyvaultSecretProviderFromTokenProvider

func NewKeyvaultSecretProviderFromTokenProvider(resource string, provider tokenprovider.TokenProvider) (KeyvaultSecretProvider, error)

NewKeyvaultSecretProviderFromTokenProvider returns an instance of keyvaultSecretProvider using a token provider

func NewMsiKeyvaultSecretProvider

func NewMsiKeyvaultSecretProvider(resource string) (KeyvaultSecretProvider, error)

NewMsiKeyvaultSecretProvider returns an instance of keyvaultSecretProvider using MSI auth

Directories

Path Synopsis
Package mock_secret is a generated GoMock package.
Package mock_secret is a generated GoMock package.

Jump to

Keyboard shortcuts

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