Class: Airbrake::Filters::KeysAllowlist
- Inherits:
-
Object
- Object
- Airbrake::Filters::KeysAllowlist
- Includes:
- KeysFilter
- Defined in:
- lib/airbrake-ruby/filters/keys_allowlist.rb
Overview
A default Airbrake notice filter. Filters everything in the payload of a notice, but specified keys.
Constant Summary
Constants included from KeysFilter
Airbrake::Filters::KeysFilter::FILTERABLE_CONTEXT_KEYS, Airbrake::Filters::KeysFilter::FILTERABLE_KEYS, Airbrake::Filters::KeysFilter::FILTERED, Airbrake::Filters::KeysFilter::VALID_PATTERN_CLASSES
Instance Attribute Summary
Attributes included from KeysFilter
Instance Method Summary collapse
-
#initialize ⇒ KeysAllowlist
constructor
A new instance of KeysAllowlist.
-
#should_filter?(key) ⇒ Boolean
True if the key doesn’t match any pattern, false otherwise.
Methods included from KeysFilter
Methods included from Loggable
Constructor Details
#initialize ⇒ KeysAllowlist
Returns a new instance of KeysAllowlist.
30 31 32 33 |
# File 'lib/airbrake-ruby/filters/keys_allowlist.rb', line 30 def initialize(*) super @weight = -100 end |
Instance Method Details
#should_filter?(key) ⇒ Boolean
Returns true if the key doesn’t match any pattern, false otherwise.
37 38 39 40 41 42 43 44 45 |
# File 'lib/airbrake-ruby/filters/keys_allowlist.rb', line 37 def should_filter?(key) @patterns.none? do |pattern| if pattern.is_a?(Regexp) key.match(pattern) else key.to_s == pattern.to_s end end end |