feat(stellar): add log redaction utility for Stellar identifiers#158
Open
Kingvic300 wants to merge 1 commit into
Open
feat(stellar): add log redaction utility for Stellar identifiers#158Kingvic300 wants to merge 1 commit into
Kingvic300 wants to merge 1 commit into
Conversation
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
|
@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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
redact(text: string): stringtosrc/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.RedactingReporter, a dependency-free Vitest reporter (duck-typed against Vitest'sReporterhooks, no import of thevitestpackage) 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 ownvitest.config.ts.src/chains/stellar/index.ts.src/chains/stellar/README.md.Test plan
pnpm test— all 1002 tests pass (12 new tests intest/chains/stellar/log/redact.test.tscovering every identifier kind, pseudonym stability/uniqueness, idempotency, and each reporter hook)pnpm build— all three entry points build cleanly,vitestdoes not leak intodist/chains/stellar/index.d.tspnpm run format:checkCloses #141