flare-redact 1.8.0 → 1.9.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/CHANGELOG.md CHANGED
@@ -1,5 +1,96 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.9.1 (2026-11-17)
4
+
5
+ ### Documentation
6
+
7
+ - The README is now a short overview: what it does, a quick start, where it
8
+ plugs in (logs, LLM prompts, Sentry, commits), how it compares with logger
9
+ path redaction, Sentry scrubbing, gitleaks and Presidio, and an FAQ.
10
+ - The complete documentation moved, unchanged, to
11
+ [`docs/guide.md`](docs/guide.md), which also ships in the npm package so
12
+ coding assistants reading `node_modules` find it.
13
+ - Tests check that every README link lands on a real heading in the guide and
14
+ that every detector count matches the code.
15
+
16
+ No code changes.
17
+
18
+ ## 1.9.0 (2026-11-14)
19
+
20
+ ### Turn it on without touching the code
21
+
22
+ - Add `flare-redact/register`. `node --import flare-redact/register app.js` (or
23
+ `NODE_OPTIONS="--import flare-redact/register"`) redacts every
24
+ `console.log`, `info`, `warn`, `error` and `debug` call with no code
25
+ change. `FLARE_REDACT_PRESET` picks the preset; an unknown name stops the
26
+ process at startup. It is the only module marked as having side effects.
27
+ - Add `flare-redact/sentry`. `Sentry.init({ dsn, ...sentryRedact({ preset:
28
+ 'gdpr' }) })` redacts error events, transactions, spans, Sentry Logs and
29
+ breadcrumbs before they are sent, masks cookies whole, and keeps Sentry's own
30
+ fields (event, trace, span and debug ids, release, timestamps, SDK metadata,
31
+ the file and function of each stack frame) exactly, so grouping, tracing and
32
+ source maps keep working even with `preset: 'strict'`. A field is put back
33
+ only where Sentry keeps it and only when its value has the shape that field
34
+ has and no detector but entropy fires on it, so `extra.release`, a request
35
+ field called `sid` or an email in an exception type is redacted like any
36
+ other user data. A stack frame's file is kept only when it names a file and
37
+ has no query string. Cookies are masked whatever the options and wherever
38
+ they sit: the request, the response context, span attributes, breadcrumbs.
39
+ The caller's event is never written to, frozen or not. Checked against
40
+ `@sentry/node` 11: `sentryRedact(opts, { traceLifecycle: 'stream' })` leaves
41
+ out `beforeSendTransaction`, which Sentry 11 no longer calls and warns about.
42
+ Two things Sentry sends pass through no hook and so cannot be redacted here:
43
+ the release-health session and the trace header carrying the root span name.
44
+ - `flare-redact init` recognises the Sentry SDKs and prints the no-code
45
+ `--import` line alongside `wrapConsole`.
46
+
47
+ ### Stop a secret before the commit exists
48
+
49
+ - Add `flare-redact --staged`: scan only the lines the next commit adds, read
50
+ from the staged diff, and report each finding at its line in the staged file.
51
+ A commit is stopped for what it introduces, not for old findings elsewhere in
52
+ the file, and a renamed file is compared with its old path, so moving a file
53
+ reports nothing. Files that change type and files a `.gitattributes` rule
54
+ marks `-diff` or `binary` are scanned too, and line numbers do not depend on
55
+ the repository's diff settings. `--exclude`, `--max-file-size` and the default
56
+ excluded directories apply.
57
+ - Add `flare-redact init --hook`, which writes a git pre-commit hook that runs
58
+ it, preferring the project's own copy and falling back to the pinned release.
59
+ An existing hook is kept unless `--force` is given; with husky, or a hooks
60
+ folder shared outside the repository, it prints the line to add instead of
61
+ writing anything, and it never writes through a symlink. If Node is not on the PATH of the git client, the hook lets
62
+ the commit through and says so rather than block every commit.
63
+
64
+ ### Scans that do not cry wolf
65
+
66
+ - `--scan` and `--staged` leave out `generic_assignment` findings whose value
67
+ is plainly code: a variable or template (`${SECRET}`, `$DB_PASSWORD`,
68
+ `{{ secret }}`), an environment read (`process.env.TOKEN`,
69
+ `os.getenv("KEY")`, `ENV["KEY"]`), a field named like a secret
70
+ (`config.apiKey`, `user.password`), a call with no arguments, a type
71
+ (`password: string`), the variable of the same name, or a placeholder. It
72
+ does not try to understand code: from the operator to the end of the line
73
+ there must be exactly one of those forms and nothing else but closing
74
+ punctuation or a comment. A default value, a second argument, a string, a
75
+ number, or a `.env` and YAML style `DB_PASSWORD=value` keeps the finding. A
76
+ more specific finding under a dropped assignment is still reported.
77
+ `--no-code-filter` turns it off.
78
+ - Redaction is not affected. `redact()`, `scan()` from code, the detector
79
+ pack and the Python, Go and Rust engines behave exactly as in 1.8.0: an
80
+ assignment is masked whether its value is code or not.
81
+ - Exclude globs are matched with a table instead of a regular expression, so a
82
+ pattern with several `**` no longer takes unbounded time on a deep path.
83
+ - `flare-redact init /absolute/path` reads that directory.
84
+
85
+ ### Docs
86
+
87
+ - The README has no long dashes, its version and CI badges point at fresh URLs
88
+ so a cached image cannot show an old release, and a test keeps the detector
89
+ and language counts in the badges equal to what ships.
90
+ - The website playground was still running the August build, without the 1.7.0
91
+ fixes. It is rebuilt from this release, and a test now fails when the bundle
92
+ and the shipped detectors differ.
93
+
3
94
  ## 1.8.0 (2026-11-14)
4
95
 
5
96
  ### Simpler setup