credential-profiles: accept a value-template local-auth-refresh source #76
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/archetypes!76
Loading…
Reference in a new issue
No description provided.
Delete branch "agent/local-auth-refresh-template"
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?
Nothing changes on a running machine: this PR only widens one build-time check. The
credential-profilescheck that guardslocal_auth_refreshnow accepts the group's source credential in either its current registry shape (format = "credential-store-url") or the new shape from allod/secrets#23: avalue.templatethat is exactly onehttps://<user>:{secret}@<host>line, with the same character classes and the same blank-line rule the netrc activation script applies at runtime. Every existing witness in the check is unchanged and the current registry still validates. The proof isnix flake check: the exact contract template is accepted, and every rejected template class has a sabotage fixture that fails on the predicate itself, not on some other rule. This is the first of three PRs to merge, so the check never rejects the secrets template's new example. If it is wrong, revert it; no generated artifact, unit, or machine state depends on this check.What changes
flake.nix, inside thecredential-profilescheck: a newisCredentialStoreUrlTemplatepredicate and anisCredentialStoreUrlSourceunion replace the literalformat == "credential-store-url"test for alocal_auth_refreshsource credential. A credential carrying bothformatandvalueis refused (mixed shapes fail closed).modules/netrc.nix: blank lines are dropped the wayawk 'NF'drops them (space and tab only), exactly one non-empty line must remain, and that line must match the netrcsedgrammar with{secret}as the whole password and nowhere else. Novalue.encodeis allowed.httpsscheme, zero non-empty lines, trailing text after the placeholder, leading whitespace, a carriage-return-only line, a non-string template, an encoding on the template, a mixed legacy-plus-template credential, and a plain new-shape credential with novalue. Each is counted as caught only when the predicate's own error fires.Risk
R3 in the plan (cross-repo validation of generated credential deployment). Residual after the checks: the predicate accepts a template whose rendered file the netrc script rejects. That failure is loud at the next rebuild (
netrc activation: expected exactly one non-empty credential lineormalformed credential line, exit 1), not silent, and the two-review pass found and fixed the one such gap (carriage-return-only lines). Rollback is a revert of this PR.Validation
nix flake check .in the worktree (plain path pernix.md): ``all checks passed!, exit 0git diff --check:no output, exit 0exits 1 witherror: credential-profiles: local_auth_refresh mutation checks did not fail as expected: template placeholder in user: accepted, template missing placeholder: accepted, ...naming all eighteen template mutations); restored afterwards.pirunner on providernullsink-claude:claude-opus-5at thinkinghigh(1 blocker, 4 gaps, 1 simplify) andclaude-fable-5-1(thinking not exposed on that route; 2 gaps, 1 question, 1 simplify). Both flagged the blank-line rule mismatch, the mixed-shape short-circuit, missing sabotage classes, and the inverted positive-witness diagnostic; all accepted and fixed in this diff. The author of the original diff was a Codex model, so both reviewers are cross-family.Refs allod/secrets#23
The local_auth_refresh source predicate accepts either the legacy credential-store-url format or a value.template that is exactly one netrc credential-store line with {secret} in the password position, matching modules/netrc.nix byte for byte, including its awk blank-line rule. A credential carrying both format and value is refused. Positive witnesses cover the canonical template and one sabotage fixture per rejected template class, each pinned to the predicate's own error. Refs allod/secrets#236e2d0626d8toeff0ec35b4