data_redactor 0.13.0-x86_64-linux → 0.14.0-x86_64-linux

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d3d7014d46543552a93438dd60a4497d8715df9f4640c6a7e266396c6dbf4f23
4
- data.tar.gz: 7038c31010f433e94d28ddaa44e755f8b8e665d597f403694d7866c8fdc1c9dd
3
+ metadata.gz: 86ed390986b76cb2bcb48a80c322be42b8bd91dcd5b9afb8299a6ab4c0dd9419
4
+ data.tar.gz: ca7260eff77b03d15392b0c763e56ee7b5bf146eb7f0b7597f78f41d2a6dfe08
5
5
  SHA512:
6
- metadata.gz: bf698b4c4c08b999e9c8beb1d79a99ff7125f170d7bfa52fcc74448c1e91cf0e4791fb19a281f0d70f2ab01e0307e113a365301460fd9fab820444365c5d6994
7
- data.tar.gz: 3585c09aae01176e92b7687257b04598bfc5c5b2e8a5e3ab59179aed7706e93d8898020bc6747c8a5b32c0e3ebc36a745c88c0b1d4b52ffe7102a02be2046d95
6
+ metadata.gz: a683277146fbb1e19caefffe829a9de090d48b181f0d15cc98a625509f47da1a7cf4f7f69df165f4b077a321f2ff1ee125ef4881e5746949b62f6db87269e022
7
+ data.tar.gz: ecb6d0acfcf1a9b9c2c79f1d0e016ae4ad13d0c938e31c9d97f0b3bdc8f323ac7c7c1d1a2828067b3a5b9f33895e0e9bc3bb6a69bd9c7f324e2055cdeb082ee8
data/CHANGELOG.md CHANGED
@@ -7,6 +7,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.14.0] - 2026-06-17
11
+
12
+ ### Added
13
+ - **Key-name-anchored secret redaction** (`:credentials`). A new pattern tier
14
+ redacts a secret by the *name of the field it is assigned to*, for values with
15
+ no distinctive shape of their own — the primary case being an `.env` file or
16
+ config blob passed through the redactor. Anchored on the key words `password`,
17
+ `passwd`, `pwd`, `secret`, `token`, `api_key`, `apikey`, `access_key`, and
18
+ `client_secret` (case-insensitive), followed by `=` or `:` (dotenv and YAML
19
+ styles), with quoted (`"..."`/`'...'`) or unquoted (≥6 chars) values. Only the
20
+ **value** is redacted; the key is kept so logs stay greppable
21
+ (`PASSWORD=[REDACTED]`). Compound key names match whether the secret word is a
22
+ prefix or suffix segment (`POSTGRES_DB_PASSWORD=`, `PASSWORD_POSTGRES=`).
23
+ Requires the assignment separator, so the word in prose ("reset your password")
24
+ is not a false positive.
25
+ - `examples/` directory with runnable, copy-pasteable usage scripts for every
26
+ feature (core redaction, scan/dry-run, custom patterns, deep/JSON traversal,
27
+ and the Logger / Rack / Rails / LLM integrations). Repo-only — not packaged in
28
+ the gem. Linked from the README.
29
+
10
30
  ## [0.13.0] - 2026-06-13
11
31
 
12
32
  ### Changed
@@ -255,7 +275,8 @@ features as 0.7.1 plus the pipeline fix.
255
275
  - `DataRedactor.redact(text)` module function returning the input with every match replaced by `[REDACTED]`.
256
276
  - RSpec suite with one example per pattern.
257
277
 
258
- [Unreleased]: https://github.com/danielefrisanco/data_redactor/compare/v0.13.0...HEAD
278
+ [Unreleased]: https://github.com/danielefrisanco/data_redactor/compare/v0.14.0...HEAD
279
+ [0.14.0]: https://github.com/danielefrisanco/data_redactor/compare/v0.13.0...v0.14.0
259
280
  [0.13.0]: https://github.com/danielefrisanco/data_redactor/compare/v0.11.0...v0.13.0
260
281
  [0.11.0]: https://github.com/danielefrisanco/data_redactor/compare/v0.10.1...v0.11.0
261
282
  [0.10.1]: https://github.com/danielefrisanco/data_redactor/compare/v0.10.0...v0.10.1
data/README.md CHANGED
@@ -46,6 +46,12 @@ DataRedactor.redact(text)
46
46
  # => "User CF is [REDACTED] and key is [REDACTED]"
47
47
  ```
48
48
 
49
+ Prefer runnable code? The [`examples/`](examples/) directory has self-contained,
50
+ copy-pasteable scripts for every feature below — core redaction, scan/dry-run,
51
+ custom patterns, deep/JSON traversal, and the Logger / Rack / Rails / LLM
52
+ integrations. Run any of them with `bundle exec ruby examples/<name>.rb` (see
53
+ [examples/README.md](examples/README.md)).
54
+
49
55
  ### Filtering by tag or pattern name
50
56
 
51
57
  `only:` and `except:` both accept a single value or an Array, mixing **Symbols** (tag names) and **Strings** (specific pattern names).
@@ -415,6 +421,16 @@ redactor/
415
421
  │ └── tags.h # TAG_* bit constants
416
422
  ├── spec/
417
423
  │ └── data_redactor_spec.rb # RSpec tests — at least one example per pattern, plus filter / placeholder / custom-pattern coverage
424
+ ├── examples/ # Repo-only runnable usage scripts (not packaged in the gem)
425
+ │ ├── README.md # Index + how to run
426
+ │ ├── basic_redact.rb # redact, tag filters, placeholder modes
427
+ │ ├── scan_report.rb # scan dry-run with byte offsets
428
+ │ ├── custom_pattern.rb # add_pattern + name_pattern
429
+ │ ├── deep_and_json.rb # redact_deep / redact_json
430
+ │ ├── logger.rb # Logger::Formatter integration
431
+ │ ├── rack_middleware.rb # Rack middleware (body + headers)
432
+ │ ├── rails_filter.rb # filter_parameters adapter
433
+ │ └── llm_payload.rb # Claude / OpenAI message + response redaction
418
434
  ├── benchmark/ # Repo-only perf scripts (not packaged in the gem)
419
435
  │ ├── README.md # How to run, what each script measures
420
436
  │ ├── support/corpus.rb # Shared payload builders + pure-Ruby baseline redactor
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1,4 +1,4 @@
1
1
  module DataRedactor
2
2
  # Current gem version. Follows {https://semver.org Semantic Versioning 2.0.0}.
3
- VERSION = "0.13.0"
3
+ VERSION = "0.14.0"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: data_redactor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.14.0
5
5
  platform: x86_64-linux
6
6
  authors:
7
7
  - Daniele Frisanco