# encoding: utf-8 module OneApm module Agent class InboundRequestMonitor attr_reader :obfuscator def initialize(events) events.subscribe(:finished_configuring) do setup_obfuscator on_finished_configuring(events) end end def setup_obfuscator @obfuscator = OneApm::Agent::Obfuscator.new(OneApm::Manager.config[:encoding_key]) end def deserialize_header(encoded_header, key) decoded_header = obfuscator.deobfuscate(encoded_header) OneApm::JSONWrapper.load(decoded_header) rescue => err OneApm::Manager.logger.debug("Failure deserializing encoded header '#{key}' in #{self.class}, #{err.class}, #{err.message}") nil end end end end