-
Notifications
You must be signed in to change notification settings - Fork 255
Open
Description
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
endReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels