feat: add SensitiveParsers preset with protocol-qualified URL support - #8
feat: add SensitiveParsers preset with protocol-qualified URL support#8ClaudiuCeia with Copilot wants to merge 3 commits into
Conversation
Introduces `SensitiveEntity` type and `SensitiveParsers` parser tuple that extend the PII preset with protocol-qualified URLs (https/http/ftp) while intentionally excluding bare domains (e.g. `example.com`). - `PIIParsers` / `PIIEntity` are unchanged (direct identifiers only) - `SensitiveParsers` uses `dot(URL.Full)` — full URLs only, not bare domains - `SensitiveEntity = PIIEntity | URLEntity` - Playground registry gets `SENSITIVE_IDS` for future UI wiring - 5 new tests: full-URL redaction, bare-domain passthrough, PII+URL combo, mixed bare+full, and a compile-time type membership assertion Closes #7
|
@copilot - what's going on here |
This PR resolves #7 by adding a The problem: The solution: a separate, broader preset that uses Duckling(SensitiveParsers).redact(
"Reset: https://example.com/reset?token=abc123 — visit docs.example.com",
);
// → "Reset: ██████████████████████████████████████████ — visit docs.example.com"
|
|
@copilot - I was talking about the CI failure. Also, are you taking this out of draft when done? |
The CI failure was a Regarding taking it out of draft — I'm not able to change the PR state directly, but everything should be ready for review now. |
PIIParsersexcludes URLs entirely, even though protocol-qualified URLs routinely carry reset tokens, signed parameters, and credentials. AddingURL.parserwholesale would also redact innocent bare domains — so this introduces a separate, broader preset instead.Changes
mod.ts— two new exports:SensitiveEntity = PIIEntity | URLEntitySensitiveParsers— all 12 PII parsers +dot(URL.Full)(protocol-qualified URLs only; bare domains likeexample.comare intentionally not matched)docs/src/registry.ts—SENSITIVE_IDSconstant (PII_IDS + "URL") for future playground wiringtests/redact.test.ts— 5 new tests: full-URL redaction, bare-domain passthrough, PII+URL combo, mixed bare+full in one input, and a compile-time type membership assertionPIIParsers/PIIEntityare unchanged.