Close redaction gaps + honor the poll-attempt cap #1

Merged
flan merged 1 commits from fix/audit-redaction-poller into main 2026-07-19 16:07:34 -04:00
Owner

Closes three repo-review findings on the read-only truenas-mcp fork:

  • 31b71cdf3ed2 tools/registry.gohandleQueryPools embedded the raw pool.query response in a parse-error string, bypassing the RedactJSON choke point (handler errors return unredacted). Now redacted.
  • 29004c292008 tools/redact.go — a secret inside an opaque string blob (a custom app's compose YAML from get_app_config) passed through unmasked. redactValue now scans the interior of string values for secret-keyed key: value / key=value lines; non-secret lines and prose are untouched. The redact_gaps test that documented the gap is flipped to assert it's closed.
  • a1fde5826854 tasks/poller.goMaxPollAttempts was declared ("0 = unlimited") but never read, reading as a safety cap that wasn't enforced. Now honored (0 stays unlimited, so default behavior is unchanged).

go build, go vet, and go test ./tools/... ./tasks/... all pass.

Closes three repo-review findings on the read-only truenas-mcp fork: - **`31b71cdf3ed2`** `tools/registry.go` — `handleQueryPools` embedded the raw `pool.query` response in a parse-error string, bypassing the `RedactJSON` choke point (handler errors return unredacted). Now redacted. - **`29004c292008`** `tools/redact.go` — a secret inside an opaque string blob (a custom app's compose YAML from `get_app_config`) passed through unmasked. `redactValue` now scans the interior of string values for secret-keyed `key: value` / `key=value` lines; non-secret lines and prose are untouched. The `redact_gaps` test that documented the gap is flipped to assert it's closed. - **`a1fde5826854`** `tasks/poller.go` — `MaxPollAttempts` was declared ("0 = unlimited") but never read, reading as a safety cap that wasn't enforced. Now honored (0 stays unlimited, so default behavior is unchanged). `go build`, `go vet`, and `go test ./tools/... ./tasks/...` all pass.
flan added 1 commit 2026-07-19 16:04:44 -04:00
Close redaction gaps + honor the poll-attempt cap
Build and Package / Build Binaries (pull_request) Canceled after 0s
a775b23283
- redact.go: scan the interior of string values for secret-keyed
  key:value / key=value assignments, so a POSTGRES_PASSWORD embedded in a
  custom app's compose YAML (returned by get_app_config as one blob) is
  masked instead of reaching the model context. Non-secret lines and
  ordinary prose are left byte-for-byte unchanged.
- registry.go: run the raw pool.query response through RedactJSON before
  embedding it in handleQueryPools' parse-error string; handler errors are
  returned unredacted, bypassing the normal choke point.
- poller.go/types.go: honor PollerConfig.MaxPollAttempts. It was declared
  ("0 = unlimited") but never read, so it read as a safety cap that wasn't
  enforced. A task now fails once it exhausts the cap; 0 stays unlimited,
  so default behavior is unchanged.

Flips the redact_gaps compose-blob test from asserting the gap to
asserting it is closed.
flan merged commit b3632375af into main 2026-07-19 16:07:34 -04:00
flan deleted branch fix/audit-redaction-poller 2026-07-19 16:07:34 -04:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: flan/truenas-mcp#1