No redaction for with values
还没有人认领这个 Issue。
评估
调研方向
首先定位命令现有的 with_redaction 路径以及 issue 中描述的 Redaction 处理方式,然后检查 options[:env] 的存储方式。当环境中标记为需要 Redaction 的值与已 redacted 的命令参数一样,始终表示为 [REDACTED] 时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Since it's common for tools to use credentials from env variables rather than inline in commands it seems generally useful to support redaction for them as well.
I accomplished that with
def with_redaction
new_args = args.map{|arg| arg.is_a?(Redaction) ? '[REDACTED]' : arg }
redacted_cmd = dup
redacted_cmd.instance_variable_set(:@args, new_args)
if (env = redacted_cmd.options[:env])
redacted_env = env.transform_values { |v| v.is_a?(SSHKit::Redaction) ? '[REDACTED]' : v }
redacted_cmd.instance_variable_set(:@options, redacted_cmd.options.merge(env: redacted_env))
end
redacted_cmd
end
- 主要语言
- Ruby
- 星标
- 1.2k
- 派生
- 257
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
capistrano/sshkit 的其他 Issue
-
难度 5/5 一周以上 新手友好度 35/100
capistrano/sshkit#563 · 6 个 reaction ·
-
难度 3/5 1-2 天 新手友好度 48/100
capistrano/sshkit#554 · 3 条评论 ·
-
难度 3/5 1-2 天 新手友好度 35/100
capistrano/sshkit#543 · 2 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 45/100
capistrano/sshkit#518 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 30/100
capistrano/sshkit#499 · 1 条评论 ·
查看 capistrano/sshkit 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
simp/pupmod-simp-simp#395 ·
-
难度 2/5 1-3 小时 新手友好度 80/100
simp/pupmod-simp-rsyslog#219 ·
-
难度 1/5 1 小时以内 新手友好度 90/100
simp/pupmod-simp-pupmod#256 ·
-
难度 1/5 1 小时以内 新手友好度 90/100
simp/pupmod-simp-sudo#150 ·
-
难度 1/5 1 小时以内 新手友好度 90/100