Skip to content

feat(stellar): add log redaction utility for Stellar identifiers#158

Open
Kingvic300 wants to merge 1 commit into
wraith-protocol:developfrom
Kingvic300:feat/stellar-log-redaction
Open

feat(stellar): add log redaction utility for Stellar identifiers#158
Kingvic300 wants to merge 1 commit into
wraith-protocol:developfrom
Kingvic300:feat/stellar-log-redaction

Conversation

@Kingvic300

Copy link
Copy Markdown

Summary

  • Adds redact(text: string): string to src/chains/stellar/log/redact.ts, which finds Stellar meta-addresses, strkeys (accounts, secrets, contract IDs, pre-auth tx hashes, hashx signers, pool IDs), muxed accounts, and 32-byte hex blobs (tx hashes, ephemeral pubkeys) in arbitrary text and replaces each with a stable, hash-derived pseudonym — same identifier always redacts to the same alias, with no shared state.
  • Adds RedactingReporter, a dependency-free Vitest reporter (duck-typed against Vitest's Reporter hooks, no import of the vitest package) that redacts error messages/stacks/diffs and captured console output in place so failure output prints redacted by default when registered in a project's own vitest.config.ts.
  • Exports both from src/chains/stellar/index.ts.
  • Documents usage in a new src/chains/stellar/README.md.

Test plan

  • pnpm test — all 1002 tests pass (12 new tests in test/chains/stellar/log/redact.test.ts covering every identifier kind, pseudonym stability/uniqueness, idempotency, and each reporter hook)
  • pnpm build — all three entry points build cleanly, vitest does not leak into dist/chains/stellar/index.d.ts
  • pnpm run format:check

Closes #141

Scanner debug logs and test failures can leak meta-addresses, tx hashes,
and other Stellar identifiers into shared bug reports. redact() replaces
each identifier with a stable, hash-derived pseudonym, and RedactingReporter
wires that into a project's own Vitest config so failure output is redacted
by default.

Closes wraith-protocol#141
@drips-wave

drips-wave Bot commented Jul 24, 2026

Copy link
Copy Markdown

@Kingvic300 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Log obfuscation / redaction utility

1 participant