feat: custom secret patterns + rename Secret Scanner → Auto Redact

Users can now define custom regex patterns for proprietary token formats,
internal URLs with keys, or any secret the built-in scanner doesn't cover.
Patterns are added/toggled/removed from the Options page and apply to both
the live interception (content.js) and the Test tab (popup.js).

Renamed all user-facing "Secret scanning" labels to "Auto Redact" across
popup and options. Internal variable names (secretScanning, SecretScanner)
kept for backwards compatibility with stored settings.

https://claude.ai/code/session_01KF4i7Ra7zCEDskxDBaNtcT
This commit is contained in:
Claude
2026-03-28 14:32:57 +00:00
parent c8673d5b1c
commit 7ec058f1ea
9 changed files with 175 additions and 22 deletions
+2 -2
View File
@@ -198,8 +198,8 @@
<section class="tab-content" id="tab-options">
<div class="setting-item">
<div class="setting-label">
<strong>Secret scanning</strong>
<span class="setting-desc">Auto-redact API keys, tokens, passwords, SSNs, credit cards</span>
<strong>Auto Redact</strong>
<span class="setting-desc">Automatically redact API keys, tokens, passwords, SSNs, credit cards, and custom patterns</span>
</div>
<label class="toggle"><input type="checkbox" id="optSecretScanning" checked><span class="toggle-slider"></span></label>
</div>
+1 -1
View File
@@ -713,7 +713,7 @@ function renderTestDiff() {
const smartResult = SmartPatterns.substitute(input, identity);
const explicitResult = SubstitutionEngine.substitute(smartResult.text, mappings);
const secretResult = SecretScanner.redact(explicitResult.text);
const secretResult = SecretScanner.redact(explicitResult.text, settings.customSecretPatterns);
const allReplacements = [
...smartResult.replacements,