secret declare: write two files, no secrets.nix line #278
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
allod/tools#278
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
allod secret declarewrites two files instead of three: thecredentials.nixentry and therotation-registry.jsongroup, and nosecrets.nixline, becausesecrets.nixnow derives a declared credential's recipients from the registry (allod/secrets#46, landed as allod/secrets#47, and adopted by the deployment fork per the owner's report). A fork's own name for its hypervisor keys never reaches the tool again, anddeclareworks on the template, which has no hand-written recipient line for it to insert after.Primary goals:
declarebuilds, validates and writescredentials.nixandrotation-registry.json; it readssecrets.nixfor nothing, and the collision check, the balanced-brace check and the same-bytes re-read for that file go with the insertion. The printed list of written paths names two files.createis the consumer that proves it —createreads recipients by evaluatingsecrets.nixfor the credential's path; a fixture whosesecrets.niximports a registry-derived map, with adeclarefollowed bycreateagainst it, lands the ciphertext to the derived recipients. The existing fixture that hand-writes[ hostKey ] ++ vmKeys "dev-a"is replaced by that shape.declarehelp text,docs/allod-secret.mdand the public memoryage.mdparagraph that lists three insertions all say two; the memory edit is a separate PR onallod/memorythat lands with this one.secrets.nixthat derives; acreateon a fork that had not adopted would refuse withsecrets.nix in <checkout> does not declare '<path>', never write to wrong recipients.Current state and specifics
cmd/allod/secret_declare.goreads three files, runsdeclareCollisionsover all three (declareSecretsHasLinefor thesecrets.nixhalf), inserts withdeclareInsertSecretsLine, which requires an existing line to insert after and writes[ hostKey ] ++ vmKeys "<vm>"(allod/tools#271, closed in favour of the derivation), checksdeclareNixBalancedon the result, and writes the three files with a same-bytes guard each. The template'ssecrets.nixhas had no such line since its entries became derived, sodeclarefails there today withsecrets.nix: no existing publicKeys line to insert after.Scope
In:
cmd/allod/secret_declare.goand its tests, the help text,docs/allod-secret.md; theage.mdparagraph inallod/memoryas a companion PR. Out:create,rekeyandrotate, which evaluatesecrets.nixand are unchanged; the derivation itself, which is allod/secrets#47.Part of allod/secrets#46