sentry-raven 2.4.0 → 2.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/lib/raven/client.rb +1 -1
- data/lib/raven/integrations/sidekiq.rb +1 -1
- data/lib/raven/interfaces/stack_trace.rb +2 -2
- data/lib/raven/processor/removecircularreferences.rb +10 -8
- data/lib/raven/processor/sanitizedata.rb +19 -22
- data/lib/raven/processor/utf8conversion.rb +12 -13
- data/lib/raven/transports/http.rb +1 -1
- data/lib/raven/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb8e99d6cd40b4a9bcebae0aa4c2b6a9ae92c65f
|
4
|
+
data.tar.gz: f0b34e2f0061b92c0b94dbfce8409b415850a756
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89cd1bda236dfc17bde728a9b69ddcc0d2f4bbffdd2a8697969662c977addf14f180285132987b20cfa53f9398cf3b80309bc781bd502700ce6a4b20a663ccde
|
7
|
+
data.tar.gz: 11d7601a11bd66e3881f457f60c9db1bb253a4a93fa35b32bb61447d938f74019b7fa219a3f4cf8d797cac48835e8d795a2417f5b9b4d793a97596203516286c
|
data/README.md
CHANGED
@@ -143,7 +143,7 @@ For more information, see [Context](https://docs.sentry.io/clients/ruby/context/
|
|
143
143
|
## More Information
|
144
144
|
|
145
145
|
* [Documentation](https://docs.getsentry.com/hosted/clients/ruby/)
|
146
|
-
* [Bug Tracker](https://github.com/getsentry/raven-ruby/issues
|
147
|
-
* [Code](https://github.com/getsentry/raven-ruby
|
148
|
-
* [Mailing List](https://groups.google.com/group/getsentry
|
146
|
+
* [Bug Tracker](https://github.com/getsentry/raven-ruby/issues)
|
147
|
+
* [Code](https://github.com/getsentry/raven-ruby)
|
148
|
+
* [Mailing List](https://groups.google.com/group/getsentry)
|
149
149
|
* [IRC](irc://irc.freenode.net/sentry>) (irc.freenode.net, #sentry)
|
data/lib/raven/client.rb
CHANGED
@@ -51,7 +51,7 @@ module Raven
|
|
51
51
|
# this will change in the future:
|
52
52
|
# https://github.com/mperham/sidekiq/pull/3161
|
53
53
|
def culprit_from_context(context)
|
54
|
-
classname = (context["class"] || (context["job"] && context["job"]["class"]))
|
54
|
+
classname = (context["class"] || (context["job"] && (context["job"]["wrapped"] || context["job"]["class"])))
|
55
55
|
if classname
|
56
56
|
"Sidekiq/#{classname}"
|
57
57
|
elsif context["event"]
|
@@ -37,7 +37,7 @@ module Raven
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def filename
|
40
|
-
return
|
40
|
+
return if abs_path.nil?
|
41
41
|
|
42
42
|
prefix =
|
43
43
|
if under_project_root? && in_app
|
@@ -60,7 +60,7 @@ module Raven
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def longest_load_path
|
63
|
-
$LOAD_PATH.select { |s| abs_path.start_with?(s
|
63
|
+
$LOAD_PATH.select { |s| abs_path.start_with?(s) }.max_by(&:length)
|
64
64
|
end
|
65
65
|
|
66
66
|
def to_hash(*args)
|
@@ -1,14 +1,16 @@
|
|
1
1
|
module Raven
|
2
2
|
class Processor::RemoveCircularReferences < Processor
|
3
|
-
def process(
|
4
|
-
return "(...)" if visited.include?(
|
5
|
-
visited
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
3
|
+
def process(value, visited = [])
|
4
|
+
return "(...)" if visited.include?(value.__id__)
|
5
|
+
visited << value.__id__ if value.is_a?(Array) || value.is_a?(Hash)
|
6
|
+
|
7
|
+
case value
|
8
|
+
when Hash
|
9
|
+
!value.frozen? ? value.merge!(value) { |_, v| process v, visited } : value.merge(value) { |_, v| process v, visited }
|
10
|
+
when Array
|
11
|
+
!value.frozen? ? value.map! { |v| process v, visited } : value.map { |v| process v, visited }
|
10
12
|
else
|
11
|
-
|
13
|
+
value
|
12
14
|
end
|
13
15
|
end
|
14
16
|
end
|
@@ -14,31 +14,27 @@ module Raven
|
|
14
14
|
self.sanitize_credit_cards = client.configuration.sanitize_credit_cards
|
15
15
|
end
|
16
16
|
|
17
|
-
def process(value)
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
elsif k.to_s == 'query_string'
|
28
|
-
sanitize_query_string(v)
|
29
|
-
elsif v.is_a?(Integer) && matches_regexes?(k, v)
|
30
|
-
INT_MASK
|
31
|
-
elsif v.is_a?(String)
|
32
|
-
if fields_re.match(v.to_s) && (json = parse_json_or_nil(v))
|
17
|
+
def process(value, key = nil)
|
18
|
+
case value
|
19
|
+
when Hash
|
20
|
+
!value.frozen? ? value.merge!(value) { |k, v| process v, k } : value.merge(value) { |k, v| process v, k }
|
21
|
+
when Array
|
22
|
+
!value.frozen? ? value.map! { |v| process v, key } : value.map { |v| process v, key }
|
23
|
+
when Integer
|
24
|
+
matches_regexes?(key, value.to_s) ? INT_MASK : value
|
25
|
+
when String
|
26
|
+
if value =~ fields_re && (json = parse_json_or_nil(value))
|
33
27
|
# if this string is actually a json obj, convert and sanitize
|
34
|
-
|
35
|
-
elsif matches_regexes?(
|
28
|
+
process(json).to_json
|
29
|
+
elsif matches_regexes?(key, value)
|
36
30
|
STRING_MASK
|
31
|
+
elsif key == 'query_string' || key == :query_string
|
32
|
+
sanitize_query_string(value)
|
37
33
|
else
|
38
|
-
|
34
|
+
value
|
39
35
|
end
|
40
36
|
else
|
41
|
-
|
37
|
+
value
|
42
38
|
end
|
43
39
|
end
|
44
40
|
|
@@ -51,8 +47,8 @@ module Raven
|
|
51
47
|
end
|
52
48
|
|
53
49
|
def matches_regexes?(k, v)
|
54
|
-
(sanitize_credit_cards && CREDIT_CARD_RE
|
55
|
-
fields_re
|
50
|
+
(sanitize_credit_cards && v =~ CREDIT_CARD_RE) ||
|
51
|
+
k =~ fields_re
|
56
52
|
end
|
57
53
|
|
58
54
|
def fields_re
|
@@ -70,6 +66,7 @@ module Raven
|
|
70
66
|
end
|
71
67
|
|
72
68
|
def parse_json_or_nil(string)
|
69
|
+
return unless string.start_with?("[", "{")
|
73
70
|
JSON.parse(string)
|
74
71
|
rescue JSON::ParserError, NoMethodError
|
75
72
|
nil
|
@@ -1,29 +1,28 @@
|
|
1
1
|
module Raven
|
2
2
|
class Processor::UTF8Conversion < Processor
|
3
3
|
def process(value)
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
case value
|
5
|
+
when Array
|
6
|
+
!value.frozen? ? value.map! { |v| process v } : value.map { |v| process v }
|
7
|
+
when Hash
|
8
|
+
!value.frozen? ? value.merge!(value) { |_, v| process v } : value.merge(value) { |_, v| process v }
|
9
|
+
when Exception
|
10
|
+
return value if value.message.valid_encoding?
|
9
11
|
clean_exc = value.class.new(clean_invalid_utf8_bytes(value.message))
|
10
12
|
clean_exc.set_backtrace(value.backtrace)
|
11
13
|
clean_exc
|
12
|
-
|
14
|
+
when String
|
15
|
+
return value if value.valid_encoding?
|
13
16
|
clean_invalid_utf8_bytes(value)
|
17
|
+
else
|
18
|
+
value
|
14
19
|
end
|
15
20
|
end
|
16
21
|
|
17
22
|
private
|
18
23
|
|
19
24
|
def clean_invalid_utf8_bytes(obj)
|
20
|
-
|
21
|
-
obj.to_utf8
|
22
|
-
elsif obj.respond_to?(:encoding) && obj.is_a?(String)
|
23
|
-
obj.encode('UTF-16', :invalid => :replace, :undef => :replace, :replace => '').encode('UTF-8')
|
24
|
-
else
|
25
|
-
obj
|
26
|
-
end
|
25
|
+
obj.encode('UTF-16', :invalid => :replace, :undef => :replace, :replace => '').encode('UTF-8')
|
27
26
|
end
|
28
27
|
end
|
29
28
|
end
|
@@ -27,7 +27,7 @@ module Raven
|
|
27
27
|
req.headers['X-Sentry-Auth'] = auth_header
|
28
28
|
req.body = data
|
29
29
|
end
|
30
|
-
rescue Faraday::
|
30
|
+
rescue Faraday::Error => ex
|
31
31
|
error_info = ex.message
|
32
32
|
if ex.response && ex.response[:headers]['x-sentry-error']
|
33
33
|
error_info += " Error in headers is: #{ex.response[:headers]['x-sentry-error']}"
|
data/lib/raven/version.rb
CHANGED
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: 2.
|
4
|
+
version: 2.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sentry Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -193,7 +193,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
193
193
|
version: '0'
|
194
194
|
requirements: []
|
195
195
|
rubyforge_project:
|
196
|
-
rubygems_version: 2.6.
|
196
|
+
rubygems_version: 2.6.11
|
197
197
|
signing_key:
|
198
198
|
specification_version: 4
|
199
199
|
summary: A gem that provides a client interface for the Sentry error logger
|