allod secret: land an encrypted credential from the host #195
No reviewers
Labels
No labels
blocked
bug
decision
duplicate
enhancement
help wanted
invalid
landed?
question
ready-to-merge
stale
wontfix
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
allod/tools!195
Loading…
Reference in a new issue
No description provided.
Delete branch "agent/secret-namespace"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This adds
allod secret create <name>andallod secret rekey <name>, the host-side command that lands an encrypted credential in the secrets repository, compiled in only where the build sets the newsecrettag. On every machine built today nothing changes: no build sets the tag yet, soallod secretstays an unknown word, and the only shared code that moved is the hidden-prompt terminal helper, now in an untagged file with identical behavior. What proves it: the flake check passes with all four tag combinations, the tagged binary was smoke-tested against a real secrets checkout with realnix evaland a realagecall, and the untagged test asserts the namespace is absent. If it is wrong, revert this commit; the nexus change that sets the tag is a separate PR and has not landed.Refs allod/tools#182. Design decisions are recorded on the issue. The
pendinginventory state this depends on is allod/secrets#19; the tag is set by the nexus PR that closes the issue.What create does
On a non-default branch with a clean tree, it requires the
credentials.nixentry for<name>to bependingwith exactly one agenix consumer here, thesecrets.nixline for that path to list recipients including this host's identity, a rotation registry entry naming both, and no ciphertext yet. It reads the value from stdin verbatim or one hidden terminal line, refuses an empty one, pipes it intoage -ewith the recipients evaluated out ofsecrets.nix, writes the ciphertext whole, flips the entry toactivein place, re-evaluates to confirm, runsnix flake check, restores both files if that fails, and otherwise commits the two files and pushes the branch.rekeydecrypts with the host identity and re-encrypts to the current recipients, always rewriting. Nothing unencrypted is ever written to a filesystem.Risk
R3. The command mutates the authoritative secrets repository and pushes, and handles the age identity. It is bounded to a non-default branch with a clean tree, every file effect is computed in memory before the first write, a failed check restores the tree, and merging remains a human act at the forge. The worst credible failure after validation is a ciphertext encrypted to the recipients
secrets.nixdeclared on a branch that was wrong about them, which the reviewed diff and the inventory check see before the command does.Validation
nix flake checkon this branch: all checks passed, run asgit+file://<worktree>. Run aspath:<worktree>the parity suite fails on a test I did not touch, becausepath:copies a linked worktree's.gitpointer file into the source and the one parity test that runs git without-Cthen sees a dangling repository; master'spath:run passes because its.gitis a directory nix drops. That is a testing gotcha, not a defect in this change, and will go into memory.-tags secretand-tags site,secretcover the landing, the terminal input path, fourteen create refusals, restoration on a failed check, a failed push, rekey and its refusals, checkout resolution, and the text flip. The untagged and-tags siteruns assert the namespace absent.nix eval: an active credential is refused as not pending, a.pubthat is not a recipient is refused, the default branch and a dirty tree are refused, an unknown name is refused, andrekeyreaches a realage -dcall, which fails on the fixture identity as expected. A full landing was not run: this VM holds no age identity and no pending entry exists yet.age -e | age -dround trip through a generated key confirmed the flags the helpers use.