flare-redact 0.6.0 โ†’ 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -14,9 +14,16 @@
14
14
  <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="MIT License"></a>
15
15
  <img src="https://img.shields.io/npm/types/flare-redact.svg" alt="TypeScript">
16
16
  <img src="https://img.shields.io/badge/dependencies-0-brightgreen" alt="Zero dependencies">
17
+ <img src="https://img.shields.io/badge/languages-24-4f46e5" alt="24 languages">
18
+ <img src="https://img.shields.io/badge/detectors-50-4f46e5" alt="50 detectors">
17
19
  <img src="https://img.shields.io/badge/runtime-node%20%7C%20browser%20%7C%20edge-blue" alt="Runtimes">
18
20
  </p>
19
21
 
22
+ <p align="center">
23
+ ๐ŸŒ <b>International by default โ€” 24 languages</b><br>
24
+ ๐Ÿ‡ฌ๐Ÿ‡ง ๐Ÿ‡จ๐Ÿ‡ณ ๐Ÿ‡ฎ๐Ÿ‡ณ ๐Ÿ‡ช๐Ÿ‡ธ ๐Ÿ‡ธ๐Ÿ‡ฆ ๐Ÿ‡ซ๐Ÿ‡ท ๐Ÿ‡ต๐Ÿ‡น ๐Ÿ‡ท๐Ÿ‡บ ๐Ÿ‡ฏ๐Ÿ‡ต ๐Ÿ‡ฉ๐Ÿ‡ช ๐Ÿ‡ฐ๐Ÿ‡ท ๐Ÿ‡น๐Ÿ‡ท ๐Ÿ‡ฎ๐Ÿ‡น ๐Ÿ‡ฎ๐Ÿ‡ท ๐Ÿ‡ต๐Ÿ‡ฑ ๐Ÿ‡บ๐Ÿ‡ฆ ๐Ÿ‡ณ๐Ÿ‡ฑ ๐Ÿ‡ป๐Ÿ‡ณ ๐Ÿ‡ฎ๐Ÿ‡ฉ ๐Ÿ‡น๐Ÿ‡ญ ๐Ÿ‡ฌ๐Ÿ‡ท ๐Ÿ‡ฎ๐Ÿ‡ฑ ๐Ÿ‡ฆ๐Ÿ‡ฟ ๐Ÿ‡ท๐Ÿ‡ด
25
+ </p>
26
+
20
27
  ---
21
28
 
22
29
  Every leaked secret has the same origin story: someone logged an object, and a
