rollbar 2.19.1 → 2.27.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/pull_request_template.md +25 -0
- data/.rubocop.yml +168 -0
- data/.travis.yml +63 -34
- data/Appraisals +10 -10
- data/Gemfile +35 -14
- data/README.md +5 -2
- data/Rakefile +0 -0
- data/data/rollbar.snippet.js +1 -1
- data/docs/configuration.md +17 -0
- data/gemfiles/rails30.gemfile +10 -10
- data/gemfiles/rails31.gemfile +10 -9
- data/gemfiles/rails32.gemfile +10 -9
- data/gemfiles/rails40.gemfile +10 -9
- data/gemfiles/rails41.gemfile +10 -9
- data/gemfiles/rails42.gemfile +12 -9
- data/gemfiles/rails50.gemfile +21 -14
- data/gemfiles/rails51.gemfile +21 -14
- data/gemfiles/rails52.gemfile +15 -12
- data/gemfiles/rails60.gemfile +67 -0
- data/lib/generators/rollbar/rollbar_generator.rb +1 -1
- data/lib/rails/rollbar_runner.rb +4 -2
- data/lib/rollbar/capistrano.rb +1 -1
- data/lib/rollbar/capistrano3.rb +6 -3
- data/lib/rollbar/capistrano_tasks.rb +29 -21
- data/lib/rollbar/configuration.rb +86 -16
- data/lib/rollbar/delay/girl_friday.rb +4 -8
- data/lib/rollbar/delay/resque.rb +3 -6
- data/lib/rollbar/delay/sidekiq.rb +4 -10
- data/lib/rollbar/delay/sucker_punch.rb +16 -19
- data/lib/rollbar/delay/thread.rb +16 -2
- data/lib/rollbar/deploy.rb +52 -29
- data/lib/rollbar/encoding/encoder.rb +17 -10
- data/lib/rollbar/exception_reporter.rb +19 -5
- data/lib/rollbar/item/backtrace.rb +13 -3
- data/lib/rollbar/item/frame.rb +9 -1
- data/lib/rollbar/item/locals.rb +100 -0
- data/lib/rollbar/item.rb +56 -17
- data/lib/rollbar/json.rb +6 -51
- data/lib/rollbar/language_support.rb +4 -20
- data/lib/rollbar/lazy_store.rb +5 -5
- data/lib/rollbar/logger.rb +1 -0
- data/lib/rollbar/logger_proxy.rb +6 -2
- data/lib/rollbar/middleware/js.rb +28 -18
- data/lib/rollbar/middleware/rack.rb +4 -1
- data/lib/rollbar/middleware/rails/rollbar.rb +10 -1
- data/lib/rollbar/notifier/trace_with_bindings.rb +65 -0
- data/lib/rollbar/notifier.rb +225 -89
- data/lib/rollbar/plugin.rb +54 -6
- data/lib/rollbar/plugins/active_job.rb +6 -2
- data/lib/rollbar/plugins/basic_socket.rb +21 -6
- data/lib/rollbar/plugins/delayed_job/job_data.rb +3 -3
- data/lib/rollbar/plugins/delayed_job/plugin.rb +13 -3
- data/lib/rollbar/plugins/error_context.rb +11 -0
- data/lib/rollbar/plugins/goalie.rb +11 -3
- data/lib/rollbar/plugins/rails/controller_methods.rb +15 -3
- data/lib/rollbar/plugins/rake.rb +2 -2
- data/lib/rollbar/plugins/sidekiq/plugin.rb +5 -4
- data/lib/rollbar/plugins.rb +7 -1
- data/lib/rollbar/rake_tasks.rb +4 -148
- data/lib/rollbar/request_data_extractor.rb +31 -21
- data/lib/rollbar/rollbar_test.rb +36 -0
- data/lib/rollbar/scrubbers/params.rb +19 -18
- data/lib/rollbar/scrubbers/url.rb +18 -9
- data/lib/rollbar/scrubbers.rb +3 -3
- data/lib/rollbar/truncation/frames_strategy.rb +1 -1
- data/lib/rollbar/truncation/min_body_strategy.rb +2 -3
- data/lib/rollbar/truncation/mixin.rb +1 -1
- data/lib/rollbar/truncation/remove_any_key_strategy.rb +123 -0
- data/lib/rollbar/truncation/remove_extra_strategy.rb +35 -0
- data/lib/rollbar/truncation/remove_request_strategy.rb +21 -0
- data/lib/rollbar/truncation/strings_strategy.rb +6 -5
- data/lib/rollbar/truncation.rb +9 -2
- data/lib/rollbar/util/hash.rb +15 -0
- data/lib/rollbar/util/ip_anonymizer.rb +8 -7
- data/lib/rollbar/util/ip_obfuscator.rb +1 -1
- data/lib/rollbar/util.rb +6 -2
- data/lib/rollbar/version.rb +1 -1
- data/lib/rollbar.rb +2 -3
- data/lib/tasks/benchmark.rake +103 -0
- data/rollbar.gemspec +13 -5
- data/spec/support/rollbar_api.rb +67 -0
- metadata +21 -23
- data/gemfiles/ruby_1_8_and_1_9_2.gemfile +0 -49
- data/lib/rollbar/json/default.rb +0 -11
- data/lib/rollbar/json/oj.rb +0 -16
@@ -0,0 +1,67 @@
|
|
1
|
+
require 'rack/request'
|
2
|
+
|
3
|
+
class RollbarAPI
|
4
|
+
UNAUTHORIZED_ACCESS_TOKEN = 'unauthorized'.freeze
|
5
|
+
|
6
|
+
def call(env)
|
7
|
+
request = Rack::Request.new(env)
|
8
|
+
json = JSON.parse(request.body.read)
|
9
|
+
|
10
|
+
return unauthorized unless authorized?(json, request)
|
11
|
+
|
12
|
+
return bad_request(json) unless valid_data?(json, request)
|
13
|
+
|
14
|
+
success(json, request)
|
15
|
+
end
|
16
|
+
|
17
|
+
protected
|
18
|
+
|
19
|
+
def authorized?(_json, request)
|
20
|
+
request.env['HTTP_X_ROLLBAR_ACCESS_TOKEN'] != UNAUTHORIZED_ACCESS_TOKEN
|
21
|
+
end
|
22
|
+
|
23
|
+
def response_headers
|
24
|
+
{
|
25
|
+
'Content-Type' => 'application/json'
|
26
|
+
}
|
27
|
+
end
|
28
|
+
|
29
|
+
def valid_data?(_json, request)
|
30
|
+
!!request.env['HTTP_X_ROLLBAR_ACCESS_TOKEN']
|
31
|
+
end
|
32
|
+
|
33
|
+
def unauthorized
|
34
|
+
[401, response_headers, [unauthorized_body]]
|
35
|
+
end
|
36
|
+
|
37
|
+
def bad_request(_json)
|
38
|
+
[400, response_headers, [bad_request_body]]
|
39
|
+
end
|
40
|
+
|
41
|
+
def success(json, request)
|
42
|
+
[200, response_headers, [success_body(json, request)]]
|
43
|
+
end
|
44
|
+
|
45
|
+
def unauthorized_body
|
46
|
+
result(1, nil, 'invalid access token')
|
47
|
+
end
|
48
|
+
|
49
|
+
def bad_request_body
|
50
|
+
result(1, nil, 'bad request')
|
51
|
+
end
|
52
|
+
|
53
|
+
def success_body(json, _request)
|
54
|
+
result(0, {
|
55
|
+
:id => rand(1_000_000),
|
56
|
+
:uuid => json['data']['uuid']
|
57
|
+
}, nil)
|
58
|
+
end
|
59
|
+
|
60
|
+
def result(err, body, message)
|
61
|
+
{
|
62
|
+
:err => err,
|
63
|
+
:result => body,
|
64
|
+
:message => message
|
65
|
+
}.to_json
|
66
|
+
end
|
67
|
+
end
|
metadata
CHANGED
@@ -1,29 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rollbar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.27.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rollbar, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
12
|
-
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: multi_json
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
11
|
+
date: 2020-08-28 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
27
13
|
description: Easy and powerful exception tracking for Ruby
|
28
14
|
email:
|
29
15
|
- support@rollbar.com
|
@@ -33,6 +19,7 @@ extensions: []
|
|
33
19
|
extra_rdoc_files: []
|
34
20
|
files:
|
35
21
|
- ".codeclimate.yml"
|
22
|
+
- ".github/pull_request_template.md"
|
36
23
|
- ".gitignore"
|
37
24
|
- ".gitmodules"
|
38
25
|
- ".rubocop.yml"
|
@@ -59,7 +46,7 @@ files:
|
|
59
46
|
- gemfiles/rails50.gemfile
|
60
47
|
- gemfiles/rails51.gemfile
|
61
48
|
- gemfiles/rails52.gemfile
|
62
|
-
- gemfiles/
|
49
|
+
- gemfiles/rails60.gemfile
|
63
50
|
- lib/generators/rollbar/rollbar_generator.rb
|
64
51
|
- lib/generators/rollbar/templates/initializer.rb
|
65
52
|
- lib/rails/rollbar_runner.rb
|
@@ -85,10 +72,9 @@ files:
|
|
85
72
|
- lib/rollbar/item.rb
|
86
73
|
- lib/rollbar/item/backtrace.rb
|
87
74
|
- lib/rollbar/item/frame.rb
|
75
|
+
- lib/rollbar/item/locals.rb
|
88
76
|
- lib/rollbar/js.rb
|
89
77
|
- lib/rollbar/json.rb
|
90
|
-
- lib/rollbar/json/default.rb
|
91
|
-
- lib/rollbar/json/oj.rb
|
92
78
|
- lib/rollbar/language_support.rb
|
93
79
|
- lib/rollbar/lazy_store.rb
|
94
80
|
- lib/rollbar/logger.rb
|
@@ -102,6 +88,7 @@ files:
|
|
102
88
|
- lib/rollbar/middleware/rails/show_exceptions.rb
|
103
89
|
- lib/rollbar/middleware/sinatra.rb
|
104
90
|
- lib/rollbar/notifier.rb
|
91
|
+
- lib/rollbar/notifier/trace_with_bindings.rb
|
105
92
|
- lib/rollbar/plugin.rb
|
106
93
|
- lib/rollbar/plugins.rb
|
107
94
|
- lib/rollbar/plugins/active_job.rb
|
@@ -109,6 +96,7 @@ files:
|
|
109
96
|
- lib/rollbar/plugins/delayed_job.rb
|
110
97
|
- lib/rollbar/plugins/delayed_job/job_data.rb
|
111
98
|
- lib/rollbar/plugins/delayed_job/plugin.rb
|
99
|
+
- lib/rollbar/plugins/error_context.rb
|
112
100
|
- lib/rollbar/plugins/goalie.rb
|
113
101
|
- lib/rollbar/plugins/rack.rb
|
114
102
|
- lib/rollbar/plugins/rails.rb
|
@@ -126,6 +114,7 @@ files:
|
|
126
114
|
- lib/rollbar/rails.rb
|
127
115
|
- lib/rollbar/rake_tasks.rb
|
128
116
|
- lib/rollbar/request_data_extractor.rb
|
117
|
+
- lib/rollbar/rollbar_test.rb
|
129
118
|
- lib/rollbar/scrubbers.rb
|
130
119
|
- lib/rollbar/scrubbers/params.rb
|
131
120
|
- lib/rollbar/scrubbers/url.rb
|
@@ -134,18 +123,28 @@ files:
|
|
134
123
|
- lib/rollbar/truncation/min_body_strategy.rb
|
135
124
|
- lib/rollbar/truncation/mixin.rb
|
136
125
|
- lib/rollbar/truncation/raw_strategy.rb
|
126
|
+
- lib/rollbar/truncation/remove_any_key_strategy.rb
|
127
|
+
- lib/rollbar/truncation/remove_extra_strategy.rb
|
128
|
+
- lib/rollbar/truncation/remove_request_strategy.rb
|
137
129
|
- lib/rollbar/truncation/strings_strategy.rb
|
138
130
|
- lib/rollbar/util.rb
|
139
131
|
- lib/rollbar/util/hash.rb
|
140
132
|
- lib/rollbar/util/ip_anonymizer.rb
|
141
133
|
- lib/rollbar/util/ip_obfuscator.rb
|
142
134
|
- lib/rollbar/version.rb
|
135
|
+
- lib/tasks/benchmark.rake
|
143
136
|
- lib/tasks/tasks.rake
|
144
137
|
- rollbar.gemspec
|
138
|
+
- spec/support/rollbar_api.rb
|
145
139
|
homepage: https://rollbar.com
|
146
140
|
licenses:
|
147
141
|
- MIT
|
148
|
-
metadata:
|
142
|
+
metadata:
|
143
|
+
changelog_uri: https://github.com/rollbar/rollbar-gem/releases
|
144
|
+
source_code_uri: https://github.com/rollbar/rollbar-gem
|
145
|
+
bug_tracker_uri: https://github.com/rollbar/rollbar-gem/issues
|
146
|
+
homepage_uri: https://rollbar.com/
|
147
|
+
documentation_uri: https://docs.rollbar.com/docs/ruby
|
149
148
|
post_install_message:
|
150
149
|
rdoc_options: []
|
151
150
|
require_paths:
|
@@ -161,8 +160,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
161
160
|
- !ruby/object:Gem::Version
|
162
161
|
version: '0'
|
163
162
|
requirements: []
|
164
|
-
|
165
|
-
rubygems_version: 2.5.1
|
163
|
+
rubygems_version: 3.1.2
|
166
164
|
signing_key:
|
167
165
|
specification_version: 4
|
168
166
|
summary: Reports exceptions to Rollbar
|
@@ -1,49 +0,0 @@
|
|
1
|
-
require 'rubygems/version'
|
2
|
-
|
3
|
-
source 'https://rubygems.org'
|
4
|
-
|
5
|
-
is_jruby = defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && 'jruby' == RUBY_ENGINE)
|
6
|
-
|
7
|
-
gem 'appraisal', '= 1.0.2'
|
8
|
-
gem 'activerecord-jdbcsqlite3-adapter', :platform => :jruby
|
9
|
-
gem 'hitimes', '< 1.2.2'
|
10
|
-
gem 'jruby-openssl', :platform => :jruby
|
11
|
-
gem 'rails', '3.0.20'
|
12
|
-
gem 'rake', '< 11'
|
13
|
-
gem 'rspec-rails', '>= 2.14.0'
|
14
|
-
gem 'sqlite3', '< 1.4.0', :platform => [:ruby, :mswin, :mingw]
|
15
|
-
|
16
|
-
gem 'oj', '~> 2.12.14' unless is_jruby
|
17
|
-
if RUBY_VERSION > '1.8.7' && RUBY_VERSION < '2.2.2'
|
18
|
-
gem 'sidekiq', '>= 2.13.0', '< 5.0'
|
19
|
-
end
|
20
|
-
|
21
|
-
platforms :rbx do
|
22
|
-
gem 'minitest'
|
23
|
-
gem 'racc'
|
24
|
-
gem 'rubinius-developer_tools'
|
25
|
-
gem 'rubysl', '~> 2.0' unless RUBY_VERSION.start_with?('1')
|
26
|
-
end
|
27
|
-
|
28
|
-
if RUBY_VERSION.start_with?('1.9')
|
29
|
-
gem 'celluloid', '< 0.17.0'
|
30
|
-
gem 'sucker_punch', '~> 1.0'
|
31
|
-
elsif RUBY_VERSION.start_with?('2')
|
32
|
-
gem 'sucker_punch', '~> 2.0'
|
33
|
-
end
|
34
|
-
|
35
|
-
gem 'database_cleaner', '~> 1.0.0'
|
36
|
-
gem 'delayed_job', '4.1.3', :require => false
|
37
|
-
gem 'genspec', '= 0.2.8'
|
38
|
-
gem 'girl_friday', '>= 0.11.1'
|
39
|
-
gem 'redis', '< 3.3.5'
|
40
|
-
gem 'resque', '< 2.0.0'
|
41
|
-
gem 'sinatra'
|
42
|
-
|
43
|
-
ruby_version = RUBY_VERSION.dup
|
44
|
-
|
45
|
-
if Gem::Version.new(ruby_version) < Gem::Version.new('2.0')
|
46
|
-
gem 'mime-types', '< 3.0'
|
47
|
-
end
|
48
|
-
|
49
|
-
gemspec :path => '../'
|
data/lib/rollbar/json/default.rb
DELETED