rollbar 2.19.1 → 2.27.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +5 -5
  2. data/.github/pull_request_template.md +25 -0
  3. data/.rubocop.yml +168 -0
  4. data/.travis.yml +63 -34
  5. data/Appraisals +10 -10
  6. data/Gemfile +35 -14
  7. data/README.md +5 -2
  8. data/Rakefile +0 -0
  9. data/data/rollbar.snippet.js +1 -1
  10. data/docs/configuration.md +17 -0
  11. data/gemfiles/rails30.gemfile +10 -10
  12. data/gemfiles/rails31.gemfile +10 -9
  13. data/gemfiles/rails32.gemfile +10 -9
  14. data/gemfiles/rails40.gemfile +10 -9
  15. data/gemfiles/rails41.gemfile +10 -9
  16. data/gemfiles/rails42.gemfile +12 -9
  17. data/gemfiles/rails50.gemfile +21 -14
  18. data/gemfiles/rails51.gemfile +21 -14
  19. data/gemfiles/rails52.gemfile +15 -12
  20. data/gemfiles/rails60.gemfile +67 -0
  21. data/lib/generators/rollbar/rollbar_generator.rb +1 -1
  22. data/lib/rails/rollbar_runner.rb +4 -2
  23. data/lib/rollbar/capistrano.rb +1 -1
  24. data/lib/rollbar/capistrano3.rb +6 -3
  25. data/lib/rollbar/capistrano_tasks.rb +29 -21
  26. data/lib/rollbar/configuration.rb +86 -16
  27. data/lib/rollbar/delay/girl_friday.rb +4 -8
  28. data/lib/rollbar/delay/resque.rb +3 -6
  29. data/lib/rollbar/delay/sidekiq.rb +4 -10
  30. data/lib/rollbar/delay/sucker_punch.rb +16 -19
  31. data/lib/rollbar/delay/thread.rb +16 -2
  32. data/lib/rollbar/deploy.rb +52 -29
  33. data/lib/rollbar/encoding/encoder.rb +17 -10
  34. data/lib/rollbar/exception_reporter.rb +19 -5
  35. data/lib/rollbar/item/backtrace.rb +13 -3
  36. data/lib/rollbar/item/frame.rb +9 -1
  37. data/lib/rollbar/item/locals.rb +100 -0
  38. data/lib/rollbar/item.rb +56 -17
  39. data/lib/rollbar/json.rb +6 -51
  40. data/lib/rollbar/language_support.rb +4 -20
  41. data/lib/rollbar/lazy_store.rb +5 -5
  42. data/lib/rollbar/logger.rb +1 -0
  43. data/lib/rollbar/logger_proxy.rb +6 -2
  44. data/lib/rollbar/middleware/js.rb +28 -18
  45. data/lib/rollbar/middleware/rack.rb +4 -1
  46. data/lib/rollbar/middleware/rails/rollbar.rb +10 -1
  47. data/lib/rollbar/notifier/trace_with_bindings.rb +65 -0
  48. data/lib/rollbar/notifier.rb +225 -89
  49. data/lib/rollbar/plugin.rb +54 -6
  50. data/lib/rollbar/plugins/active_job.rb +6 -2
  51. data/lib/rollbar/plugins/basic_socket.rb +21 -6
  52. data/lib/rollbar/plugins/delayed_job/job_data.rb +3 -3
  53. data/lib/rollbar/plugins/delayed_job/plugin.rb +13 -3
  54. data/lib/rollbar/plugins/error_context.rb +11 -0
  55. data/lib/rollbar/plugins/goalie.rb +11 -3
  56. data/lib/rollbar/plugins/rails/controller_methods.rb +15 -3
  57. data/lib/rollbar/plugins/rake.rb +2 -2
  58. data/lib/rollbar/plugins/sidekiq/plugin.rb +5 -4
  59. data/lib/rollbar/plugins.rb +7 -1
  60. data/lib/rollbar/rake_tasks.rb +4 -148
  61. data/lib/rollbar/request_data_extractor.rb +31 -21
  62. data/lib/rollbar/rollbar_test.rb +36 -0
  63. data/lib/rollbar/scrubbers/params.rb +19 -18
  64. data/lib/rollbar/scrubbers/url.rb +18 -9
  65. data/lib/rollbar/scrubbers.rb +3 -3
  66. data/lib/rollbar/truncation/frames_strategy.rb +1 -1
  67. data/lib/rollbar/truncation/min_body_strategy.rb +2 -3
  68. data/lib/rollbar/truncation/mixin.rb +1 -1
  69. data/lib/rollbar/truncation/remove_any_key_strategy.rb +123 -0
  70. data/lib/rollbar/truncation/remove_extra_strategy.rb +35 -0
  71. data/lib/rollbar/truncation/remove_request_strategy.rb +21 -0
  72. data/lib/rollbar/truncation/strings_strategy.rb +6 -5
  73. data/lib/rollbar/truncation.rb +9 -2
  74. data/lib/rollbar/util/hash.rb +15 -0
  75. data/lib/rollbar/util/ip_anonymizer.rb +8 -7
  76. data/lib/rollbar/util/ip_obfuscator.rb +1 -1
  77. data/lib/rollbar/util.rb +6 -2
  78. data/lib/rollbar/version.rb +1 -1
  79. data/lib/rollbar.rb +2 -3
  80. data/lib/tasks/benchmark.rake +103 -0
  81. data/rollbar.gemspec +13 -5
  82. data/spec/support/rollbar_api.rb +67 -0
  83. metadata +21 -23
  84. data/gemfiles/ruby_1_8_and_1_9_2.gemfile +0 -49
  85. data/lib/rollbar/json/default.rb +0 -11
  86. 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.19.1
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: 2019-02-24 00:00:00.000000000 Z
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/ruby_1_8_and_1_9_2.gemfile
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
- rubyforge_project:
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 => '../'
@@ -1,11 +0,0 @@
1
- module Rollbar
2
- module JSON
3
- module Default
4
- extend self
5
-
6
- def options
7
- {}
8
- end
9
- end
10
- end
11
- end
@@ -1,16 +0,0 @@
1
- module Rollbar
2
- module JSON
3
- module Oj
4
- extend self
5
-
6
- def options
7
- {
8
- :mode => :compat,
9
- :use_to_json => false,
10
- :symbol_keys => false,
11
- :circular => false
12
- }
13
- end
14
- end
15
- end
16
- end