Graphorin API reference v0.15.1
Graphorin API reference / @graphorin/observability / redaction/patterns / RedactionPattern
Interface: RedactionPattern
Defined in: packages/observability/src/redaction/patterns.ts:58
Stable
One entry in the redaction catalogue.
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
category | readonly | PatternCategory | - | packages/observability/src/redaction/patterns.ts:60 |
description | readonly | string | - | packages/observability/src/redaction/patterns.ts:61 |
mask? | readonly | string | Replacement string used when mode === 'mask'. | packages/observability/src/redaction/patterns.ts:64 |
name | readonly | string | - | packages/observability/src/redaction/patterns.ts:59 |
optIn? | readonly | boolean | Optional opt-in flag. When true the pattern is not active by default; operators must add it to enabledPatterns explicitly. Used by the IPv4 / IPv6 patterns because raw IPs frequently appear in non-PII log lines (host headers, debug traces, …). | packages/observability/src/redaction/patterns.ts:83 |
regex | readonly | RegExp | - | packages/observability/src/redaction/patterns.ts:62 |
verify? | readonly | (match) => boolean | Optional per-match predicate. When present, a regex hit is only treated as a real match - and masked - when this returns true for the matched substring. Every catalogue consumer honours it: the OTLP RedactionValidator, the withRedaction provider middleware (both the request scrub and the streaming response scan), and user-supplied patterns may carry their own predicate. Used by the creditcard pattern to require a valid Luhn checksum plus a major-network leading digit so look-alike digit runs (epoch-ms timestamps, order ids, serialized floats) are not corrupted. | packages/observability/src/redaction/patterns.ts:76 |