@@ -44,13 +51,16 @@ Nothing to configure. No list of field paths to maintain. No native build step.
44
51
  > [Jump to it โ†“](#redact-prompts-before-they-reach-an-llm)
45
52
 
46
53
  <p align="center">
47
- <img src="assets/coverage.svg" alt="One policy applied across app, logs, HTTP, LLM, datasets, and egress" width="820">
54
+ <picture>
55
+ <source media="(prefers-color-scheme: dark)" srcset="assets/coverage-dark.svg">
56
+ <img src="assets/coverage-light.svg" alt="One policy applied across app, logs, HTTP, LLM, datasets, and egress" width="820">
57
+ </picture>
48
58
  </p>
49
59
 
50
60
  | | | |
51
61
  |---|---|---|
52
62
  | ๐Ÿ” **Content-aware** โ€” reads values, not just field names | โ™ป๏ธ **Reversible** โ€” vault: redact โ†’ use โ†’ restore | ๐ŸŽญ **Format-preserving** โ€” emails stay email-shaped |
53
- | ๐Ÿค– **LLM-safe** โ€” strips secrets before OpenAI/Anthropic | ๐ŸŒ **20+ languages** โ€” plus checksum-validated national IDs | ๐Ÿ›ก๏ธ **ReDoS-safe ยท 0 deps** โ€” safe on untrusted input |
63
+ | ๐Ÿค– **LLM-safe** โ€” strips secrets before OpenAI/Anthropic | ๐ŸŒ **24 languages** โ€” plus checksum-validated national IDs | ๐Ÿ›ก๏ธ **ReDoS-safe ยท 0 deps** โ€” safe on untrusted input |
54
64
 
55
65
  ## Contents
56
66
 
@@ -365,18 +375,25 @@ On by default:
365
375
  | `bearer_token` | `Authorization: Bearer โ€ฆ` |
366
376
  | `basic_auth` | `Authorization: Basic โ€ฆ` |
367
377
  | `url_credentials` | passwords inside connection strings |
368
- | `generic_assignment` | `password=`, `api_key: โ€ฆ`, `secret=โ€ฆ` |
378
+ | `generic_assignment` | `password=`, `api_key: โ€ฆ`, `secret=โ€ฆ` (any language) |
369
379
  | `email` | email addresses |
370
380
  | `credit_card` | card numbers (Luhn-validated) |
381
+ | `iban` | IBANs (mod-97 validated) |
382
+ | `discord_bot_token` / `telegram_bot_token` | chat bot tokens |
383
+ | `shopify_token` / `square_token` | commerce tokens |
384
+ | `digitalocean_token` / `azure_storage_key` | cloud secrets |
385
+ | `sentry_dsn` / `new_relic_key` | observability secrets |
371
386
 
372
387
  Opt in with `enable`:
373
388
 
374
- | Detector | Finds |
389
+ | Detector / tag | Finds |
375
390
  |---|---|
376
391
  | `high_entropy` | long random-looking tokens of *any* format (entropy-based) |
392
+ | `crypto` | Bitcoin & Ethereum addresses, BIP39 seed phrases |
393
+ | `finance` | SWIFT/BIC, US ABA routing numbers |
394
+ | `vehicle` | VINs (checksum-validated) |
395
+ | `network` | IPs, MAC addresses, coordinates, internal URLs |
377
396
  | `phone` | E.164 phone numbers |
378
- | `ipv4` / `ipv6` | IP addresses |
379
- | `mac_address` | MAC addresses |
380
397
 
381
398
  Plus object values whose **key name** is sensitive (`password`, `token`,
382
399
  `authorization`, `cookie`, `cvv`, โ€ฆ) are masked regardless of content.
@@ -385,7 +402,7 @@ Plus object values whose **key name** is sensitive (`password`, `token`,
385
402
 
386
403
  Secrets like API keys and card numbers don't care what language your app is in.
387
404
  Neither does this โ€” but the word-based checks do, so `password`, `secret`, and
388
- `token` are recognized in **20+ languages** (`ลŸifrษ™=โ€ฆ`, `ๅฏ†็ : โ€ฆ`, `ะฟะฐั€ะพะปัŒ=โ€ฆ`,
405
+ `token` are recognized in **24 languages** (`ลŸifrษ™=โ€ฆ`, `ๅฏ†็ : โ€ฆ`, `ะฟะฐั€ะพะปัŒ=โ€ฆ`,
389
406
  `contraseรฑa: โ€ฆ`), as assignments and as object keys.
390
407
 
391
408
  National IDs are opt-in and **checksum-validated**, so a random run of digits is
@@ -398,16 +415,17 @@ redact(text, { enable: ['tr', 'de'] }); // just Turkish and German
398
415
 
399
416
  | Detector | Country | Validated by |
400
417
  |---|---|---|
401
- | `iban` | international *(on by default)* | ISO 13616 mod-97 |
402
- | `tr_tckn` | Turkey | TCKN checksum |
403
- | `de_tax_id` | Germany | ISO 7064 mod-11,10 |
404
- | `es_dni` | Spain (DNI/NIE) | control letter mod-23 |
405
- | `it_codice_fiscale` | Italy | odd/even table |
406
- | `br_cpf` | Brazil | two mod-11 digits |
407
- | `nl_bsn` | Netherlands | 11-test |
408
- | `pl_pesel` | Poland | weighted mod-10 |
409
- | `ca_sin` | Canada | Luhn |
410
- | `us_ssn` | United States | issued-range rules |
418
+ | `iban` | ๐ŸŒ international *(on by default)* | ISO 13616 mod-97 |
419
+ | `tr_tckn` | ๐Ÿ‡น๐Ÿ‡ท Turkey | TCKN checksum |
420
+ | `de_tax_id` | ๐Ÿ‡ฉ๐Ÿ‡ช Germany | ISO 7064 mod-11,10 |
421
+ | `es_dni` | ๐Ÿ‡ช๐Ÿ‡ธ Spain (DNI/NIE) | control letter mod-23 |
422
+ | `it_codice_fiscale` | ๐Ÿ‡ฎ๐Ÿ‡น Italy | odd/even table |
423
+ | `br_cpf` | ๐Ÿ‡ง๐Ÿ‡ท Brazil | two mod-11 digits |
424
+ | `nl_bsn` | ๐Ÿ‡ณ๐Ÿ‡ฑ Netherlands | 11-test |
425
+ | `pl_pesel` | ๐Ÿ‡ต๐Ÿ‡ฑ Poland | weighted mod-10 |
426
+ | `ca_sin` | ๐Ÿ‡จ๐Ÿ‡ฆ Canada | Luhn |
427
+ | `us_ssn` | ๐Ÿ‡บ๐Ÿ‡ธ United States | issued-range rules |
428
+ | `uk_nhs` | ๐Ÿ‡ฌ๐Ÿ‡ง United Kingdom (NHS) | weighted mod-11 |
411
429
 
412
430
  Every algorithm has its own tests against known-valid and known-invalid numbers,
413
431
  so enabling them won't turn your logs into a wall of `[REDACTED]`.
@@ -0,0 +1,4 @@
1
+ export declare const BIP39_WORDS: ReadonlySet<string>;
2
+ /** True when a run of words is a real BIP39 mnemonic (valid length, all in the list). */
3
+ export declare function isMnemonic(value: string): boolean;
4
+ //# sourceMappingURL=bip39.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bip39.d.ts","sourceRoot":"","sources":["../src/bip39.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,MAAM,CAigE1C,CAAC;AAIH,yFAAyF;AACzF,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAIjD"}