hoptoad_notifier 2.3.0 → 2.3.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,18 @@
1
+ Version 2.3.2 - 2010-07-06
2
+ ===============================================================================
3
+
4
+ Josh Clayton(1):
5
+ Handle instances when Rack's action_dispach.parameter_filter is nil
6
+
7
+
8
+ Version 2.3.1 - 2010-07-02
9
+ ===============================================================================
10
+
11
+ Jason Morrison (2):
12
+ Use the Rails 3 params filters when available
13
+ Filter session hash using Hoptoad config.params_filters, in addition to params
14
+
15
+
1
16
  Version 2.3.0 - 2010-06-24
2
17
  ===============================================================================
3
18
 
@@ -159,3 +174,4 @@ Nick Quaranto (3):
159
174
 
160
175
 
161
176
 
177
+
data/README.rdoc CHANGED
@@ -342,7 +342,7 @@ To replace sensitive information sent to the Hoptoad service with [FILTERED] use
342
342
  end
343
343
 
344
344
  Note that, when rescuing exceptions within an ActionController method,
345
- hoptoad_notifier will reuse filters specified by #filter_params_logging.
345
+ hoptoad_notifier will reuse filters specified by #filter_parameter_logging.
346
346
 
347
347
  == Testing
348
348
 
@@ -95,6 +95,7 @@ module HoptoadNotifier
95
95
  "#{exception.class.name}: #{exception.message}"
96
96
  end
97
97
 
98
+ also_use_rack_params_filters
98
99
  find_session_data
99
100
  clean_params
100
101
  end
@@ -249,6 +250,7 @@ module HoptoadNotifier
249
250
  end
250
251
  if session_data
251
252
  clean_unserializable_data_from(:session_data)
253
+ filter(session_data)
252
254
  end
253
255
  end
254
256
 
@@ -266,7 +268,7 @@ module HoptoadNotifier
266
268
 
267
269
  def filter_key?(key)
268
270
  params_filters.any? do |filter|
269
- key.to_s.include?(filter)
271
+ key.to_s.include?(filter.to_s)
270
272
  end
271
273
  end
272
274
 
@@ -314,5 +316,12 @@ module HoptoadNotifier
314
316
  def rack_session
315
317
  args[:rack_env]['rack.session'] if args[:rack_env]
316
318
  end
319
+
320
+ def also_use_rack_params_filters
321
+ if args[:rack_env]
322
+ self.params_filters += rack_request.env["action_dispatch.parameter_filter"] || []
323
+ end
324
+ end
325
+
317
326
  end
318
327
  end
@@ -19,7 +19,7 @@ module HoptoadNotifier
19
19
 
20
20
  def hoptoad_request_data
21
21
  { :parameters => hoptoad_filter_if_filtering(params.to_hash),
22
- :session_data => hoptoad_session_data,
22
+ :session_data => hoptoad_filter_if_filtering(hoptoad_session_data),
23
23
  :controller => params[:controller],
24
24
  :action => params[:action],
25
25
  :url => hoptoad_request_url,
@@ -27,6 +27,8 @@ module HoptoadNotifier
27
27
  end
28
28
 
29
29
  def hoptoad_filter_if_filtering(hash)
30
+ return hash if ! hash.is_a?(Hash)
31
+
30
32
  if respond_to?(:filter_parameters)
31
33
  filter_parameters(hash) rescue hash
32
34
  else
@@ -1,3 +1,3 @@
1
1
  module HoptoadNotifier
2
- VERSION = "2.3.0".freeze
2
+ VERSION = "2.3.2".freeze
3
3
  end
data/test/catcher_test.rb CHANGED
@@ -239,10 +239,12 @@ class ActionControllerCatcherTest < Test::Unit::TestCase
239
239
  assert_sent_request_info_for controller.request
240
240
  end
241
241
 
242
- should "use standard rails logging filters on params and env" do
242
+ should "use standard rails logging filters on params and session and env" do
243
243
  filtered_params = { "abc" => "123",
244
244
  "def" => "456",
245
245
  "ghi" => "[FILTERED]" }
246
+ filtered_session = { "abc" => "123",
247
+ "ghi" => "[FILTERED]" }
246
248
  ENV['ghi'] = 'abc'
247
249
  filtered_env = { 'ghi' => '[FILTERED]' }
248
250
  filtered_cgi = { 'REQUEST_METHOD' => '[FILTERED]' }
@@ -250,9 +252,12 @@ class ActionControllerCatcherTest < Test::Unit::TestCase
250
252
  process_action_with_automatic_notification(:filters => [:ghi, :request_method],
251
253
  :params => { "abc" => "123",
252
254
  "def" => "456",
253
- "ghi" => "789" })
255
+ "ghi" => "789" },
256
+ :session => { "abc" => "123",
257
+ "ghi" => "789" })
254
258
  assert_sent_hash filtered_params, '/notice/request/params'
