module Sidekiq::RedisConnection
def scrub(options)
def scrub(options) redacted = "REDACTED" # Deep clone so we can muck with these options all we want and exclude # params from dump-and-load that may contain objects that Marshal is # unable to safely dump. keys = options.keys - [:logger, :ssl_params, :password, :sentinel_password] scrubbed_options = Marshal.load(Marshal.dump(options.slice(*keys))) if scrubbed_options[:url] && (uri = URI.parse(scrubbed_options[:url])) && uri.password uri.password = redacted scrubbed_options[:url] = uri.to_s end scrubbed_options[:password] = redacted if options.key?(:password) scrubbed_options[:sentinel_password] = redacted if options.key?(:sentinel_password) scrubbed_options[:sentinels]&.each do |sentinel| if sentinel.is_a?(String) if (uri = URI(sentinel)) && uri.password uri.password = redacted sentinel.replace(uri.to_s) end elsif sentinel[:password] sentinel[:password] = redacted end end scrubbed_options end