sentry-raven 1.2.1 → 1.2.2

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: e97702132902b09734d484062d95956e34c55e04
4
- data.tar.gz: ca8d939ea7ff848249c6bcef9603bf31324a314b
3
+ metadata.gz: bc76647e919f5e837ef8abf2cbf0521e11193220
4
+ data.tar.gz: 978b72587b050a72524c5f6c559d2a88a8aaa74f
5
5
  SHA512:
6
- metadata.gz: 7b89c8cd9d4e2f28d8a83703d617a904b7cfca119f3a0bb3dbfff16d392307dbad7b6a37ffb844f136ce370e4c5b1f9a48069b2f86b172fa4d6afd3bbeea7d69
7
- data.tar.gz: fd1da535f9f07a252ab08ca095beb0e863ae45d070074780e677dd56c51f74c1dfaae475ba62364ae90b3d905e3728f1ead572462266e6e988eefaa25a110eb6
6
+ metadata.gz: 9c001fe837c066e6c31798f2559848b136bfc5b06a305d7760935114a9efb88d8dc6997b421d0d09ac7e97069bccc7112592c724c2b1bd3b946f29ff4536d9e2
7
+ data.tar.gz: 01cd432010f844dacca7fb3fdface7e4421e528e0efcf56bc3d9ee566a2ebfd9e2840e293a3cb493675d8179ff66795ccb2c5c9a84c5f6a9b6a2cd8b3e2a6c55
@@ -7,6 +7,7 @@ require 'raven/processor/removecircularreferences'
7
7
  require 'raven/processor/utf8conversion'
8
8
  require 'raven/processor/cookies'
9
9
  require 'raven/processor/post_data'
10
+ require 'raven/processor/truncator'
10
11
  require 'raven/configuration'
11
12
  require 'raven/context'
12
13
  require 'raven/client'
@@ -112,6 +112,9 @@ module Raven
112
112
  # Sanitize values that look like credit card numbers
113
113
  attr_accessor :sanitize_credit_cards
114
114
 
115
+ # Truncate any strings longer than this bytesize before sending
116
+ attr_accessor :event_bytesize_limit
117
+
115
118
  # Logger 'progname's to exclude from breadcrumbs
116
119
  attr_accessor :exclude_loggers
117
120
 
@@ -127,6 +130,7 @@ module Raven
127
130
  ].freeze
128
131
 
129
132
  DEFAULT_PROCESSORS = [
133
+ Raven::Processor::Truncator,
130
134
  Raven::Processor::RemoveCircularReferences,
131
135
  Raven::Processor::UTF8Conversion,
132
136
  Raven::Processor::SanitizeData,
@@ -153,6 +157,7 @@ module Raven
153
157
  self.transport_failure_callback = false
154
158
  self.sanitize_fields = []
155
159
  self.sanitize_credit_cards = true
160
+ self.event_bytesize_limit = 8_000
156
161
  self.environments = []
157
162
  self.exclude_loggers = []
158
163
 
@@ -43,8 +43,8 @@ module Delayed
43
43
  # Make sure we propagate the failure!
44
44
  raise exception
45
45
  ensure
46
- Context.clear!
47
- BreadcrumbBuffer.clear!
46
+ ::Raven::Context.clear!
47
+ ::Raven::BreadcrumbBuffer.clear!
48
48
  end
49
49
  end
50
50
  end
@@ -0,0 +1,22 @@
1
+ module Raven
2
+ class Processor::Truncator < Processor
3
+ attr_accessor :event_bytesize_limit
4
+
5
+ def initialize(client)
6
+ super
7
+ self.event_bytesize_limit = client.configuration.event_bytesize_limit
8
+ end
9
+
10
+ def process(value)
11
+ value.each_with_object(value) { |(k, v), memo| memo[k] = truncate(v) }
12
+ end
13
+
14
+ def truncate(v)
15
+ if v.respond_to?(:bytesize) && v.bytesize >= event_bytesize_limit
16
+ v.byteslice(0...event_bytesize_limit)
17
+ else
18
+ v
19
+ end
20
+ end
21
+ end
22
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  module Raven
3
3
  # Freezing this constant breaks in 1.9.x
4
- VERSION = "1.2.1" # rubocop:disable Style/MutableConstant
4
+ VERSION = "1.2.2" # rubocop:disable Style/MutableConstant
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sentry-raven
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sentry Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-21 00:00:00.000000000 Z
11
+ date: 2016-07-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -162,6 +162,7 @@ files:
162
162
  - lib/raven/processor/removecircularreferences.rb
163
163
  - lib/raven/processor/removestacktrace.rb
164
164
  - lib/raven/processor/sanitizedata.rb
165
+ - lib/raven/processor/truncator.rb
165
166
  - lib/raven/processor/utf8conversion.rb
166
167
  - lib/raven/transports.rb
167
168
  - lib/raven/transports/dummy.rb