255
259
  assert_sent_hash filtered_cgi, '/notice/request/cgi-data'
260
+ assert_sent_hash filtered_session, '/notice/request/session'
256
261
  end
257
262
 
258
263
  context "for a local error with development lookup enabled" do
data/test/notice_test.rb CHANGED
@@ -164,6 +164,10 @@ class NoticeTest < Test::Unit::TestCase
164
164
  assert_filters_hash(:cgi_data)
165
165
  end
166
166
 
167
+ should "filter session" do
168
+ assert_filters_hash(:session_data)
169
+ end
170
+
167
171
  context "a Notice turned into XML" do
168
172
  setup do
169
173
  HoptoadNotifier.configure do |config|
@@ -423,7 +427,7 @@ class NoticeTest < Test::Unit::TestCase
423
427
  end
424
428
 
425
429
  def assert_filters_hash(attribute)
426
- filters = %w(abc def)
430
+ filters = ["abc", :def]
427
431
  original = { 'abc' => "123", 'def' => "456", 'ghi' => "789", 'nested' => { 'abc' => '100' } }
428
432
  filtered = { 'abc' => "[FILTERED]",
429
433
  'def' => "[FILTERED]",
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hoptoad_notifier
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 7
4
5
  prerelease: false
5
6
  segments:
6
7
  - 2
7
8
  - 3
8
- - 0
9
- version: 2.3.0
9
+ - 2
10
+ version: 2.3.2
10
11
  platform: ruby
11
12
  authors:
12
13
  - thoughtbot, inc
@@ -14,16 +15,18 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2010-06-24 00:00:00 -04:00
18
+ date: 2010-07-06 00:00:00 -04:00
18
19
  default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
22
  name: activesupport
22
23
  prerelease: false
23
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
24
26
  requirements:
25
27
  - - ">="
26
28
  - !ruby/object:Gem::Version
29
+ hash: 3
27
30
  segments:
28
31
  - 0
29
32
  version: "0"
@@ -33,9 +36,11 @@ dependencies:
33
36
  name: activerecord
34
37
  prerelease: false
35
38
  requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
36
40
  requirements:
37
41
  - - ">="
38
42
  - !ruby/object:Gem::Version
43
+ hash: 3
39
44
  segments:
40
45
  - 0
41
46
  version: "0"
@@ -45,9 +50,11 @@ dependencies:
45
50
  name: actionpack
46
51
  prerelease: false
47
52
  requirement: &id003 !ruby/object:Gem::Requirement
53
+ none: false
48
54
  requirements:
49
55
  - - ">="
50
56
  - !ruby/object:Gem::Version
57
+ hash: 3
51
58
  segments:
52
59
  - 0
53
60
  version: "0"
@@ -57,9 +64,11 @@ dependencies:
57
64
  name: jferris-mocha
58
65
  prerelease: false
59
66
  requirement: &id004 !ruby/object:Gem::Requirement
67
+ none: false
60
68
  requirements:
61
69
  - - ">="
62
70
  - !ruby/object:Gem::Version
71
+ hash: 3
63
72
  segments:
64
73
  - 0
65
74
  version: "0"
@@ -69,9 +78,11 @@ dependencies:
69
78
  name: nokogiri
70
79
  prerelease: false
71
80
  requirement: &id005 !ruby/object:Gem::Requirement
81
+ none: false
72
82
  requirements:
73
83
  - - ">="
74
84
  - !ruby/object:Gem::Version
85
+ hash: 3
75
86
  segments:
76
87
  - 0
77
88
  version: "0"
@@ -81,9 +92,11 @@ dependencies:
81
92
  name: shoulda
82
93
  prerelease: false
83
94
  requirement: &id006 !ruby/object:Gem::Requirement
95
+ none: false
84
96
  requirements:
85
97
  - - ">="
86
98
  - !ruby/object:Gem::Version
99
+ hash: 3
87
100
  segments:
88
101
  - 0
89
102
  version: "0"
@@ -154,23 +167,27 @@ rdoc_options:
154
167
  require_paths:
155
168
  - lib
156
169
  required_ruby_version: !ruby/object:Gem::Requirement
170
+ none: false
157
171
  requirements:
158
172
  - - ">="
159
173
  - !ruby/object:Gem::Version
174
+ hash: 3
160
175
  segments:
161
176
  - 0
162
177
  version: "0"
163
178
  required_rubygems_version: !ruby/object:Gem::Requirement
179
+ none: false
164
180
  requirements:
165
181
  - - ">="
166
182
  - !ruby/object:Gem::Version
183
+ hash: 3
167
184
  segments:
168
185
  - 0
169
186
  version: "0"
170
187
  requirements: []
171
188
 
172
189
  rubyforge_project:
173
- rubygems_version: 1.3.6
190
+ rubygems_version: 1.3.7
174
191
  signing_key:
175
192
  specification_version: 3
176
193
  summary: Send your application errors to our hosted service and reclaim your inbox.