Null agentTokenFile with forgeTokenFile under the Forge opt-out #11
No reviewers
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
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/secrets!11
Loading…
Reference in a new issue
No description provided.
Delete branch "agent/agent-token-opt-out"
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 completes the Forge opt-out for dev machines:
forgeAccess = falsenow nulls the shared agent PR token file as well as the per-machine Forge HTTPS token, so a machine that pushes no code is never assigned an encrypted file it has no key to open. One flag now means one thing. No machine in this template opts out, so nothing changes for the current fleet — the produced identities are proven value-identical. This is the data half of the fix and must merge after the framework half, allod/archetypes#18, which makes the builder tolerate the null and enforce that the two files stay paired.Closes allod/archetypes#17
What changed
devIdentitiesbinds the flag once (forgeAccess = vm.forgeAccess or true) and derives bothforgeTokenFileandagentTokenFilefrom it, so the two files cannot drift apart within the template. The comment now explains why the agent token follows the flag: the shared ciphertext's recipients are the hypervisor plus the machines that push, so a non-pushing machine cannot decrypt it and must not be handed it. Deployments that fork this template pick the change up when they port the opt-out.Landing order
This PR merges second, after allod/archetypes#18. Under the previous builder a null
agentTokenFilehits the token module'sfile = nullas a bare type error for any opted-out machine; the archetypes PR makes the module conditional and adds the eval-head assert that keeps the two files paired. Merged in that order there is no broken intermediate state for any consumer. The enforcement deliberately lives on the archetypes side, in the builder — the last point that sees a machine's final credential values and the one piece of framework code every fork shares — which is also what holds this mapping honest: composing the old unconditional mapping with an opted-out machine trips that assert with a named error, as demonstrated below.Risk
R1 residual. The opt-out branch is dead data until a deployment declares
forgeAccess = false— the current fleet's identities are value-identical before and after — and rollback is a straight revert. The one live concern is a fork porting this half without the archetypes half; the wrong order fails at evaluation either way (the old builder's type error, or the new builder's named assert), never silently.Validation
nix flake checkpasses in this repo.lib.devIdentitieson this branch is value-identical to master for every identity the template produces, compared as JSON with store-path prefixes normalized: allod-dev keeps both credential files.forgeAccess = false, composed with the archetypes branch, evaluates that machine cleanly withconfig.age.secrets = {}. The same flip under master's mapping — the half-done state the issue describes, agent token still set while the HTTPS token is null — fails the archetypes branch's pairing assert withdev machine 'allod-dev': agent token file and Forge HTTPS credential must be both set or both null (identity forgeAccess opts out of both together); got tokenFile set, httpsTokenFile null.allod/deploy, evaluated one configuration at a time with--override-inputpinned to explicit revisions (base = both masters, since deploy's committed lock trails master): nexus, privacy-1, and the installer keep byte-identicaltoplevel.drvPathwith both branches substituted. allod-dev's drvPath shifts — a finding, and a benign one: dev machines embed the whole secrets source store path through theirage.secrets.*.filereferences, so any commit to this repo shifts their derivation. Attribution was isolated three ways: archetypes branch alone leaves allod-dev's drvPath identical to base; archetypes master with this branch produces the same shifted drvPath as both branches together; and a comment-only control commit to this repo shifts it again. The machine's generatedage.secretsunder both branches is identical to the pre-change baseline once the source store prefix is normalized — same file names, paths, owners, groups, and modes.