rehearsal-report: redact the token in the auth-failed alert (#159) #160

Merged
matou-build-agent merged 1 commit from fix/159-rehearsal-report-token-leak into main 2026-09-21 04:54:26 +00:00

Fixes the ${tok:-EMPTY} full-token leak in claude_auth_announce (issue #159). Port of Matou/idss bdb42ff6. Red-before-green proven with tests/rehearsal-report-test.sh (leak reintroduced -> FAIL; fix -> PASS, 50 cases). Branched off idss pin 41495283; the two files are byte-identical between old-pin and main so the merge is clean.

Related: Matou/idss #1683 (the drift), GOTCHAS #228/#303.

Fixes the `${tok:-EMPTY}` full-token leak in `claude_auth_announce` (issue #159). Port of Matou/idss bdb42ff6. Red-before-green proven with tests/rehearsal-report-test.sh (leak reintroduced -> FAIL; fix -> PASS, 50 cases). Branched off idss pin 41495283; the two files are byte-identical between old-pin and main so the merge is clean. Related: Matou/idss #1683 (the drift), GOTCHAS #228/#303.
`claude_auth_announce` built the label as `${tok:+${tok:0:14}…}${tok:-EMPTY}`;
`${tok:-EMPTY}` is the value itself whenever a token is set, so the alert posted
the full account-B OAuth token to the drive ticket, Mattermost and the executor
log (Matou/idss #1672 fire 1). The display form is now computed once into its own
`shown` variable and only that reaches the message; the reporter test pins that a
fake token's body never appears in anything posted and the 14-char prefix still
does.

Straight port of the fix landed in Matou/idss as bdb42ff6, which reds idss's
#571/ADR 0180 drift gate because both files are vendored factory copies — the fix
belongs here in the factory core so every consumer stops leaking on next
FACTORY_REF bump. Branched off idss's current pin (41495283) so it can also serve
as idss's re-vendor base without adopting the 15-commit main upgrade. The leaked
account-B token still needs rotating (Matou/idss GOTCHAS #303).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/dev-factory!160
No description provided.