Versions in this module Expand all Collapse all v0 v0.2.0 Oct 3, 2026 v0.1.0 Oct 1, 2026 Changes in this version + var ErrAgentKeyNotFound = errors.New("no stored key for agent") + var ErrAgentKeySignatureMismatch = errors.New("agent signature mismatch") + var ErrAgentKeyStoreUnavailable = errors.New("agent key store unavailable") + var ErrNoPendingAgent = errors.New("no pending agent") + type AcceptedAgent struct + AcceptedAt time.Time + Fingerprint string + Hostname string + MachineID string + PublicKey ed25519.PublicKey + SupersededKey ed25519.PublicKey + SupersededUntil time.Time + type AgentKeyStore interface + LookupAgentKey func(ctx context.Context, machineID string) (*AcceptedAgent, error) + type KVStore = jetstream.KeyValue + type KeyRotationMessage struct + NewPublicKey []byte + type NATSSubscriber interface + PublishCore func(subj string, data []byte) error + Subscribe func(subj string, cb nats.MsgHandler) (*nats.Subscription, error) + type PKIProvider interface + PublicKey func() ed25519.PublicKey + type PendingAgent struct + Fingerprint string + Hostname string + MachineID string + PublicKey []byte + RequestedAt time.Time + type Watcher struct + func NewWatcher(logger *slog.Logger, nc NATSSubscriber, enrollmentKV KVStore, ...) *Watcher + func (w *Watcher) AcceptAgent(ctx context.Context, machineID string) error + func (w *Watcher) AcceptByFingerprint(ctx context.Context, fingerprint string) error + func (w *Watcher) AcceptByHostname(ctx context.Context, hostname string) error + func (w *Watcher) KeyStore() client.AgentKeyStore + func (w *Watcher) ListPending(ctx context.Context) ([]PendingAgent, error) + func (w *Watcher) LookupAgentKey(ctx context.Context, machineID string) (*AcceptedAgent, error) + func (w *Watcher) RejectAgent(ctx context.Context, machineID string, reason string) error + func (w *Watcher) RejectByHostname(ctx context.Context, hostname string, reason string) error + func (w *Watcher) RemoveAgentKey(ctx context.Context, machineID string) error + func (w *Watcher) RotateControllerKey() error + func (w *Watcher) SetRotationGracePeriod(d time.Duration) + func (w *Watcher) Start(ctx context.Context) error