Repository navigation
feat(ui): redact configured secrets from streaming output - #508
Open
imshubham22apr-gif wants to merge 1 commit into
Open
imshubham22apr-gif wants to merge 1 commit into
imshubham22apr-gif wants to merge 1 commit into
Conversation
Signed-off-by: imshubham22apr-gif <imshubham.22apr@gmail.com>
This branch has not been deployed
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.
Summary
Adds secret redaction utilities and integrates them into
MultiTaskProgressto prevent sensitive credentials, passwords, and API keys from leaking into interactive terminal outputs and logged command streams.Problem
During preparation and run phases, subprocess commands or error outputs from child processes may print logs containing sensitive environment values, database connection credentials, or API keys (such as
sk-...LLM keys or internal auth tokens). Without redaction, these strings can be rendered directly to terminal panels or preserved in captured logs.Solution
redact_secrets(text: str, secrets_to_redact: list[str] | set[str] | None = None) -> strinoss_crs.src.utils:[REDACTED].MultiTaskProgressinoss_crs.src.ui:self.secrets_to_redact: list[str]attribute.add_output_line()to automatically redact matching secrets before storing lines or rendering them to headless/live terminal displays.oss_crs/tests/unit/test_utils.pyverifying:[REDACTED].None.CHANGELOG.mdunder[Unreleased] ### Added.Testing
uv run pytest oss_crs/tests/unit/test_utils.py -k "TestRedactSecrets"(4 passed)uv run ruff check oss_crs/tests/unit/test_utils.py oss_crs/src/ui.py oss_crs/src/utils.py(passed)uv run ruff format --check oss_crs/tests/unit/test_utils.py oss_crs/src/ui.py oss_crs/src/utils.py(passed)uv run pyright oss_crs/tests/unit/test_utils.py oss_crs/src/ui.py oss_crs/src/utils.py(0 errors)