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 ¶
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 ¶
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.