Summary
Structured logs occasionally include objects that contain sensitive fields like wallet addresses, callback URLs, or API keys. A shared masking helper that accepts an object and a list of field names to mask should be applied before any object is written to a log.
Scope
- Add
maskFields(obj: Record<string, unknown>, fields: string[]): Record<string, unknown> helper
- Replaces the value of each named field with
[REDACTED]
- Works recursively for nested objects
- Does not mutate the original object
- Add unit tests for: top-level field masked, nested field masked, non-existent field ignored, original object unchanged
Acceptance Criteria
ETA: 12 hours
Coordinate on Telegram
Summary
Structured logs occasionally include objects that contain sensitive fields like wallet addresses, callback URLs, or API keys. A shared masking helper that accepts an object and a list of field names to mask should be applied before any object is written to a log.
Scope
maskFields(obj: Record<string, unknown>, fields: string[]): Record<string, unknown>helper[REDACTED]Acceptance Criteria
[REDACTED]ETA: 12 hours
Coordinate on Telegram