accounts

package
v1.16.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("ACME client for issuer not initialised/available")

ErrNotFound is returned by GetClient if there is no ACME client registered.

Functions

func BuildHTTPClient

func BuildHTTPClient(metrics *metrics.Metrics, skipTLSVerify bool) *http.Client

BuildHTTPClient returns a instrumented HTTP client to be used by an ACME client. For the time being, we construct a new HTTP client on each invocation, because we need to set the 'skipTLSVerify' flag on the HTTP client itself distinct from the ACME client

func BuildHTTPClientWithCABundle added in v1.11.0

func BuildHTTPClientWithCABundle(metrics *metrics.Metrics, skipTLSVerify bool, caBundle []byte) *http.Client

BuildHTTPClientWithCABundle returns a instrumented HTTP client to be used by an ACME client, with an optional custom CA bundle set. For the time being, we construct a new HTTP client on each invocation, because we need to set the 'skipTLSVerify' flag and the CA bundle on the HTTP client itself, distinct from the ACME client

func NewClient

func NewClient(client *http.Client, config cmacme.ACMEIssuer, privateKey *rsa.PrivateKey, userAgent string) acmecl.Interface

NewClient is an implementation of NewClientFunc that returns a real ACME client.

Types

type Getter

type Getter interface {
	// GetClient will fetch a registered client using the UID of the Issuer
	// resources that constructed it.
	// If no client is found, ErrNotFound will be returned.
	GetClient(uid string) (acmecl.Interface, error)

	// ListClients will return a full list of all ACME clients by their UIDs.
	// This can be used to enumerate all registered clients and call RemoveClient
	// on any clients that should no longer be registered, e.g. because their
	// corresponding Issuer resource has been deleted.
	ListClients() map[string]acmecl.Interface
}

Getter is an interface that contains the read-only methods for a registry.

type NewClientFunc

type NewClientFunc func(*http.Client, cmacme.ACMEIssuer, *rsa.PrivateKey, string) acmecl.Interface

NewClientFunc is a function type for building a new ACME client.

type Registry

type Registry interface {
	// AddClient will ensure the registry has a stored ACME client for the Issuer
	// object with the given UID, configuration and private key.
	AddClient(httpClient *http.Client, uid string, config cmacme.ACMEIssuer, privateKey *rsa.PrivateKey, userAgent string)

	// RemoveClient will remove a registered client using the UID of the Issuer
	// resource that constructed it.
	RemoveClient(uid string)

	// IsKeyCheckSumCached checks if the private key checksum is cached with registered client.
	// If not cached, the account is re-verified for the private key.
	IsKeyCheckSumCached(lastPrivateKeyHash string, privateKey *rsa.PrivateKey) bool

	Getter
}

A registry provides a means to store and access ACME clients using an issuer objects UID. This is used as a shared cache of ACME clients across various controllers.

func NewDefaultRegistry

func NewDefaultRegistry() Registry

NewDefaultRegistry returns a new default instantiation of a client registry.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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