Skip to main content

Module redact

Module redact 

Source
Expand description

导出/导入前脱敏:剥离/scrub 会话中的 PII(network body/headers、console args、url 等)。

Rust 移植自 redact.ts,供服务端 POST /sessions/import 入库前集中脱敏(P9)。客户端 SDK 仍在导出前自脱敏, 服务端 redact 是第二道闸(per-tenant scrubbers),不可逆。

仅处理 type:6 诊断信号事件;DOM 快照等不动(与 TS 侧一致)。

Structs§

RedactConfig
脱敏配置(来自 tenants.json,scrubbers 为 regex 源码字符串)。
RedactOpts
编译后的脱敏选项(scrubbers 已编译为 Regex,运行时零解析成本)。

Functions§

redact_bundle
对 bundle 就地脱敏(segments 内 type:6 信号事件 + session.url)。 改变传入 bundle,不返回新对象。