Skip to content

F6.1 — Structured-log secret redaction

State Closed
Parent E6
Iteration Release 8
Start Date 2026-10-31
Closed Date 2026-10-31
Predecessors —

Stories: 1 Closed

Story State Depends on
S6.1.2 — Build redaction in commons logging Closed (2026-10-31) —

Outcome: commons logging redacts secrets in structured events, on by default, as of 2026-10-31. Behaviour and configuration are in the rn-forge-commons logging guide (docs/guides/logging.md, Secret redaction) and redaction reference (docs/reference/logging/redaction.md). Account Portal's logging.py::redact was the prior art.

Design

No library fits: logredactor works only on formatted strings, scrubadub is a PII-in-prose cleaner with a heavy dependency tree, and pii-redact needs torch. Both exemptions to design principle 1 apply, so the module hand-rolls a few dozen lines. A key exemption such as Account Portal's *env and its fixed logger name are application policy and were not carried over.

S6.1.2 — Build redaction in commons logging

State: Closed (2026-10-31)

Acceptance:

  • tests/logging/test_redaction.py in rn-forge-commons covers every case listed under Design, and passes.
  • A use_json=True record with a secret-bearing field emits [redacted] in its output.
  • LoggingConfig(redact=False) disables the filter.
  • A comment in redaction.py names the design-principle-1 exemption.
  • The commons logging guide and its API page document redaction, and the package site builds with --strict.

Acceptance

S6.1.2 is the feature's only story, so its acceptance is the feature's. Its integration test is a host application in miniature, so no scaffolded application is needed (ADR-0008).

set -euo pipefail
cd packages/rn-forge-commons
uv run pytest -q tests/logging/test_redaction.py
uv run --group docs mkdocs build --strict