Sha256: b950d4fcd4fd69cc3ef0446f2bd313e4c4f4cb89392f01a0f9f05ea3da831409

Contents?: true

Size: 487 Bytes

Versions: 32

Compression:

Stored size: 487 Bytes

Contents

module Airbrake
  module Rack
    # Adds current user information.
    #
    # @since v8.0.1
    class UserFilter
      # @return [Integer]
      attr_reader :weight

      def initialize
        @weight = 99
      end

      # @see Airbrake::FilterChain#refine
      def call(notice)
        return unless (request = notice.stash[:rack_request])

        user = Airbrake::Rack::User.extract(request.env)
        notice[:context].merge!(user.as_json) if user
      end
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
airbrake-9.0.0 lib/airbrake/rack/user_filter.rb
airbrake-8.3.2 lib/airbrake/rack/user_filter.rb
airbrake-8.3.1 lib/airbrake/rack/user_filter.rb
airbrake-8.3.0 lib/airbrake/rack/user_filter.rb
airbrake-8.2.1 lib/airbrake/rack/user_filter.rb
airbrake-8.2.0 lib/airbrake/rack/user_filter.rb
airbrake-8.1.4 lib/airbrake/rack/user_filter.rb
airbrake-8.1.3 lib/airbrake/rack/user_filter.rb
airbrake-8.1.2 lib/airbrake/rack/user_filter.rb
airbrake-8.1.1 lib/airbrake/rack/user_filter.rb
airbrake-8.1.0 lib/airbrake/rack/user_filter.rb
airbrake-8.0.1 lib/airbrake/rack/user_filter.rb