lib/new_relic/agent/datastores/mongo/obfuscator.rb in newrelic_rpm-6.7.0.359 vs lib/new_relic/agent/datastores/mongo/obfuscator.rb in newrelic_rpm-6.8.0.360

- old
+ new

@@ -6,34 +6,34 @@ module Agent module Datastores module Mongo module Obfuscator - WHITELIST = [:operation].freeze + ALLOWLIST = [:operation].freeze - def self.obfuscate_statement(source, whitelist = WHITELIST) + def self.obfuscate_statement(source, allowlist = ALLOWLIST) if source.is_a? Hash obfuscated = {} source.each do |key, value| - if whitelist.include?(key) + if allowlist.include?(key) obfuscated[key] = value else - obfuscated[key] = obfuscate_value(value, whitelist) + obfuscated[key] = obfuscate_value(value, allowlist) end end obfuscated else - obfuscate_value(source, whitelist) + obfuscate_value(source, allowlist) end end QUESTION_MARK = '?'.freeze - def self.obfuscate_value(value, whitelist = WHITELIST) + def self.obfuscate_value(value, allowlist = ALLOWLIST) if value.is_a?(Hash) - obfuscate_statement(value, whitelist) + obfuscate_statement(value, allowlist) elsif value.is_a?(Array) - value.map {|v| obfuscate_value(v, whitelist)} + value.map {|v| obfuscate_value(v, allowlist)} else QUESTION_MARK end end end