feat: consistent redaction for repeated PII values - #106
Merged
Conversation
Contributor
⚡ Benchmark ResultsSummary
⚡ Per-locale throughput (14 locales)
📊 Per-detector breakdown (70 detectors)
🔧 Other benchmarks (11)
📋 Raw benchstat output (root)Generated by CI benchmark comparison |
leoneperdigao
force-pushed
the
feat/88-consistent-redaction
branch
2 times, most recently
from
March 20, 2026 07:18
bade915 to
b753321
Compare
Contributor
⚡ Benchmark ResultsSummary
⚡ Per-locale throughput (14 locales)
📊 Per-detector breakdown (70 detectors)
🔧 Other benchmarks (11)
📋 Raw benchstat output (root)Generated by CI benchmark comparison |
leoneperdigao
force-pushed
the
feat/88-consistent-redaction
branch
from
March 20, 2026 07:35
c5d092d to
6a58563
Compare
Add a Consistent replacer wrapper that ensures identical PII values produce identical replacement strings within a single Replace call. When wrapping the Redact replacer, values are numbered per-type (e.g. [EMAIL_1], [EMAIL_2]). Works with all replacer strategies. Expose via WithConsistentRedaction() option in the public API. Closes #88
leoneperdigao
force-pushed
the
feat/88-consistent-redaction
branch
from
March 20, 2026 07:36
6a58563 to
94c0d1f
Compare
Contributor
⚡ Benchmark ResultsSummary
⚡ Per-locale throughput (14 locales)
📊 Per-detector breakdown (70 detectors)
🔧 Other benchmarks (11)
📋 Raw benchstat output (root)Generated by CI benchmark comparison |
Contributor
⚡ Benchmark ResultsSummary
⚡ Per-locale throughput (14 locales)
📊 Per-detector breakdown (70 detectors)
🔧 Other benchmarks (11)
📋 Raw benchstat output (root)Generated by CI benchmark comparison |
This was referenced Mar 20, 2026
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
Consistentreplacer wrapper (adapter/replacer/consistent.go) that ensures the same PII value always maps to the same replacement string within aReplacecallRedactreplacer, produces numbered placeholders per type (e.g.[EMAIL_1],[EMAIL_2]); for other replacers (Hash, Mask, Custom), caches the first generated replacement and reuses itWithConsistentRedaction()option in the public API (wuming.go)Test plan
adapter/replacer/consistent_test.gopassgo build ./...)Closes #88