refresh-local-auth: consume the validated local-auth-refresh projection #58
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!58
Loading…
Reference in a new issue
No description provided.
Delete branch "agent/credential-url-predicate"
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-authstops re-deriving the credential-store URL rule itself. It now readslib.localAuthRefreshSourcesfrom the secrets flake, a per-group projection of the refresh entries that the flake validates on the way out, so the jq copy of thehttps://user:token@hostgrammar and every comment claiming it matches allod/archetypes and allod/tools are gone. What changes for a running machine: a refresh needs a secrets checkout whose flake carries that export; an older checkout is refused by name, pointing at allod/secrets#29, before anything is decrypted. One check on the decrypted secret tightens: a line counts as blank only when it holds spaces and tabs, the same class the deployed netrc activation uses, so a secret ending in a carriage-return-only line is refused here instead of being installed and then refused at activation. What stays identical: which groups can be refreshed, the four files installed, their owners and modes, the preflight refusals, and the rollback on a failed install. What proves it istests/refresh-local-auth.sh, 21 tests behind shellcheck in the flake'sprovisioning-contractcheck, plus a run of the real script against the real secrets flake from the allod/secrets PR, which reads the projection, selects the group, passes preflight and stops only at decryption. If this is wrong the symptom is a refresh refused with one of the named messages, and the fix is a straight revert of this one commit. A deployment's private fork of allod/secrets must merge the template change from allod/secrets#29 before this reaches its machines.Merge of master at
6c782e5(integrator, 2026-09-20): master had moved five commits, including the rotation-registry export rename, and the branch conflicted in the script and its test. Resolved keeping the projection read and this branch's fixtures; the merged tree differs from master only in the two files this PR owns, and from the branch tip only in one comment that now nameslib.rotationRegistryinstead of the renamed export. Re-run after the merge:bash tests/refresh-local-auth.sh— 21 passed;nix flake check .— all checks passed; the real-consumer run against current allod/secrets master (255af16) withIDENTITY_CONFIG,REFRESH_LOCAL_AUTH_HOSTNAME=allod-dev, a scratchREFRESH_LOCAL_AUTH_ROOTand no age key reads the projection, passes preflight, and stops atcould not decrypt local auth source secret. A private secrets fork must exportlib.localAuthRefreshSourcesbefore its deploy lock takes this; the script refuses an older checkout by name.Refs allod/secrets#29
Read lib.localAuthRefreshSources instead of lib.forgejoTokenGroups, so the script trusts a projection the secrets flake has already validated instead of re-deriving the credential-store URL grammar in jq. A secrets checkout that predates the export gets a refusal naming it; any other eval failure keeps the existing message shape. validate_refresh_metadata and its jq predicate for the URL grammar are gone. What remains is a minimal shape check on each projected entry (contract, system, local_username, source_credential, secret_path), and refresh_entry now reads secret_path straight off the projected entry instead of looking it up in the group's credentials. parse_credential_store_plaintext's blank-line test moves from POSIX [:space:], which glibc widens under a UTF-8 locale, to a literal bash pattern matching only space and tab, matching the class archetypes/modules/netrc.nix's awk 'NF { print }' actually drops. A carriage-return-only second line is therefore no longer treated as blank padding and is refused. Test fixtures now build the local-auth-refresh-sources projection directly, in the shape the secrets flake exports it, rather than deriving it from a raw registry via jq. The old template-mutation and registry-structure tests that exercised the deleted jq predicate are gone; new tests cover the missing-export refusal, an empty secret_path, a carriage-return-only second line, and space/tab padding. Refs allod/secrets#29Merged master into this branch at
6c782e5to clear the two conflicts master's rotation-registry rename caused in the script and its test. The resolution reproduces the branch tip exactly except for one comment that now names the renamed export; the 21-test suite, the flake check and the real-consumer run against current allod/secrets master are green again, recorded in the body's Validation section. Ready to merge; allod/secrets#29 closes on the allod/archetypes cutover PR that follows.