Redact: the estate's one list of credential shapes (AHT-204) #3

Merged
merge-queue merged 1 commit from redact into main 2026-11-26 07:57:05 -08:00
Owner

Adds Redact (Go) and redact (Rust): the estate's one list of credential shapes, replacing each credential with *** and keeping the text around it. For any field or message holding text from outside the program (command output or arguments, another tool's error text, URLs, headers). Work package: https://openproject.home.romaine.life/wp/AHT-204

Why: fzt-automate's failure log can't join the NAS log pile until its error= text is masked (at-home-tools docs/app-logs.md: a log joins appLogs only once what it writes holds no secrets). Today the masking lives in two private copies in at-home-tools (homesvc's container-log secretPatterns, owner-guard's Redact); this makes it one public list the estate shares. at-home-tools then deletes both copies and calls this.

The list is the union of both copies, each pattern keeping its broader form:

  • URL credential parameters (code, state, sig, token, access_token, password, key, cloud signatures, ...)
  • Authorization: headers with or without a scheme; bearer tokens; basic credentials
  • NAME=value / NAME: value for token, password, passwd, secret, api_key, access_key, client_secret, pat; added: BW_SESSION (the Bitwarden CLI's session key, since bw-grant is an at-menu entry) and the JSON form "password": "x" (the shape a failing tool's error text usually takes)
  • --token, --password, --secret, --api-key, --client-secret flags
  • the user and password in a URL; JWTs (three parts, or two long ones); GitHub tokens; OpenBao tokens

Classes are spelled out in ASCII so Go's and Rust's regular expressions read them the same; the Rust crate gains a regex dependency.

Tests: testdata/redact.json holds 25 cases (every case from both at-home-tools tests, plus the added shapes and lines that must stay untouched), run by both redact_test.go and rust/tests/redact.rs; each also checks masking twice changes nothing. README gains "Masking credentials". ci-check passed.

Not changed: the line format, Logger (it doesn't mask on its own; callers pass outside text through Redact).

🤖 Generated with Claude Code

Adds `Redact` (Go) and `redact` (Rust): the estate's one list of credential shapes, replacing each credential with `***` and keeping the text around it. For any field or message holding text from outside the program (command output or arguments, another tool's error text, URLs, headers). Work package: https://openproject.home.romaine.life/wp/AHT-204 **Why:** fzt-automate's failure log can't join the NAS log pile until its `error=` text is masked (at-home-tools docs/app-logs.md: a log joins `appLogs` only once what it writes holds no secrets). Today the masking lives in two private copies in at-home-tools (homesvc's container-log `secretPatterns`, owner-guard's `Redact`); this makes it one public list the estate shares. at-home-tools then deletes both copies and calls this. **The list** is the union of both copies, each pattern keeping its broader form: - URL credential parameters (`code`, `state`, `sig`, `token`, `access_token`, `password`, `key`, cloud signatures, ...) - `Authorization:` headers with or without a scheme; bearer tokens; basic credentials - `NAME=value` / `NAME: value` for `token`, `password`, `passwd`, `secret`, `api_key`, `access_key`, `client_secret`, `pat`; **added:** `BW_SESSION` (the Bitwarden CLI's session key, since bw-grant is an at-menu entry) and the JSON form `"password": "x"` (the shape a failing tool's error text usually takes) - `--token`, `--password`, `--secret`, `--api-key`, `--client-secret` flags - the user and password in a URL; JWTs (three parts, or two long ones); GitHub tokens; OpenBao tokens Classes are spelled out in ASCII so Go's and Rust's regular expressions read them the same; the Rust crate gains a `regex` dependency. **Tests:** `testdata/redact.json` holds 25 cases (every case from both at-home-tools tests, plus the added shapes and lines that must stay untouched), run by both `redact_test.go` and `rust/tests/redact.rs`; each also checks masking twice changes nothing. README gains "Masking credentials". `ci-check` passed. **Not changed:** the line format, `Logger` (it doesn't mask on its own; callers pass outside text through `Redact`). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Redact: the estate's one list of credential shapes, in Go and Rust (AHT-204)
All checks were successful
Suite go / check-test-windows (pull_request) Successful in 31s
Suite rust / check-test-windows (pull_request) Successful in 40s
Suite rust / reused-checks (pull_request) Successful in 3s
Suite release / scope (pull_request) Successful in 4s
Suite rust / check-test-linux (pull_request) Has been skipped
Suite rust / check-services (pull_request) Has been skipped
Suite rust / check-typos (pull_request) Has been skipped
Suite release / check-build (none, ubuntu-latest) (ubuntu-latest, none) (pull_request) Has been skipped
Suite release / build (none, ubuntu-latest) (ubuntu-latest, none) (pull_request) Has been skipped
Suite release / check-package (pull_request) Has been skipped
Suite release / reused-checks (pull_request) Has been skipped
Suite go / check-test-linux (pull_request) Has been skipped
Suite go / check-services (pull_request) Has been skipped
Suite release / dispatch (pull_request) Has been skipped
Suite go / scope (pull_request) Successful in 4s
Suite release / reserve (pull_request) Has been skipped
Suite release / finalize (pull_request) Has been skipped
Suite default / check-rules (pull_request) Successful in 4s
Suite default / check-fetches (pull_request) Successful in 5s
Suite go / reused-checks (pull_request) Successful in 3s
Suite release / home-sync (pull_request) Has been skipped
Suite release / publish (pull_request) Has been skipped
Suite rust / check-machete (pull_request) Has been skipped
Suite rust / check-audit (pull_request) Has been skipped
Suite release / module (pull_request) Has been skipped
Suite release / deploy-image (pull_request) Has been skipped
Suite go / check-format (pull_request) Successful in 6s
Suite rust / check-format (pull_request) Successful in 6s
Suite default / reused-checks (pull_request) Successful in 4s
merge-queue landed on main
3bbe8633d5
Redact (Go) and redact (Rust) replace what looks like a credential with ***,
for fields holding text from outside the program. The list is the union of
at-home-tools' homesvc container-log patterns and owner-guard's Redact, with
BW_SESSION and JSON fields added; testdata/redact.json holds both
implementations' cases.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
merge-queue deleted branch redact 2026-11-26 07:57:05 -08:00
Sign in to join this conversation.
No reviewers
No labels
queue
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
romaine-life/logline!3
No description provided.