pki

package
v0.1.18-rc2 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultRotator

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

DefaultRotator performs simple on-disk certificate rotation for the server/node certificate described by config.PKIConfig. It renews when the current certificate is within the RenewBefore window. If the cluster CA material is available via PLOY_SERVER_CA_CERT and PLOY_SERVER_CA_KEY, it reissues a certificate with the same subject and SANs using the existing private key. Otherwise, it logs a structured warning so operators can rotate out-of-band.

func NewDefaultRotator

func NewDefaultRotator(logger *slog.Logger) *DefaultRotator

NewDefaultRotator creates a new DefaultRotator instance.

func (*DefaultRotator) Renew

func (r *DefaultRotator) Renew(ctx context.Context, cfg config.PKIConfig) error

Renew checks the active certificate and, if needed, reissues it using the cluster CA from environment variables. It preserves subject, SANs, and reuses the existing private key.

type Manager

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

Manager supervises certificate renewal.

func New

func New(opts Options) (*Manager, error)

New constructs the PKI manager instance.

func (*Manager) Config

func (m *Manager) Config() config.PKIConfig

Config returns the active configuration snapshot.

func (*Manager) Start

func (m *Manager) Start(ctx context.Context) error

Start begins renewal monitoring.

func (*Manager) Stop

func (m *Manager) Stop(ctx context.Context) error

Stop terminates monitoring.

type Options

type Options struct {
	Config  config.PKIConfig
	Rotator Rotator
}

Options configure the PKI manager.

type Rotator

type Rotator interface {
	Renew(ctx context.Context, cfg config.PKIConfig) error
}

Rotator renews node certificates.

Jump to

Keyboard shortcuts

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