keyvault

package
v1.15.22 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CertRefresher

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

CertRefresher offers a mechanism to present the latest version of a tls.Certificate from KeyVault, refreshed at an interval.

func NewCertRefresher

func NewCertRefresher(ctx context.Context, kvc tlsCertFetcher, l logger, certName string) (*CertRefresher, error)

NewCertRefresher returns a CertRefresher. When there's no error, the CertRefresher's GetCertificate method is ready for use, returning a valid tls.Certificate fetched from KeyVault during construction.

func (*CertRefresher) GetCertificate

func (c *CertRefresher) GetCertificate() *tls.Certificate

GetCertificate returns the latest certificate fetched from KeyVault.

func (*CertRefresher) Refresh

func (c *CertRefresher) Refresh(ctx context.Context, interval time.Duration) error

Refresh starts refreshing the certificate at the interval provided. It blocks until context is done or refreshing fails.

func (*CertRefresher) String

func (c *CertRefresher) String() string

type EventualExpirationErr

type EventualExpirationErr struct {
	time.Time
}

func (*EventualExpirationErr) Error

func (e *EventualExpirationErr) Error() string

type Shim

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

Shim provides convenience methods for working with KeyVault.

func NewShim

func NewShim(vaultURL string, cred azcore.TokenCredential) (*Shim, error)

NewShim constructs a Shim for a KeyVault instance located at the provided url. The azcore.TokenCredential will only be used during method calls, it is not verified at initialization.

func (*Shim) GetLatestTLSCertificate

func (s *Shim) GetLatestTLSCertificate(ctx context.Context, certName string) (tls.Certificate, error)

GetLatestTLSCertificate fetches the latest version of a keyvault certificate and transforms it into a usable tls.Certificate.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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