Sha256: 1fff9e6f22536d855fd561887ad8e9e7defb63a27d76d98e07086972ae972c01
Contents?: true
Size: 881 Bytes
Versions: 5
Compression:
Stored size: 881 Bytes
Contents
# encoding: utf-8 module OneApm module Agent module Datastore module Mongo module Obfuscator OA_WHITELIST = [:operation].freeze def self.obfuscate_statement(source, whitelist=OA_WHITELIST) obfuscated = {} source.each do |key, value| if whitelist.include?(key) obfuscated[key] = value else obfuscated[key] = obfuscate_value(value, whitelist) end end obfuscated end def self.obfuscate_value(value, whitelist) if value.is_a?(Hash) obfuscate_statement(value, whitelist) elsif value.is_a?(Array) value.map {|v| obfuscate_value(v, whitelist)} else '?' end end end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems