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-10.0.0 lib/airbrake/rack/user_filter.rb
airbrake-9.5.5 lib/airbrake/rack/user_filter.rb
airbrake-9.5.4 lib/airbrake/rack/user_filter.rb
airbrake-9.5.3 lib/airbrake/rack/user_filter.rb
airbrake-9.5.2 lib/airbrake/rack/user_filter.rb
airbrake-9.5.1 lib/airbrake/rack/user_filter.rb
airbrake-9.5.0 lib/airbrake/rack/user_filter.rb
airbrake-9.4.5 lib/airbrake/rack/user_filter.rb
airbrake-9.4.4 lib/airbrake/rack/user_filter.rb
airbrake-9.4.3 lib/airbrake/rack/user_filter.rb
airbrake-9.4.2 lib/airbrake/rack/user_filter.rb
airbrake-9.4.1 lib/airbrake/rack/user_filter.rb
airbrake-9.4.0 lib/airbrake/rack/user_filter.rb
airbrake-9.3.0 lib/airbrake/rack/user_filter.rb
airbrake-9.2.2 lib/airbrake/rack/user_filter.rb
airbrake-9.2.1 lib/airbrake/rack/user_filter.rb
airbrake-9.2.0 lib/airbrake/rack/user_filter.rb
airbrake-9.1.0 lib/airbrake/rack/user_filter.rb
airbrake-9.0.2 lib/airbrake/rack/user_filter.rb
airbrake-9.0.1 lib/airbrake/rack/user_filter.rb