Sha256: 594e50e90b311430d6f1cdd3ed7a8f040f7f69a84efade1041fdb1fdbf1bb1e3

Contents?: true

Size: 766 Bytes

Versions: 3

Compression:

Stored size: 766 Bytes

Contents

# 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::Agent.config[:encoding_key])
      end

      def deserialize_header(encoded_header, key)
        decoded_header = obfuscator.deobfuscate(encoded_header)
        OneApm::JSONWrapper.load(decoded_header)
      rescue => err
        OneApm::Agent.logger.debug("Failure deserializing encoded header '#{key}' in #{self.class}, #{err.class}, #{err.message}")
        nil
      end

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
oneapm_rpm-1.1.2 lib/one_apm/agent/inbound_request_monitor.rb
oneapm_rpm-1.1.1 lib/one_apm/agent/inbound_request_monitor.rb
oneapm_rpm-1.1.0 lib/one_apm/agent/inbound_request_monitor.rb