Skip to content

fix(logger): apply secret redaction to InMemoryRuntimeLogger entries (#265) - #274

Merged
David-patrick-chuks-02 merged 2 commits into
Lilly-Protocol:mainfrom
ghzhost:fix/in-memory-logger-redaction-265
Sep 6, 2026
Merged

fix(logger): apply secret redaction to InMemoryRuntimeLogger entries (#265)#274
David-patrick-chuks-02 merged 2 commits into
Lilly-Protocol:mainfrom
ghzhost:fix/in-memory-logger-redaction-265

Conversation

@ghzhost

@ghzhost ghzhost commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Description

Closes #265

This PR ensures sensitive keys (such as apiKey, password, token, secret, authorization, etc.) are redacted in metadata stored in InMemoryRuntimeLogger, matching the behavior of ConsoleRuntimeLogger.

Summary of changes:

  1. Added optional redactKeys?: RegExp to InMemoryRuntimeLoggerOptions.
  2. Initialized this.redactKeys with options.redactKeys ?? DEFAULT_REDACT_KEYS.
  3. Applied redactValue(metadata, this.redactKeys) within InMemoryRuntimeLogger.appendEntry before saving metadata to this.entries.
  4. Added comprehensive unit test coverage in tests/logger/redaction.test.ts covering all log levels (info, warn, debug, error), custom redactKeys pattern, and undefined metadata handling.

Validation:

  • npm run verify passed completely (format, lint, typecheck, tests, coverage).
  • All 55 test files and 229 tests pass with full coverage.

ghzhost and others added 2 commits September 3, 2026 09:14
…illy-Protocol#265)

- support optional redactKeys in InMemoryRuntimeLoggerOptions matching ConsoleRuntimeLogger
- redact sensitive keys recursively in appendEntry before storing metadata in entries
- add unit test coverage for InMemoryRuntimeLogger secret redaction across info/warn/debug/error levels and custom redactKeys
@David-patrick-chuks-02
David-patrick-chuks-02 merged commit dd9507e into Lilly-Protocol:main Sep 6, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bounty: $75] Apply secret redaction to InMemoryRuntimeLogger entries like ConsoleRuntimeLogger

3 participants