Sha256: 335b193d490e28357f1837a478f6c92a25970a4023d59d6fa58d49eedb493eaa

Contents?: true

Size: 770 Bytes

Versions: 39

Compression:

Stored size: 770 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::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

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
oneapm_rpm-1.4.2 lib/one_apm/agent/inbound_request_monitor.rb
oneapm_rpm-1.4.1 lib/one_apm/agent/inbound_request_monitor.rb
oneapm_rpm-1.4.0 lib/one_apm/agent/inbound_request_monitor.rb
oneapm_rpm-1.3.7 lib/one_apm/agent/inbound_request_monitor.rb
oneapm_rpm-1.3.7.rc1 lib/one_apm/agent/inbound_request_monitor.rb
oneapm_rpm-1.3.6 lib/one_apm/agent/inbound_request_monitor.rb
oneapm_rpm-1.3.6.rc1 lib/one_apm/agent/inbound_request_monitor.rb
oneapm_rpm-1.3.5 lib/one_apm/agent/inbound_request_monitor.rb
oneapm_rpm-1.3.5.rc1 lib/one_apm/agent/inbound_request_monitor.rb
oneapm_rpm-1.3.4 lib/one_apm/agent/inbound_request_monitor.rb
oneapm_rpm-1.3.4.rc1 lib/one_apm/agent/inbound_request_monitor.rb
oneapm_rpm-1.3.3 lib/one_apm/agent/inbound_request_monitor.rb
oneapm_rpm-1.3.3.rc1 lib/one_apm/agent/inbound_request_monitor.rb
oneapm_rpm-1.3.2 lib/one_apm/agent/inbound_request_monitor.rb
oneapm_rpm-1.3.2.rc1 lib/one_apm/agent/inbound_request_monitor.rb
oneapm_rpm-1.3.1 lib/one_apm/agent/inbound_request_monitor.rb
oneapm_rpm-1.3.1.rc1 lib/one_apm/agent/inbound_request_monitor.rb
oneapm_rpm-1.3.0 lib/one_apm/agent/inbound_request_monitor.rb
oneapm_rpm-1.3.0.rc1 lib/one_apm/agent/inbound_request_monitor.rb
oneapm_rpm-1.2.9 lib/one_apm/agent/inbound_request_monitor.rb