refresh-local-auth: accept only a template as the local auth refresh source #57
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/nexus!57
Loading…
Reference in a new issue
No description provided.
Delete branch "agent/refresh-local-auth-template-only"
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?
refresh-local-authwas the last consumer that still accepted the retiredformat = "credential-store-url"credential shape as a source for the local auth refresh. It now accepts only avalue.template, the same shape allod/archetypes andallod secretalready require. Nothing changes for a running machine: no registry anywhere holds aformatentry, so the branch this deletes was unreachable, and the netrc bundle, its destinations, modes and ownership are untouched. What proves it is the script's own test suite, 17 tests green, including a new case that refuses a credential carryingformat, plusnix flake check. If this is wrong the symptom is a refresh refusing a group it used to install, withsource credential '<name>' is not a credential-store URL source; the fix is a straight revert of this commit.Closes allod/nexus#56
What changed
scripts/refresh-local-auth:is_credential_store_url_sourcenow has one branch. A credential is a source only when it carries noformatkey and itsvalue.templaterenders exactly one credential-store URL line. The refusal message is unchanged.scripts/refresh-local-auth: the comment abovevalidate_refresh_metadataclaimed the predicate mirrored the allod/archetypes and allod/tools predicates "character for character". That was false and is now accurate per consumer, with the one real divergence named. The "wholly legacy or wholly new" paragraph is retired.tests/refresh-local-auth.sh: thelegacy.gitfixture group, its secret,legacy_source_installs_bundle_and_is_idempotent, and the cross-shape comparison innew_shape_source_installs_the_same_bundleare gone. One test,new_shape_source_installs_bundle_and_is_idempotent, now carries the idempotence, bundle-contents, mode, metadata and no-secret-in-output assertions onnew.git. The unusedbundle_digestshelper goes with them.tests/refresh-local-auth.sh:sabotage.both-shapesis renamedsabotage.format, since there are no longer two shapes for it to straddle. A newsabotage.carriage-returncase is added beside it, explained under Review below.Review
One cold cross-family reviewer, gpt-5.5 via codex, read the diff and the two reference predicates. It returned one finding, which was real and is fixed here.
The finding: the replacement comment still claimed parity with allod/tools, and the two predicates genuinely disagree.
isCredentialStoreURLSourcein allod/tools picks nonblank lines with Go'sstrings.TrimSpace, which strips a carriage return, a vertical tab and the Unicode spaces; allod/nexus and allod/archetypes use a space-and-tab-only test, deliberately, because the deployed file's parser isawk 'NF { print }'and gawk's default field splitting separates on space, tab and newline alone. Measured on the three predicates:allod/nexus is the strict and correct side: a template allod/tools accepts there would deploy a two-line credential file that activation refuses. Nothing can reach a deployment through the gap, because the archetypes
credential-profilescheck refuses such a template as a refresh source before a registry lands. The in-scope fix was to make the comment say what is true, which it now does; allod/tools#214 tracks closing the gap in allod/tools, and this PR does not touch it.The finding also exposed that the claim was untested here, so
sabotage.carriage-returnnow pins it: a template whose second line holds only a carriage return must be refused.The reviewer cleared the rest explicitly: no jq evaluation error on any non-object
value,formatalongside a valid template correctly refused, and the deleted legacy coverage genuinely preserved on the surviving test.Risk
R2. The change only narrows what a predicate accepts, in a direction that fails closed, on a path whose whole output is a local netrc bundle. The worst credible failure after the checks pass is a refresh refusing a group it used to install; the blast radius is one machine's local credential files, the refusal happens before anything is decrypted or written, and recovery is a revert. It is not R1 because the path is credential handling, which earns the walk and a reviewer.
Validation
All run in the worktree at commit
4fe01da.bash tests/refresh-local-auth.sh— 17 tests passed, includingnew-shape refusals install nothing, which now coverssabotage.formatandsabotage.carriage-return.nix flake check— all checks passed.formatclause: deletinghas("format") | notfrom the predicate and rerunning the suite failsnew-shape refusals install nothing, sosabotage.formatis a real witness rather than a case that passes for another reason.sabotage.carriage-returntemplate, and the same predicate withtest("^[[:space:]]*$")substituted accepts it, so that fixture discriminates exactly the clause its comment claims.valueabsent, a string, a badencode, zero or two{secret}placeholders,http, a path, a second line,formatwith and without avalue— with the expected verdict in each case and no jq error.