Back to godoc.org

Package accounts

v0.16.1
Latest Go to latest

The highest tagged major version is .

Published: Aug 7, 2020 | License: Apache-2.0 | Module: github.com/jetstack/cert-manager

Index

Variables

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

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

func BuildHTTPClient

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

BuildHTTPClient returns a instramented HTTP client to be used by the ACME client. For the time being, we construct a new HTTP client on each invocation. This is because we need to set the 'skipTLSVerify' flag on the HTTP client itself. In future, we may change to having two global HTTP clients - one that ignores TLS connection errors, and the other that does not.

func NewClient

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

NewClient will return a new ACME client.

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 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(client *http.Client, uid string, config cmacme.ACMEIssuer, privateKey *rsa.PrivateKey)

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

	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.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier