pki

package
v0.1.18-rc15 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 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 Options

type Options struct {
	Config  config.PKIConfig
	Rotator Rotator
	Logger  *slog.Logger
}

Options configure the PKI renewal task.

type RenewalTask

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

RenewalTask checks the active certificate at the configured renewal interval.

func New

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

New constructs a PKI renewal task.

func (*RenewalTask) Interval

func (t *RenewalTask) Interval() time.Duration

func (*RenewalTask) Name

func (t *RenewalTask) Name() string

func (*RenewalTask) Run

func (t *RenewalTask) Run(ctx context.Context) error

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