certs

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultRefreshInterval = 7 * 24 * time.Hour

Default refresh cadence. Cloudbox's CertLifetime is 30 days; we refresh weekly so an offline stretch can't expire the cert.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	CloudboxBase string
	AccessToken  string
	Principal    string // assigned_hostname / agent_name
	HostKey      ssh.Signer

	// Refresh interval. Zero = DefaultRefreshInterval.
	RefreshInterval time.Duration

	// OnRefresh is called when a fresh cert lands. Typically wired
	// to write the new cert + ca pubkey into FileConfig.Cluster
	// and SaveFile.
	OnRefresh func(cert, caPubkey string) error

	// HTTPClient is optional; default 30s timeout.
	HTTPClient *http.Client
}

Config is what NewManager takes.

type Manager

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

Manager is the long-running cert refresh worker.

func NewManager

func NewManager(cfg Config) (*Manager, error)

func (*Manager) Run

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

Run drives the boot fetch + periodic refresh. Blocks until ctx.Done(). Failures during the boot fetch are logged but the loop continues — we DON'T want a transient cloudbox blip to disable peer trust forever.

Jump to

Keyboard shortcuts

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