bugsnag 6.26.4 → 6.27.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +19 -0
- data/README.md +1 -2
- data/VERSION +1 -1
- data/lib/bugsnag/breadcrumbs/on_breadcrumb_callback_list.rb +0 -2
- data/lib/bugsnag/breadcrumbs/validator.rb +0 -2
- data/lib/bugsnag/cleaner.rb +0 -2
- data/lib/bugsnag/configuration.rb +33 -11
- data/lib/bugsnag/delivery/synchronous.rb +0 -1
- data/lib/bugsnag/delivery/thread_queue.rb +0 -2
- data/lib/bugsnag/event.rb +0 -2
- data/lib/bugsnag/helpers.rb +0 -5
- data/lib/bugsnag/integrations/mongo.rb +0 -1
- data/lib/bugsnag/integrations/rails/active_job.rb +0 -2
- data/lib/bugsnag/integrations/rails/rails_breadcrumbs.rb +0 -2
- data/lib/bugsnag/integrations/railtie.rb +0 -4
- data/lib/bugsnag/integrations/rake.rb +4 -1
- data/lib/bugsnag/middleware/rack_request.rb +35 -17
- data/lib/bugsnag/middleware/warden_user.rb +3 -0
- data/lib/bugsnag/report.rb +0 -1
- data/lib/bugsnag.rb +19 -12
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f8eb06e59bf516cfc5ca7f5539ae3b0fdbd9c4ea86a82252d6c2ea787a7c255
|
4
|
+
data.tar.gz: 01be8584412260118dfb14548808e1c4c4444aadd040bbbd6c6ad5dee3da1dbc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bebc3030e22bbc50423792c701185d061b0d7834c6a741c805cafa6223753e941cd893a73c65792b8726fc6adf9f9c47ea30715c14381f5a2ac87c52d345ba98
|
7
|
+
data.tar.gz: 1923948f57cc1f032eaf249912d6f5e65423c853bc2cffe89b1b198aead96bc34303aa3aec95f9699911176579cbee14797e805986f24aff2834458413dc5066
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,25 @@
|
|
1
1
|
Changelog
|
2
2
|
=========
|
3
3
|
|
4
|
+
## v6.27.1 (18 June 2024)
|
5
|
+
|
6
|
+
### Fixes
|
7
|
+
|
8
|
+
* Only read Rack request body if it's rewindable
|
9
|
+
| [#829](https://github.com/bugsnag/bugsnag-ruby/pull/829)
|
10
|
+
* Fix circular require warning
|
11
|
+
| [#828](https://github.com/bugsnag/bugsnag-ruby/pull/828)
|
12
|
+
|
13
|
+
## v6.27.0 (23 May 2024)
|
14
|
+
|
15
|
+
### Enhancements
|
16
|
+
|
17
|
+
* Include the Warden scope in user metadata
|
18
|
+
| [#821](https://github.com/bugsnag/bugsnag-ruby/pull/821)
|
19
|
+
| [javierjulio](https://github.com/javierjulio)
|
20
|
+
* Add a block variant of `add_on_error`
|
21
|
+
| [#824](https://github.com/bugsnag/bugsnag-ruby/pull/824)
|
22
|
+
|
4
23
|
## v6.26.4 (25 March 2024)
|
5
24
|
|
6
25
|
### Fixes
|
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Bugsnag error monitoring & exception reporter for Ruby
|
2
|
-
[![build status](https://
|
2
|
+
[![build status](https://github.com/bugsnag/bugsnag-ruby/actions/workflows/test-package.yml/badge.svg)](https://github.com/bugsnag/bugsnag-ruby/actions/workflows/test-package.yml?query=branch%3Amaster)
|
3
3
|
|
4
4
|
|
5
5
|
The Bugsnag exception reporter for Ruby gives you instant notification of exceptions thrown from your **[Rails](https://www.bugsnag.com/platforms/rails)**, **Sinatra**, **Rack** or **plain Ruby** app. Any uncaught exceptions will trigger a notification to be sent to your Bugsnag project.
|
@@ -22,7 +22,6 @@ The Bugsnag exception reporter for Ruby gives you instant notification of except
|
|
22
22
|
* [Rake](https://docs.bugsnag.com/platforms/ruby/rake)
|
23
23
|
* [Sidekiq](https://docs.bugsnag.com/platforms/ruby/sidekiq)
|
24
24
|
* [Other Ruby apps](https://docs.bugsnag.com/platforms/ruby/other)
|
25
|
-
* For [EventMachine](https://rubyeventmachine.com) integration, see [`bugsnag-em`](https://github.com/bugsnag/bugsnag-em)
|
26
25
|
3. Relax!
|
27
26
|
|
28
27
|
## Support
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
6.
|
1
|
+
6.27.1
|
data/lib/bugsnag/cleaner.rb
CHANGED
@@ -1,20 +1,28 @@
|
|
1
|
-
require "
|
2
|
-
|
3
|
-
require "
|
4
|
-
require "bugsnag/
|
1
|
+
require "bugsnag/breadcrumbs/on_breadcrumb_callback_list"
|
2
|
+
|
3
|
+
require "bugsnag/endpoint_configuration"
|
4
|
+
require "bugsnag/endpoint_validator"
|
5
|
+
|
6
|
+
require "bugsnag/middleware/breadcrumbs"
|
5
7
|
require "bugsnag/middleware/callbacks"
|
8
|
+
require "bugsnag/middleware/classify_error"
|
9
|
+
require "bugsnag/middleware/clearance_user"
|
10
|
+
require "bugsnag/middleware/delayed_job"
|
6
11
|
require "bugsnag/middleware/discard_error_class"
|
7
12
|
require "bugsnag/middleware/exception_meta_data"
|
8
13
|
require "bugsnag/middleware/ignore_error_class"
|
9
|
-
require "bugsnag/middleware/
|
10
|
-
require "bugsnag/middleware/
|
14
|
+
require "bugsnag/middleware/mailman"
|
15
|
+
require "bugsnag/middleware/rack_request"
|
16
|
+
require "bugsnag/middleware/rails3_request"
|
17
|
+
require "bugsnag/middleware/rake"
|
11
18
|
require "bugsnag/middleware/session_data"
|
12
|
-
require "bugsnag/middleware/
|
19
|
+
require "bugsnag/middleware/sidekiq"
|
20
|
+
require "bugsnag/middleware/suggestion_data"
|
21
|
+
require "bugsnag/middleware/warden_user"
|
22
|
+
|
23
|
+
require "bugsnag/middleware_stack"
|
24
|
+
|
13
25
|
require "bugsnag/utility/circular_buffer"
|
14
|
-
require "bugsnag/breadcrumbs/breadcrumbs"
|
15
|
-
require "bugsnag/breadcrumbs/on_breadcrumb_callback_list"
|
16
|
-
require "bugsnag/endpoint_configuration"
|
17
|
-
require "bugsnag/endpoint_validator"
|
18
26
|
|
19
27
|
module Bugsnag
|
20
28
|
class Configuration
|
@@ -569,6 +577,20 @@ module Bugsnag
|
|
569
577
|
@enable_sessions = false
|
570
578
|
end
|
571
579
|
|
580
|
+
##
|
581
|
+
# Add the given block to the list of on_error callbacks
|
582
|
+
#
|
583
|
+
# The on_error callbacks will be called when an error is captured or reported
|
584
|
+
# and are passed a {Bugsnag::Report} object
|
585
|
+
#
|
586
|
+
# Returning false from an on_error callback will cause the error to be ignored
|
587
|
+
# and will prevent any remaining callbacks from being called
|
588
|
+
#
|
589
|
+
# @return [void]
|
590
|
+
def on_error(&block)
|
591
|
+
middleware.use(block)
|
592
|
+
end
|
593
|
+
|
572
594
|
##
|
573
595
|
# Add the given callback to the list of on_error callbacks
|
574
596
|
#
|
data/lib/bugsnag/event.rb
CHANGED
data/lib/bugsnag/helpers.rb
CHANGED
@@ -1,4 +1,7 @@
|
|
1
|
-
|
1
|
+
# this file can either be required manually by a user, in which case 'bugsnag'
|
2
|
+
# needs to be required, or it can be required automatically in the railtie,
|
3
|
+
# in which case 'bugsnag' has already been required
|
4
|
+
require 'bugsnag' unless defined?(Bugsnag)
|
2
5
|
|
3
6
|
Rake::TaskManager.record_task_metadata = true
|
4
7
|
|
@@ -1,5 +1,3 @@
|
|
1
|
-
require "json"
|
2
|
-
|
3
1
|
module Bugsnag::Middleware
|
4
2
|
##
|
5
3
|
# Extracts and attaches rack data to an error report
|
@@ -17,7 +15,15 @@ module Bugsnag::Middleware
|
|
17
15
|
|
18
16
|
request = ::Rack::Request.new(env)
|
19
17
|
|
20
|
-
params =
|
18
|
+
params =
|
19
|
+
# if the request body isn't rewindable then we can't read request.POST
|
20
|
+
# which is used internally by request.params
|
21
|
+
if request.body.respond_to?(:rewind)
|
22
|
+
request.params rescue {}
|
23
|
+
else
|
24
|
+
request.GET rescue {}
|
25
|
+
end
|
26
|
+
|
21
27
|
client_ip = request.ip.to_s rescue SPOOF
|
22
28
|
session = env["rack.session"]
|
23
29
|
|
@@ -106,7 +112,11 @@ module Bugsnag::Middleware
|
|
106
112
|
end
|
107
113
|
|
108
114
|
def add_request_body(report, request, env)
|
109
|
-
|
115
|
+
begin
|
116
|
+
body = parsed_request_body(request, env)
|
117
|
+
rescue StandardError
|
118
|
+
return nil
|
119
|
+
end
|
110
120
|
|
111
121
|
# this request may not have a body
|
112
122
|
return unless body.is_a?(Hash) && !body.empty?
|
@@ -115,26 +125,34 @@ module Bugsnag::Middleware
|
|
115
125
|
end
|
116
126
|
|
117
127
|
def parsed_request_body(request, env)
|
118
|
-
|
128
|
+
# if the request is not rewindable then either:
|
129
|
+
# - it's been read already and so is impossible to read
|
130
|
+
# - it hasn't been read yet and us reading it will prevent the user from
|
131
|
+
# reading it themselves
|
132
|
+
# in either case we should avoid attempting to
|
133
|
+
return nil unless request.body.respond_to?(:rewind)
|
134
|
+
|
135
|
+
if request.form_data?
|
136
|
+
begin
|
137
|
+
return request.POST
|
138
|
+
ensure
|
139
|
+
request.body.rewind
|
140
|
+
end
|
141
|
+
end
|
119
142
|
|
120
143
|
content_type = env["CONTENT_TYPE"]
|
121
144
|
|
122
145
|
return nil if content_type.nil?
|
146
|
+
return nil unless content_type.include?('/json') || content_type.include?('+json')
|
123
147
|
|
124
|
-
|
125
|
-
|
126
|
-
body = request.body
|
148
|
+
begin
|
149
|
+
body = request.body
|
127
150
|
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
# the body must be rewound so other things can read it after we do
|
133
|
-
body.rewind
|
134
|
-
end
|
151
|
+
JSON.parse(body.read)
|
152
|
+
ensure
|
153
|
+
# the body must be rewound so other things can read it after we do
|
154
|
+
body.rewind
|
135
155
|
end
|
136
|
-
|
137
|
-
nil
|
138
156
|
end
|
139
157
|
|
140
158
|
def add_cookies(report, request)
|
@@ -23,7 +23,10 @@ module Bugsnag::Middleware
|
|
23
23
|
# Extract useful user information
|
24
24
|
user = {}
|
25
25
|
user_object = env["warden"].user({:scope => best_scope, :run_callbacks => false}) rescue nil
|
26
|
+
|
26
27
|
if user_object
|
28
|
+
user[:warden_scope] = best_scope
|
29
|
+
|
27
30
|
# Build the user info for this scope
|
28
31
|
COMMON_USER_FIELDS.each do |field|
|
29
32
|
user[field] = user_object.send(field) if user_object.respond_to?(field)
|
data/lib/bugsnag/report.rb
CHANGED
data/lib/bugsnag.rb
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
require "rubygems"
|
2
2
|
require "thread"
|
3
|
+
require "set"
|
4
|
+
require "json"
|
5
|
+
require "uri"
|
6
|
+
require "socket"
|
7
|
+
require "logger"
|
3
8
|
|
4
9
|
require "bugsnag/version"
|
5
10
|
require "bugsnag/utility/feature_data_store"
|
@@ -21,21 +26,9 @@ require "bugsnag/feature_flag"
|
|
21
26
|
# as it doesn't auto-configure when loaded
|
22
27
|
require "bugsnag/integrations/rack"
|
23
28
|
|
24
|
-
require "bugsnag/middleware/rack_request"
|
25
|
-
require "bugsnag/middleware/warden_user"
|
26
|
-
require "bugsnag/middleware/clearance_user"
|
27
|
-
require "bugsnag/middleware/callbacks"
|
28
|
-
require "bugsnag/middleware/rails3_request"
|
29
|
-
require "bugsnag/middleware/sidekiq"
|
30
|
-
require "bugsnag/middleware/mailman"
|
31
|
-
require "bugsnag/middleware/rake"
|
32
|
-
require "bugsnag/middleware/classify_error"
|
33
|
-
require "bugsnag/middleware/delayed_job"
|
34
|
-
|
35
29
|
require "bugsnag/breadcrumb_type"
|
36
30
|
require "bugsnag/breadcrumbs/validator"
|
37
31
|
require "bugsnag/breadcrumbs/breadcrumb"
|
38
|
-
require "bugsnag/breadcrumbs/breadcrumbs"
|
39
32
|
|
40
33
|
require "bugsnag/utility/duplicator"
|
41
34
|
require "bugsnag/utility/metadata_delegate"
|
@@ -309,6 +302,20 @@ module Bugsnag
|
|
309
302
|
configuration.breadcrumbs << breadcrumb unless breadcrumb.ignore?
|
310
303
|
end
|
311
304
|
|
305
|
+
##
|
306
|
+
# Add the given block to the list of on_error callbacks
|
307
|
+
#
|
308
|
+
# The on_error callbacks will be called when an error is captured or reported
|
309
|
+
# and are passed a {Bugsnag::Report} object
|
310
|
+
#
|
311
|
+
# Returning false from an on_error callback will cause the error to be ignored
|
312
|
+
# and will prevent any remaining callbacks from being called
|
313
|
+
#
|
314
|
+
# @return [void]
|
315
|
+
def on_error(&block)
|
316
|
+
configuration.on_error(&block)
|
317
|
+
end
|
318
|
+
|
312
319
|
##
|
313
320
|
# Add the given callback to the list of on_error callbacks
|
314
321
|
#
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bugsnag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.
|
4
|
+
version: 6.27.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-06-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -107,7 +107,7 @@ homepage: https://github.com/bugsnag/bugsnag-ruby
|
|
107
107
|
licenses:
|
108
108
|
- MIT
|
109
109
|
metadata:
|
110
|
-
changelog_uri: https://github.com/bugsnag/bugsnag-ruby/blob/v6.
|
110
|
+
changelog_uri: https://github.com/bugsnag/bugsnag-ruby/blob/v6.27.1/CHANGELOG.md
|
111
111
|
documentation_uri: https://docs.bugsnag.com/platforms/ruby/
|
112
112
|
source_code_uri: https://github.com/bugsnag/bugsnag-ruby/
|
113
113
|
rubygems_mfa_required: 'true'
|