feat: add lifecycle.use-latest so certificate-id follows server-side renewals - #374
feat: add lifecycle.use-latest so certificate-id follows server-side renewals#374carlosmonastyrski wants to merge 1 commit into
Conversation
server-side renewals
|
💬 Discussion in Slack: #pr-review-cli-374-feat-add-lifecycle-use-latest-so-certificate-id-follows-server Posted by Review Police — reviews, comments, new commits, and CI failures will stream into this channel. |
|
| Filename | Overview |
|---|---|
| packages/cmd/agent.go | Implements latest-renewal resolution, certificate synchronization, disk-state comparison, hook selection, status handling, retry scheduling, and key-pair replacement safeguards; no actionable changed-code defect was established. |
| packages/api/model.go | Adds the server response fields needed to identify the immediate and latest renewal certificates with JSON names aligned to their callers. |
| packages/cmd/agent_cert_latest_renewal_test.go | Adds focused coverage for renewal resolution, fallback behavior, configuration validation, and keyless replacement safeguards. |
| e2e/agent/certificate_test.go | Adds end-to-end scenarios for pinned and latest distribution, restarts, hooks, and revoked-certificate handling. |
| e2e/agent/agent_helpers.go | Extends certificate-agent fixtures to configure certificate-ID distribution and directly issue, renew, revoke, and inspect test certificates. |
| certificate-agent-config.yaml | Documents shared certificate distribution and the new use-latest lifecycle option. |
Reviews (1): Last reviewed commit: "feat(agent): add lifecycle.use-latest so..." | Re-trigger Greptile
Description 📣
Extends the certificate agent's existing
certificate-iddistribution mode withlifecycle.use-latest, so a fleet of hosts sharing one centrally managed certificate automatically picks up renewals made in Infisical without a config change or a restart. The agent resolves the current certificate from the server in one call regardless of how far the chain has moved on, rewrites files and runson-renewalonly when the certificate it resolves to actually changes (including across a restart, where it compares against what is on disk rather than in memory), reports revoked and expired certificates throughon-failurewhile continuing to serve the last good certificate, and refuses to overwrite a certificate when it cannot also replace the matching private key.renew-before-expirywarns and is ignored in this mode.Type ✨
Tests 🛠️
# Here's some code block to paste some code snippets