allod secret: read the rotation registry as rotation-registry.json and lib.rotationRegistry #219
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!219
Loading…
Reference in a new issue
No description provided.
Delete branch "agent/rotation-registry-rename"
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 secretreads the credential rotation registry by its new names: the flake exportlib.rotationRegistryand the filerotation-registry.json. What changes for a running machine:create,rekey, androtateevaluate the new attribute from the secrets checkout,declarewrites the new file, and every message and theallod secretdoc name it. What stays identical: the registry's shape and validation, every decision the commands make after the registry is read, and the internal Go identifiers (tokenGroup,nixEvalTokenGroups,secretEvalRegistry), which the issue scopes out and which allod/tools PR 216 is open on. What proves it: gofmt, vet, all four tagged test runs, the flake'sgo-checks, and a dry run of the built binary against the secrets worktree that carries the rename. If it is wrong the symptom is a message naminglib.rotationRegistryorrotation-registry.jsonbefore anything is written, and the fix is a straight revert.Land this after allod/secrets PR 31 (allod/secrets#31). The file name is a flag day for
declare, which opens the file by name, and there is deliberately no fallback to the old attribute or file: a deployment's private fork of allod/secrets must merge the rename before this build ofallodruns against its checkout.Refs allod/secrets#22
Risk
R3. Rotation tooling that writes to the secrets repository reads a cross-repo interface by a new name. Residual: the ordering dependency above; every failure path is loud and precedes any write.
Validation
Run by the integrator on the reviewed commit, inside
nix develop:gofmt -l ./cmd ./internal: empty.go vet ./...: clean.go test ./...,go test -tags secret ./...,go test -tags site ./...,go test -tags site,secret ./...: every packageok, exit 0 each.nix build .#checks.x86_64-linux.go-checks --no-link -L: exit 0.grep -rn -i 'forgejo-token-groups\|forgejoTokenGroups' .outside.git: no hits.allod secret rotate <credential> <secrets worktree> --dry-runagainst the worktree of allod/secrets PR 31 (allod/secrets#31) got past registry evaluation and group lookup and stopped on a data check in the public template (a group with noservicekey), solib.rotationRegistryresolves; that data gap predates this change and is not touched here.Cold review:
gpt-5.6-terraviacodex exec, default effort, read-only sandbox, on commite3846a14. Two findings, both major, both the same point: no compatibility with a checkout that exports only the old name or carries only the old file. Discarded: the landing order recorded on allod/secrets#22 puts the secrets rename first, and a silent fallback to the old name is whatmemoryrules out (fail loud, never fall back silently). No missed consumers, no unsupported claims.Owner request: rename the internal Go identifiers too, not only the user-facing names. Done in
29c0875on this branch: the typetokenGroupis nowregistryGroupandnixEvalTokenGroupsisnixEvalRotationRegistry, across secret.go, secret_rotate.go, secret_value.go, and their tests. A pre-existing minimal decoder in secret_declare.go was already calledregistryGroupand collided under thesecretbuild tag; it is nowdeclareRegistryGroup, matching that file's otherdeclare*types. No behavior changes.The branch also carries a merge of master (
bb4b47c) after allod/tools PR 216 landed; there were no conflicts.Validation on
29c0875, run by the integrator insidenix develop: gofmt clean,go vet ./...clean,go test ./...with no tag,-tags secret,-tags site, and-tags site,secretall green, and no identifier containing "tokengroup" remains under cmd or internal. The rename is mechanical and witnessed by the compiler and the tests, so no second review pass was run for it.