Repository navigation
fix(fleet): reject header-unsafe credentials at token resolution - #17025
Conversation
A rotation source resolving to a value that cannot travel in an Authorization header (a hosts.yml body where a token was expected, an error page, the wrong secret) now fails in token_for, so the rotation walk skips the source and tries the next — instead of the value reaching gh as GH_TOKEN and dying in net/http at request construction, outside every failover classification (code#16826, 0640-ET's 2026-11-29 defect record). Shape gate: non-empty, all bytes ASCII graphic. Covers every resolution path — daemon and in-process mints, tier-3 finished tokens, and the parsed personal token. Error is value-free.
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
|
Gate run 46325318508 is VOID for the test half — do not merge on its 'success' conclusion. Felix lane 0640-FL read the finalized job log firsthand: checkout was correct (felix/16826-credential-shape @ 9516611), but the build died in openssl-sys — 'Could not find openssl via pkg-config: The pkg-config command could not be found' — because the dispatch's nix shell carried the openssl package without pkg-config or the OPENSSL_* env. Zero tests executed; the trailing marker printed anyway because the test leg was guarded. The run's green conclusion is the conclusion-alone trap, not evidence. Corrected re-dispatch with the realised-dev-output OpenSSL recipe + pkg-config: run 46326321302. Verdict lands when it finalizes. |
|
Gate run 46326321302 also VOID (zero tests) — Felix lane 0640-FL read its uploaded fleet-command-log artifact firsthand: the dispatch's double-quoted inner |
|
Gate GREEN — merge-ready. Felix lane 0640-FL read the finalized job log of run 46327263255 firsthand: checkout felix/16826-credential-shape @ 9516611; |
Lane 0640-FL, for #16826 (0640-ET's defect record, comment 7264247126). Does not close #16826 — its tiers 2–4 timing remainder (laptop-gated) and the seat binary refresh stay open there.
Change
FleetTokenProvider::token_fornow runs every resolved token throughensure_header_safe_token: non-empty, all bytes ASCII graphic (0x21–0x7E). A source resolving to anything else — a hosts.yml body where a token was expected, an error page, the wrong secret — returns a value-freeErr, which every consumer already treats as a failed source:fleet ghrotation walk (run_with_provider_capturing) skips to the next source;fleet git-credential'sselect_credentialskips it the same way;fleet gh tiersreports the source DOWN.Before this, the value went straight to
ghasGH_TOKENand Go's net/http refused it at request construction (invalid header field value for "Authorization") — outside every failover classification — so no other source was tried. That is the failure that blocked this seat's write route for ~10 minutes on 2026-11-29 (ET's record). The 2026-11-22 instance was fixed by parsing the personal secret; this gate covers every resolution path, including tier-3's finished tokens and App mints, which were previously trusted raw.Tests
header_safe_token_shape— oracle: the header shapes net/http accepts; GitHub's real token families pass, empty/multi-line/spaced/control/non-ASCII payloads are rejected.token_for_rejects_a_misshaped_mint— oracle: ET's defect record; a daemon minting a hosts.yml-shaped body makestoken_forerror (value-free) instead of returning the payload.Remote gate: fleet-command run 46325318508 (cargo test -p fleet --bin fleet gh::) — verdict to be posted here when it finalizes.
{ "direct_parent": null, "links": [], "lineage": { "design": null, "roadmap_item": null, "priority": null }, "pm_meta": 1, "provenance": { "queue_id": null, "scheduled_start": null, "picked_up_at": null, "work_started_at": null, "created_at": "2026-11-29T23:51:54Z", "session_id": null, "lane": null, "host": "htch-runtime", "worktree": "/home/hatch", "model": null, "lane_start_issues": [], "workspace_ref": { "kind": "worktree", "id": "/home/hatch", "repo": "developing-today/code", "branch": "main", "sha": "010b47d1c4cecdcd1b7d6ea260b7c9b0a61fb89e" }, "auth_subject": "felix", "stamped_by": "fleet 0.1.0 (native)" } }Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.