feat(configure): mask secretId/secretKey in list and get output#123
Open
Mxiansen wants to merge 1 commit into
Open
feat(configure): mask secretId/secretKey in list and get output#123Mxiansen wants to merge 1 commit into
Mxiansen wants to merge 1 commit into
Conversation
在 tccli configure list 与 tccli configure get 命令输出中对 secretId 和 secretKey 做脱敏,避免在 AI Agent 等场景直接打印凭证原文导致泄漏。 - 在 BasicConfigure 中新增 sensitive_keys 集合与 _mask_value 静态方法, 沿用项目已有 '*' + value[-4:] 的脱敏样式。 - ConfigureListCommand._run_main 输出敏感字段前套用 _mask_value, token / role-arn 等非密钥字段保持明文。 - ConfigureGetCommand._run_main 增加 from_cred 标志,仅当命中 credential 文件且字段属于 sensitive_keys 时脱敏, conf 分支与 kv 解析分支行为不变。 - 同步更新 ConfigureListCommand.EXAMPLES 与 ConfigureGetCommand.EXAMPLES, 演示脱敏后的输出形态。 - 磁盘上的 credential 文件内容保持原样,不影响后续鉴权调用。 Related TAPD: https://tapd.woa.com/tapd_fe/10161711/story/detail/1010161711135046182
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.
Related TAPD: https://tapd.woa.com/tapd_fe/10161711/story/detail/1010161711135046182
优化内容