rest

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CertificateFromConfig

func CertificateFromConfig(cfg *rest.Config) (*tls.Certificate, error)

func ConfigWithCertificate

func ConfigWithCertificate(cfg *rest.Config, cert *tls.Certificate) (*rest.Config, error)

func DynamicCertificateConfig

func DynamicCertificateConfig(
	cfg *rest.Config,
	getCertificate func() *tls.Certificate,
	dialFunc utilnet.DialFunc,
) (*rest.Config, func(), error)

func IsConfigValid

func IsConfigValid(cfg *rest.Config) bool

func RequestConfig

func RequestConfig(
	ctx context.Context,
	certCfg *rest.Config,
	signerName string,
	template *x509.CertificateRequest,
	getUsages func(privateKey any) []certificatesv1.KeyUsage,
	requestedDuration *time.Duration,
) (*rest.Config, error)

func UseOrRequestConfig

func UseOrRequestConfig(
	ctx context.Context,
	cfg *rest.Config,
	certCfg *rest.Config,
	signerName string,
	template *x509.CertificateRequest,
	getUsages func(privateKey any) []certificatesv1.KeyUsage,
	requestedDuration *time.Duration,
) (resCfg *rest.Config, newConfig bool, err error)

Types

type ConfigRotator

type ConfigRotator interface {
	manager.Runnable
	healthz.HealthChecker
	Init(ctx context.Context, force bool) error
	ClientConfig() *rest.Config
	TransportConfig() *rest.Config
	AddListener(listener ConfigRotatorListener) ConfigRotatorListenerRegistration
	RemoveListener(reg ConfigRotatorListenerRegistration)
}

func NewConfigRotator

func NewConfigRotator(cfg, bootstrapCfg *rest.Config, opts ConfigRotatorOptions) (ConfigRotator, error)

type ConfigRotatorListener

type ConfigRotatorListener interface {
	Enqueue()
}

type ConfigRotatorListenerFunc

type ConfigRotatorListenerFunc func()

func (ConfigRotatorListenerFunc) Enqueue

func (f ConfigRotatorListenerFunc) Enqueue()

type ConfigRotatorListenerRegistration

type ConfigRotatorListenerRegistration interface{}

type ConfigRotatorOptions

type ConfigRotatorOptions struct {
	Name                  string
	SignerName            string
	Template              *x509.CertificateRequest
	GetUsages             func(privateKey any) []certificatesv1.KeyUsage
	RequestedDuration     *time.Duration
	LogConstructor        func() logr.Logger
	DialFunc              utilnet.DialFunc
	NewCertificateRotator func(opts certificate.RotatorOptions) (certificate.Rotator, error)
	ForceInitial          bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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