@redact-secret/adapter-otel-trace 0.1.3 → 0.1.4

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
@@ -25,6 +25,18 @@ version numbers start again here, at `0.1.0`, and do not follow the old name's.
25
25
 
26
26
  ## [Unreleased]
27
27
 
28
+ ## [0.1.4] - 2026-10-07
29
+
30
+ ### Changed
31
+
32
+ - Requires `@redact-secret/adapter` `^0.1.9` (was `^0.1.7`) for `actionPolicy`, `scanConfigOf` and the scan-config conflict contract. Backed by the live tests of this package and CI's `published-combination` job.
33
+ - Verified against `@redact-secret/core` 0.1.0-beta.14. The declared core range is unchanged.
34
+ - `createRedactingSpanProcessor`: an injected `scanConfig` beside any loose scan option (`policy`, `actionPolicy`, `scanLimits`, `ruleset`, `placeholderFormatter`) is rejected with a fixed `TypeError` before the core is loaded, instead of the config silently winning; the injected configuration is the one verified against the core (redact-secret-adapters#213). Needs `@redact-secret/adapter` with `scanConfigOf`. Test: `test/injected-scan-config-live.test.ts`.
35
+
36
+ ### Added
37
+
38
+ - `actionPolicy` on `createRedactingSpanProcessor`, applied to every string of a span (name, attributes, events, links), with the shared snapshot, callback-conflict and capability checks of `@redact-secret/adapter` (redact-secret-adapters#217). Needs `@redact-secret/core` 0.1.0-beta.14 or later (the first published release that accepts it); an older core is rejected by name with `CoreOptionsError` (`CORE_OPTION_UNSUPPORTED`) and every other option keeps working on the declared floor. The package range is unchanged; the new tests in `compatibility.json` run at both endpoints (the option applies at the upper one, is rejected at the lower one). Test: `test/action-policy-live.test.ts` (the exported span for each action).
39
+
28
40
  ## [0.1.3] - 2026-10-03
29
41
  ### Changed
30
42
 
package/README.md CHANGED
@@ -117,7 +117,7 @@ assertion is not optional.
117
117
  ## Options
118
118
 
119
119
  ```js
120
- await createRedactingSpanProcessor(next, { pii, onOutcome, policy, maxStringLength, operationLimits, scanLimits, ruleset, placeholderFormatter });
120
+ await createRedactingSpanProcessor(next, { pii, onOutcome, policy, maxStringLength, operationLimits, scanLimits, ruleset, placeholderFormatter, actionPolicy });
121
121
  ```
122
122
 
123
123
  | Option | What it does |
@@ -128,6 +128,7 @@ await createRedactingSpanProcessor(next, { pii, onOutcome, policy, maxStringLeng
128
128
  | `scanLimits` | The core's whole-input limits, `{ maxInputBytes, maxFindings }`, for every scan. See [Core scan options](https://github.com/redact-secret/redact-secret-adapters/tree/main/packages/adapter#core-scan-options) |
129
129
  | `ruleset` | A declarative detector ruleset (text or bytes) |
130
130
  | `placeholderFormatter` | The core's placeholder formatter |
131
+ | `actionPolicy` | The core's declarative action policy (object, JSON text or bytes), for every string of a span. Mutually exclusive with `policy`; needs core `0.1.0-beta.14` or later, else construction rejects with `CoreOptionsError`. See [Declarative `actionPolicy`](https://github.com/redact-secret/redact-secret-adapters/tree/main/packages/adapter#declarative-actionpolicy) |
131
132
  | `maxStringLength` | Strings longer than this become `[REDACTED:LIMIT_EXCEEDED]` unscanned |
132
133
  | `operationLimits` | Override the aggregate budget of **one span**. See below |
133
134
 
package/dist/index.js CHANGED
@@ -27,7 +27,7 @@
27
27
  * PII off. See `@redact-secret/adapter`'s `activateCore` for the whole rule,
28
28
  * including why activation is not the same as masking every PII value.
29
29
  */
30
- import { activateCore, resolveScanConfig, verifyScanOptions } from "@redact-secret/adapter";
30
+ import { activateCore, scanConfigOf, verifyScanOptions } from "@redact-secret/adapter";
31
31
  import { RedactingSpanProcessorWith } from "./span-processor.js";
32
32
  export { RedactingSpanProcessorWith, redactAttributesWith, } from "./span-processor.js";
33
33
  /**
@@ -46,7 +46,7 @@ export async function createRedactingSpanProcessor(next, options = {}) {
46
46
  const activation = options.pii === undefined ? {} : { pii: options.pii };
47
47
  // Validated before the core is touched; then the installed core must honor
48
48
  // any requested scan option or this rejects with a fixed `CoreOptionsError`.
49
- const config = resolveScanConfig(options);
49
+ const config = scanConfigOf(options);
50
50
  const loaded = await import("@redact-secret/core");
51
51
  await activateCore(loaded, activation);
52
52
  verifyScanOptions(loaded, config);
@@ -25,7 +25,7 @@
25
25
  * wrapping one needs no dependency, and this module is testable with a
26
26
  * plain object.
27
27
  */
28
- import { countLeaf, createOperationBudget, createOutcomeCounter, ERROR_MARKER, LIMIT_MARKER, maskLeafOutcomeWith, notify, resolveScanConfig, toValueCounts, } from "@redact-secret/adapter";
28
+ import { bindScanConfig, countLeaf, createOperationBudget, createOutcomeCounter, ERROR_MARKER, LIMIT_MARKER, maskLeafOutcomeWith, notify, toValueCounts, } from "@redact-secret/adapter";
29
29
  /** A span field that did not take a masked write. The message names the field, never its value. */
30
30
  class UnredactableFieldError extends Error {
31
31
  }
@@ -106,7 +106,7 @@ function redactBag(mask, budget, bag, field) {
106
106
  export function redactAttributesWith(scanAndRedact, attributes, options = {}) {
107
107
  const { operationLimits, ...leafOptions } = options;
108
108
  const budget = createOperationBudget(operationLimits);
109
- const resolved = { ...leafOptions, scanConfig: leafOptions.scanConfig ?? resolveScanConfig(leafOptions) };
109
+ const resolved = bindScanConfig(leafOptions);
110
110
  try {
111
111
  redactBag(maskerFor(scanAndRedact, resolved, () => ({ counter: undefined, budget })), budget, attributes, "attributes");
112
112
  }
@@ -167,7 +167,7 @@ export class RedactingSpanProcessorWith {
167
167
  // Validated and snapshotted once, here: a malformed scan option is a
168
168
  // programming error at construction, and every leaf is scanned with the
169
169
  // one snapshot.
170
- const maskOptions = { ...rawOptions, scanConfig: rawOptions.scanConfig ?? resolveScanConfig(rawOptions) };
170
+ const maskOptions = bindScanConfig(rawOptions);
171
171
  if (onOutcome !== undefined && typeof onOutcome !== "function") {
172
172
  throw new TypeError("RedactingSpanProcessorWith: onOutcome must be a function");
173
173
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redact-secret/adapter-otel-trace",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "A redacting OpenTelemetry JS SpanProcessor (traces only) over the Redact Secret core.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -35,7 +35,7 @@
35
35
  "typecheck": "tsc -p tsconfig.json --noEmit"
36
36
  },
37
37
  "dependencies": {
38
- "@redact-secret/adapter": "^0.1.7"
38
+ "@redact-secret/adapter": "^0.1.9"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "@opentelemetry/sdk-trace-base": "^2.0.0",