feat(config): redact secret-looking fields in GlobalConfig dumps#2494
Draft
leshy wants to merge 1 commit into
Draft
feat(config): redact secret-looking fields in GlobalConfig dumps#2494leshy wants to merge 1 commit into
leshy wants to merge 1 commit into
Conversation
model_dump() and repr() now mask values of fields whose name contains "_secret" or "token", or ends in "_key" (non-None values -> "***"). Keeps secrets out of `dimos show-config` output and any logged config repr.
Codecov Report❌ Patch coverage is
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 18 files with indirect coverage changes 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
GlobalConfig.model_dump()andrepr()now redact values of fields whose name looks secret — contains_secretortoken, or ends in_key— replacing non-Nonevalues with***.This keeps secrets out of
dimos show-configoutput and any place a config is logged/repr'd. Matching is by field-name pattern, so future secret fields (or env-injected extras) are masked automatically. False positives (e.g.tokenizer) are acceptable — over-censoring is the safe direction.How to test
Also:
dimos show-configshows***for any secret-named field;Noneand non-secret fields are unchanged.Existing
dimos/core/test_global_config.pypasses;mypy dimos/core/global_config.pyclean.