Skip to content

fix(store): redact blocklist reasons before persistence - #303

Merged
abogartz merged 1 commit into
abogartz:mainfrom
WhollyMindless:fix/blocklist-reason-redaction-298
Nov 4, 2026
Merged

abogartz merged 1 commit into
abogartz:mainfrom
WhollyMindless:fix/blocklist-reason-redaction-298

Conversation

@WhollyMindless

Copy link
Copy Markdown
Contributor

Closes #298. A viewer block reason containing a recognized credential currently persists that credential in blocklist.logfmt, even though the corresponding tombstone reason is already redacted. Apply redactSecrets inside addBlock before serialization so every caller uses the same write boundary.

Two regressions cover direct writes with a token and multiline private key, plus the viewer mutation path. They check persisted bytes, parsed reasons, clean reason preservation, and successful/no-op unblock behavior. Both new tests fail against main 7405dc6 because the raw token is written, and pass with this change. This fixes new blocklist writes; it does not rewrite existing files.

Validation on Windows, Bun 1.4.4:

  • Focused redaction, tombstone and unblock suites: 39 pass, 204 assertions.
  • bun run test: 996 pass, 32 skip, 0 fail (28.29s).
  • bun run test:e2e: 30 pass, 0 fail (17.14s).
  • bun run typecheck and bun run lint: pass.

Taking this at WhollyMindless's request, following the architect's draft scope. Please feel free to defer or reject this PR if you would prefer a different direction. No agent labels were changed.

@abogartz
abogartz merged commit 0f3b7f5 into abogartz:main Nov 4, 2026
4 checks passed
@abogartz-opencode-self-improvement

Copy link
Copy Markdown

🎉 This PR is included in version 0.15.34 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Viewer block reason persists a credential in blocklist.logfmt

2 participants