Skip to content

fix(cli): redact nested secrets and ignore prototype keys in config get - #415

Open
Pybsama wants to merge 1 commit into
AVIDS2:mainfrom
Pybsama:fix/config-get-redact-objects
Open

Pybsama wants to merge 1 commit into
AVIDS2:mainfrom
Pybsama:fix/config-get-redact-objects

Conversation

@Pybsama

@Pybsama Pybsama commented Nov 30, 2026

Copy link
Copy Markdown

Summary

  • Fix memorix config get <section> (src/cli/commands/config-get.ts) so reading a parent config object (such as embedding or agent) recursively redacts sensitive fields (apiKey, api_key, key, token, secret, password, passwd, pwd) and numeric/boolean secret values instead of serializing them unredacted via JSON.stringify.
  • Replace in checks with Object.hasOwn in readDotted so prototype keys (such as embedding.toString or constructor) report not set instead of resolving to Object.prototype properties.
  • Add regression test in tests/cli/config-command.test.ts verifying parent-section redaction (config get embedding) and prototype key rejection (config get embedding.toString).

Verification

  • npx vitest run tests/cli/config-command.test.ts — 1 passed (9 tests)
  • npm run lint (tsc --noEmit) — passed
  • npm run build (build:workspaces, build:runtime, build:cli, build:memcode) — passed
  • npx vitest run tests/cli/ — 44 test files passed (334 tests)

AI disclosure: Assisted by an AI coding agent during bug analysis, implementation, and test verification.

Signed-off-by: sama Pyb <peiyibopybsama@gmail.com>
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.

1 participant