honeybadger 5.15.3 → 5.15.5

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
  SHA256:
3
- metadata.gz: 69b84047612b956b73078affe506c2d6e0002b7960b915be89c996add8c845a3
4
- data.tar.gz: ff6a0f6cd8cbf4854e7362999ab5e4734c9a959d483ced78f66c4fd1c444e1b4
3
+ metadata.gz: a312d3eb74eb5dd3df188d020d902df8549085ec88f3b95be2ee1ac478ccf567
4
+ data.tar.gz: 9584f4e9f46d62de688926c9b96ae3006046372271f6a0aa6b43e18b388754da
5
5
  SHA512:
6
- metadata.gz: 70aa645ac2e7deb9b94f055e41e0e9407eb9972089f9ecc33d5d58b2bb43c289d6255e67e005a51e83fe7e7a59ffdb45ec1010c200bfd5d3e731c9109d4b9928
7
- data.tar.gz: 0b1715ede2a528ccdb0e1344b31909139b860580911ff8580a54bf1ad4cc94e5a7b9168e2076ac9b371a2053a7e0cf09edc6adab50fb72e63a7173ef5dba046e
6
+ metadata.gz: 0db6ef010ed9a83447e800115fb5cec27cbac4e546e832f238d9d8c54efaca88bec487edba28c13c6f82eb916f7db16e72be6d12377b031c1ae28713e288f47a
7
+ data.tar.gz: bce986b69ced50262440748cbcea4954a8103fd283960bafc32e74f7d4c45e0252f2a3b1af193a8cda8663fef898ab20afb4b47ef19fef896aba3d7036acd471
data/CHANGELOG.md CHANGED
@@ -1,6 +1,20 @@
1
1
  # Change Log
2
2
 
3
3
 
4
+ ## [5.15.5](https://github.com/honeybadger-io/honeybadger-ruby/compare/v5.15.4...v5.15.5) (2024-07-30)
5
+
6
+
7
+ ### Bug Fixes
8
+
9
+ * sanitize event payload data ([#602](https://github.com/honeybadger-io/honeybadger-ruby/issues/602)) ([f307212](https://github.com/honeybadger-io/honeybadger-ruby/commit/f307212cf9a3df43b8bacff1474c2f674ff3f1a3))
10
+
11
+ ## [5.15.4](https://github.com/honeybadger-io/honeybadger-ruby/compare/v5.15.3...v5.15.4) (2024-07-29)
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * add back key for cache notification payloads ([#600](https://github.com/honeybadger-io/honeybadger-ruby/issues/600)) ([9779dd4](https://github.com/honeybadger-io/honeybadger-ruby/commit/9779dd4664a057bdb65a9144612f29c569ac4da5))
17
+
4
18
  ## [5.15.3](https://github.com/honeybadger-io/honeybadger-ruby/compare/v5.15.2...v5.15.3) (2024-07-25)
5
19
 
6
20
 
@@ -1,5 +1,7 @@
1
1
  require 'forwardable'
2
2
 
3
+ require 'honeybadger/util/sanitizer'
4
+
3
5
  module Honeybadger
4
6
  class Event
5
7
  extend Forwardable
@@ -47,10 +49,11 @@ module Honeybadger
47
49
  #
48
50
  # @return [Hash] JSON representation of the event.
49
51
  def as_json(*args)
50
- payload.tap do |p|
52
+ data = payload.tap do |p|
51
53
  p[:ts] = ts
52
54
  p[:event_type] = event_type if event_type
53
55
  end
56
+ Util::Sanitizer.sanitize(data)
54
57
  end
55
58
  end
56
59
  end
@@ -41,13 +41,33 @@ module Honeybadger
41
41
 
42
42
  class ActionControllerCacheSubscriber < NotificationSubscriber
43
43
  def format_payload(payload)
44
- payload.except(:key)
44
+ payload[:key] = ::ActiveSupport::Cache.expand_cache_key(payload[:key]) if payload[:key]
45
+ payload
45
46
  end
46
47
  end
47
48
 
48
49
  class ActiveSupportCacheSubscriber < NotificationSubscriber
49
50
  def format_payload(payload)
50
- payload.except(:key)
51
+ payload[:key] = ::ActiveSupport::Cache.expand_cache_key(payload[:key]) if payload[:key]
52
+ payload
53
+ end
54
+ end
55
+
56
+ class ActiveSupportCacheMultiSubscriber < NotificationSubscriber
57
+ def format_payload(payload)
58
+ payload[:key] = expand_cache_keys_from_payload(payload[:key])
59
+ payload[:hits] = expand_cache_keys_from_payload(payload[:hits])
60
+ payload
61
+ end
62
+
63
+ def expand_cache_keys_from_payload(data)
64
+ return unless data
65
+
66
+ data = data.keys if data.is_a?(Hash)
67
+
68
+ Array(data).map do |k|
69
+ ::ActiveSupport::Cache.expand_cache_key(k)
70
+ end
51
71
  end
52
72
  end
53
73
 
@@ -77,7 +77,8 @@ module Honeybadger
77
77
  if config.load_plugin_insights?(:rails)
78
78
  ::ActiveSupport::Notifications.subscribe(/(process_action|send_file|redirect_to|halted_callback|unpermitted_parameters)\.action_controller/, Honeybadger::ActionControllerSubscriber.new)
79
79
  ::ActiveSupport::Notifications.subscribe(/(write_fragment|read_fragment|expire_fragment|exist_fragment\?)\.action_controller/, Honeybadger::ActionControllerCacheSubscriber.new)
80
- ::ActiveSupport::Notifications.subscribe(/cache_(read|read_multi|generate|fetch_hit|write|write_multi|increment|decrement|delete|delete_multi|cleanup|prune|exist\?)\.active_support/, Honeybadger::ActiveSupportCacheSubscriber.new)
80
+ ::ActiveSupport::Notifications.subscribe(/cache_(read|generate|fetch_hit|write|increment|decrement|delete|cleanup|prune|exist\?)\.active_support/, Honeybadger::ActiveSupportCacheSubscriber.new)
81
+ ::ActiveSupport::Notifications.subscribe(/cache_(read_multi|write_multi|delete_multi\?)\.active_support/, Honeybadger::ActiveSupportCacheMultiSubscriber.new)
81
82
  ::ActiveSupport::Notifications.subscribe(/^render_(template|partial|collection)\.action_view/, Honeybadger::ActionViewSubscriber.new)
82
83
  ::ActiveSupport::Notifications.subscribe("sql.active_record", Honeybadger::ActiveRecordSubscriber.new)
83
84
  ::ActiveSupport::Notifications.subscribe("process.action_mailer", Honeybadger::ActionMailerSubscriber.new)
@@ -1,4 +1,4 @@
1
1
  module Honeybadger
2
2
  # The current String Honeybadger version.
3
- VERSION = '5.15.3'.freeze
3
+ VERSION = '5.15.5'.freeze
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: honeybadger
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.15.3
4
+ version: 5.15.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Honeybadger Industries LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-25 00:00:00.000000000 Z
11
+ date: 2024-08-05 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Make managing application errors a more pleasant experience.
14
14
  email: