feat(secrets,cli): S5 (part) — secrets keygen age keypair - #39
Merged
Conversation
… (spec 04)
The offline onboarding companion to the SOPS+age provider (S2): generate the
local age identity SOPS_AGE_KEY_FILE points at, no account, fully in-process
(filippo.io/age — pure Go, static-binary safe).
- secrets.GenerateAgeKey() → {Identity AGE-SECRET-KEY-…, Recipient age1…} +
AgeKeyFileContents() (the `# public key:` + secret body `age-keygen` writes).
- CLI `secrets keygen [-o FILE]`: with -o writes the key 0600 (+ a
SOPS_AGE_KEY_FILE export hint); without, prints the key to stdout and the
public recipient to stderr (so a pipe captures only the key). --json supported.
Replaces the keygen stub; `secrets login` (keyring) stays stubbed for the rest
of S5.
Unit tests: generated identity round-trips through age.ParseX25519Identity and
yields the reported recipient; two calls differ; key-file body shape; CLI writes
a 0600 file with the recipient comment + SOPS hint.
Note: local govulncheck flags go1.26.0 stdlib advisories (fixed in go1.26.3+)
unrelated to this change; CI runs Go 1.25.x-latest where they don't apply.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Chunk S5 (part) —
secrets keygenThe offline onboarding companion to the SOPS+age provider (S2): generate the local age identity
SOPS_AGE_KEY_FILEpoints at — no account, fully in-process (filippo.io/age, pure-Go, static-binary safe).secrets.GenerateAgeKey()→{Identity, Recipient}+AgeKeyFileContents().secrets keygen [-o FILE]: with-owrites the key 0600 (+ aSOPS_AGE_KEY_FILEhint); without, prints the key to stdout and the recipient to stderr (pipe-safe).--jsonsupported. Replaces the keygen stub;secrets login(keyring) stays stubbed for the rest of S5.Tests
Generated identity round-trips through
age.ParseX25519Identity→ same recipient; two calls differ; key-file shape; CLI writes a 0600 file with the recipient comment + SOPS hint.Gate
make cigreen (race).🤖 Generated with Claude Code