Class: Rollbar::Scrubbers::Params

Inherits:
Object
  • Object
show all
Defined in:
lib/rollbar/scrubbers/params.rb

Overview

This class contains the logic to scrub the received parameters. It will scrub the parameters matching Rollbar.configuration.scrub_fields Array. Also, if that configuration option is set to :scrub_all, it will scrub all received parameters. It will not scrub anything that is in the scrub_whitelist configuration array even if :scrub_all is true.

Constant Summary collapse

SKIPPED_CLASSES =
[::Tempfile].freeze
ATTACHMENT_CLASSES =
%w[ActionDispatch::Http::UploadedFile
Rack::Multipart::UploadedFile].freeze
SCRUB_ALL =
:scrub_all

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.call(*args) ⇒ Object



17
18
19
# File 'lib/rollbar/scrubbers/params.rb', line 17

def self.call(*args)
  new.call(*args)
end

Instance Method Details

#call(options = {}) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/rollbar/scrubbers/params.rb', line 21

def call(options = {})
  params = options[:params]
  return {} unless params

  @scrubbed_objects = {}.compare_by_identity

  config = options[:config]
  extra_fields = options[:extra_fields]
  whitelist = options[:whitelist] || []

  scrub(params, build_scrub_options(config, extra_fields, whitelist))
end