class Airbrake::Filters::KeysBlocklist
@api private
@see KeysFilter
@see KeysAllowlist
# credit_card: ‘[Filtered]’ }
# email: ‘[Filtered]’,
# password: ‘[Filtered]’,
# { user: ‘John’,
# values will be filtered:
# The dashboard will display this parameter as is, but all other
})
credit_card: ‘5555555555554444’
email: ‘john@example.com’,
password: ‘s3kr3t’,
user: ‘John’
airbrake.notify(StandardError.new(‘App crashed!’), {
airbrake.add_filter(filter)
)
[:email, /credit/i, ‘password’]
filter = Airbrake::Filters::KeysBlocklist.new(
@example
list of parameters in the payload of a notice.
A default Airbrake notice filter. Filters only specific keys listed in the
def initialize(*)
def initialize(*) super @weight = -110 end
def should_filter?(key)
-
(Boolean)
- true if the key matches at least one pattern, false
def should_filter?(key) @patterns.any? do |pattern| if pattern.is_a?(Regexp) key.match(pattern) else key.to_s == pattern.to_s end end end