provisioners

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

Package provisioners provides a mapping between CertificateRequest and the Cloudflare API, with credentials already bounded by an OriginIssuer.

Index

Constants

View Source
const (
	// The default validity duration, if not provided.
	DefaultDurationInternval = 7
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Collection

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

Collection stores cached Provisioners, stored by namespaced names of the issuer.

func CollectionWith

func CollectionWith(items []CollectionItem) *Collection

CollectionWith returns a Collection storing the provided provisioners.

func (*Collection) Load

func (c *Collection) Load(namespacedName types.NamespacedName) (*Provisioner, bool)

Load returns the stored provisioner, or returns false if nothing is cached with the proved namespaced name.

func (*Collection) Store

func (c *Collection) Store(namespacedName types.NamespacedName, provisioner *Provisioner)

Store adds a provisioner to the collection.

type CollectionItem

type CollectionItem struct {
	NamespacedName types.NamespacedName
	Provisioner    *Provisioner
}

A CollectionItem allows for the namespaced name and provisioner to be stored together.

type Provisioner

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

Provisioner allows for CertificateRequests to be signed using the stored Cloudflare API client.

func New

func New(client Signer, reqType v1.RequestType, log logr.Logger) (*Provisioner, error)

New returns a new provisioner.

func (*Provisioner) Sign

func (p *Provisioner) Sign(ctx context.Context, cr *certmanager.CertificateRequest) (certPem []byte, err error)

Sign uses the Cloduflare API to sign a CertificateRequest. The validity of the CertificateRequest is normalized to the closests validity allowed by the Cloudflare API, which make be significantly different than the validity provided.

type Signer added in v0.7.0

type Signer interface {
	Sign(ctx context.Context, req *cfapi.SignRequest) (*cfapi.SignResponse, error)
}

Signer implements the Origin CA signing API.

Jump to

Keyboard shortcuts

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