airbrake 4.3.2 → 4.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a9cbcc7af3d4f64af905ebac59cf09f65d8479d8
4
- data.tar.gz: 854302ffe9b41145615d10bf6ee677b916efd239
3
+ metadata.gz: 44a934004ed694e6b4c9b0c210e026646106e436
4
+ data.tar.gz: e3f294e32503a5dad98e440069f3a61a0311f0d4
5
5
  SHA512:
6
- metadata.gz: 0145fe2c505bdc19edb661c7c8fcb350f3cd229f472ed0eba4152dc9f98fccd31db1637e6c4c0c76b818706f7e648aa72a0d0b7889f3de2a7c90bd8ad696cb0b
7
- data.tar.gz: 4f516bbcf921d6065c7e2f608246538b427486625bd7ed6c81e70c042317fc0e819762bc0b64c507303858f8ff37c112d2d0cecffb5bda5fa1e276b89531a084
6
+ metadata.gz: c3bbe64f8da080d243f96e25ffa94fa8bff057b610f3cd39fa95a659e8ca251af01483c8cd0332fdb27af4de5aacdd2bde484ae33d8c1257d414c5c00610882d
7
+ data.tar.gz: 855f6eee69fdf83c3bc0368b3725961ecb990bfb988843fbcb9c24a3c8b6cb15d788cc1b634bc4e8041e05983adc0686c79feb73da3a6899e259c34fb2ca3ba5
data/CHANGELOG CHANGED
@@ -1,3 +1,17 @@
1
+ Version 4.3.3 - 2015-10-20 19:33:27 -0500
2
+ ===============================================================================
3
+
4
+ Daniel Loy (1):
5
+ don't break `clean_params` when processing nested array (as seen in action_dispatch.cookies from cgi-data)
6
+
7
+ Joe Van Dyk (1):
8
+ Add way to ignore all the exceptions
9
+
10
+ Kyrylo Silin (2):
11
+ Merge pull request #432 from loybert/fix/dont-break-when-filtering-arrays-of-arrays
12
+ Merge pull request #433 from Tanga/ignore_exceptions
13
+
14
+
1
15
  Version 4.3.2 - 2015-10-16 21:24:49 -0500
2
16
  ===============================================================================
3
17
 
@@ -1642,5 +1656,6 @@ Nick Quaranto (3):
1642
1656
 
1643
1657
 
1644
1658
 
1659
+
1645
1660
 
1646
1661
 
@@ -172,9 +172,11 @@ module Airbrake
172
172
  end
173
173
 
174
174
  def build_notice_for(exception, opts = {})
175
+ exception_classes = [exception.class.to_s]
175
176
  exception = unwrap_exception(exception)
176
177
  opts = opts.merge(:exception => exception) if exception.is_a?(Exception)
177
178
  opts = opts.merge(exception.to_hash) if exception.respond_to?(:to_hash)
179
+ opts = opts.merge(exception_classes: exception_classes)
178
180
  Notice.new(configuration.merge(opts))
179
181
  end
180
182
 
@@ -94,6 +94,9 @@ module Airbrake
94
94
  # Instance that's used for cleaning out data that should be filtered out, should respond to #clean
95
95
  attr_accessor :cleaner
96
96
 
97
+ # An array of the exception classes for this error (including wrapped ones)
98
+ attr_reader :exception_classes
99
+
97
100
  public
98
101
 
99
102
  def initialize(args)
@@ -102,7 +105,6 @@ module Airbrake
102
105
  @api_key = args[:api_key]
103
106
  @project_root = args[:project_root]
104
107
  @url = args[:url] || rack_env(:url)
105
-
106
108
  @notifier_name = args[:notifier_name]
107
109
  @notifier_version = args[:notifier_version]
108
110
  @notifier_url = args[:notifier_url]
@@ -131,6 +133,14 @@ module Airbrake
131
133
  @hostname = local_hostname
132
134
  @user = args[:user] || {}
133
135
 
136
+ @exception_classes= Array(args[:exception_classes])
137
+ if @exception
138
+ @exception_classes << @exception.class
139
+ end
140
+ if @error_class
141
+ @exception_classes << @error_class
142
+ end
143
+
134
144
 
135
145
  also_use_rack_params_filters
136
146
  find_session_data
@@ -251,8 +261,13 @@ module Airbrake
251
261
 
252
262
  # Determines if this notice should be ignored
253
263
  def ignore?
254
- ignored_class_names.include?(error_class) ||
255
- ignore_by_filters.any? {|filter| filter.call(self) }
264
+ exception_classes.each do |klass|
265
+ if ignored_class_names.include?(klass)
266
+ return true
267
+ end
268
+ end
269
+
270
+ ignore_by_filters.any? {|filter| filter.call(self) }
256
271
  end
257
272
 
258
273
  # Allows properties to be accessed using a hash-like syntax
@@ -98,7 +98,7 @@ module Airbrake
98
98
 
99
99
  def filter(hash)
100
100
  hash.each do |key, value|
101
- if filter_key?(key)
101
+ if hash.is_a?(Hash) && filter_key?(key)
102
102
  hash[key] = "[FILTERED]"
103
103
  elsif value.respond_to?(:to_hash)
104
104
  filter(hash[key])
@@ -1,3 +1,3 @@
1
1
  module Airbrake
2
- VERSION = "4.3.2".freeze
2
+ VERSION = "4.3.3".freeze
3
3
  end
@@ -366,6 +366,13 @@ class NoticeTest < Test::Unit::TestCase
366
366
  assert !notice.ignore?
367
367
  end
368
368
 
369
+ should "ignore an wrapped exception matching ignore filters" do
370
+ notice = build_notice(error_class: "NotIgnored",
371
+ exception_classes: ["Ignored", "NotIgnored"],
372
+ ignore: ["Ignored"])
373
+ assert notice.ignore?
374
+ end
375
+
369
376
  should "ignore an exception with a matching error class" do
370
377
  notice = build_notice(:error_class => 'ArgumentError',
371
378
  :ignore => [ArgumentError])
@@ -190,4 +190,15 @@ class ParamsCleanerTest < Test::Unit::TestCase
190
190
  assert_match(/\A#<(Temp)?[Ff]ile:0x.+>\z/, clean_params.parameters[:files][0])
191
191
  assert_match(/\A#<IO:0x.+>\z/, clean_params.parameters[:files][1])
192
192
  end
193
+
194
+ should "not break on filtering multi-dimensional array as possible in action_dispatch.cookies" do
195
+ original = { 'cgi_cookies_to_filter' => [['any_cookie_key', 'some_cookie_value'], ['secret', 'some_secret_value']] }
196
+ clean_params = clean(:params_filters => [:secret],
197
+ :params_whitelist_filters => [:secret],
198
+ :parameters => original)
199
+ assert_nothing_raised do
200
+ clean_params.send(:parameters)
201
+ end
202
+ end
203
+
193
204
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: airbrake
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.3.2
4
+ version: 4.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Airbrake
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-17 00:00:00.000000000 Z
11
+ date: 2015-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: builder