]> git.99rst.org Git - sgasser-llm-shield.git/commit
Consolidate masking restoration into shared helpers (#124)
authorStefan Gasser <redacted>
Sun, 28 Jun 2026 18:41:49 +0000 (20:41 +0200)
committerGitHub <redacted>
Sun, 28 Jun 2026 18:41:49 +0000 (20:41 +0200)
commitc191a9e90f498ffbfe34f031cd20be54133d1046
tree9b8974968da957567fb42e0405cb32fae897735e
parent90be3f4758928bc4304c5eada7f7c89cb396ae6e
Consolidate masking restoration into shared helpers (#124)

* Add shared restoration helpers

* Share stream restoration across providers

* Extract request privacy pipeline

* Remove deferred TODO note

* Remove dead unmask wrappers after restoration refactor

pii/mask and secrets/mask no longer re-export unmask/stream/flush/response
wrappers; callers go through the shared StreamRestorer and restoreResponse.
Drop the unused unmask re-export from masking/service and the restoreText helper.

Simplify processPrivacyPipeline to derive PII masking from config.mode and
drop the unused originalRequest/piiMasked result fields and the maskPII option.
22 files changed:
src/masking/restore-policy.test.ts [new file with mode: 0644]
src/masking/restore-policy.ts [new file with mode: 0644]
src/masking/restorer.test.ts [new file with mode: 0644]
src/masking/restorer.ts [new file with mode: 0644]
src/masking/service.ts
src/masking/stream-restorer.test.ts [new file with mode: 0644]
src/masking/stream-restorer.ts [new file with mode: 0644]
src/pii/mask.test.ts
src/pii/mask.ts
src/providers/anthropic/stream-transformer.ts
src/providers/codex/stream-transformer.test.ts [new file with mode: 0644]
src/providers/codex/stream-transformer.ts [new file with mode: 0644]
src/providers/openai/stream-transformer.ts
src/routes/anthropic.ts
src/routes/codex.ts
src/routes/openai.ts
src/secrets/mask.test.ts
src/secrets/mask.ts
src/services/log-content.test.ts
src/services/log-content.ts
src/services/privacy-pipeline.test.ts [new file with mode: 0644]
src/services/privacy-pipeline.ts [new file with mode: 0644]
git clone https://git.99rst.org/PROJECT