bugsnag-api 2.1.0 → 2.1.1

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
  SHA256:
3
- metadata.gz: 0de7c6d92a7d28e2e96de5506e2ecb7e6edd60a087e949b955325628aa93358d
4
- data.tar.gz: 61831b2e22916700edc08be34557d2b01f3fb0a23220436297236d8b413d5d72
3
+ metadata.gz: 617f27c61db7b75cecc854aeeca930e461ce849c48ce5f9fba4ee072639781c4
4
+ data.tar.gz: 84358e937d507d8abc75aa9971f99e9bba6a350e8292b8a3bf21d8a03d58ad33
5
5
  SHA512:
6
- metadata.gz: 9465be48ec9a6bb9a0ec5d1278c8e16a5a296ad5bd802d2e3a839df2e2e3be5a1ecf9eb4dc0c841f3e78e8444b4dc81504e9efbad6cb58e6fecb423817e2db93
7
- data.tar.gz: 2edd21ddbe339ef9f00147c6d398a1ba1013f8c7df9e78d6244a722fcd72c94d962495e1514231ff46421695aa5423ecb561d6478dcab4e936dab986499c7335
6
+ metadata.gz: d0779c59b38cc5735a8074489df90f0ca74f34dea5a3e38e2f957ff4735aa396005e5f607c51905107d3f7f848f5226323b84e01a2e3b564ecd01df8b8151b65
7
+ data.tar.gz: f1db01abc52ef8289b21de312634ecc516214bf0805f4be2063f87deb37ec3fdc70028e435ab93bc9d371e0b84beeff513f4843613c0dc3eb912fc4f9c3e3da6
data/CHANGELOG.md CHANGED
@@ -1,6 +1,14 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ ## 2.1.1 (2 November 2021)
5
+
6
+ ### Fixes
7
+
8
+ * Fix Faraday deprecation warning
9
+ | [sambostock](https://github.com/sambostock)
10
+ | [#36](https://github.com/bugsnag/bugsnag-api-ruby/pull/36)
11
+
4
12
  ## 2.1.0 (28 July 2021)
5
13
 
6
14
  ### Enhancements
data/bugsnag-api.gemspec CHANGED
@@ -39,7 +39,6 @@ Gem::Specification.new do |spec|
39
39
  end
40
40
 
41
41
  if RUBY_VERSION < "2.0.0"
42
- spec.add_development_dependency "json", "< 2.0.0"
43
42
  spec.add_development_dependency "webmock", "2.3.2"
44
43
  spec.add_development_dependency "addressable", "2.3.6"
45
44
 
@@ -49,11 +48,18 @@ Gem::Specification.new do |spec|
49
48
  # parser is used by rubocop
50
49
  spec.add_development_dependency "parser", "< 2.5.0"
51
50
  else
52
- spec.add_development_dependency "json"
53
51
  spec.add_development_dependency "webmock", "> 2.3.2"
54
52
  spec.add_development_dependency "addressable", "> 2.3.6"
55
53
  end
56
54
 
55
+ if RUBY_VERSION < "2.0.0"
56
+ spec.add_development_dependency "json", "< 2.0.0"
57
+ elsif RUBY_VERSION < "2.3.0"
58
+ spec.add_development_dependency "json", "< 2.6.0"
59
+ else
60
+ spec.add_development_dependency "json"
61
+ end
62
+
57
63
  # public_suffix is used by addressable & sawyer
58
64
  if RUBY_VERSION < "2.0.0"
59
65
  spec.add_development_dependency "public_suffix", "< 1.5.0"
@@ -13,6 +13,8 @@ require "bugsnag/api/client/comments"
13
13
  require "bugsnag/api/client/stability"
14
14
  require "bugsnag/api/client/releases"
15
15
 
16
+ require "base64"
17
+
16
18
  module Bugsnag
17
19
  module Api
18
20
 
@@ -169,9 +171,11 @@ module Bugsnag
169
171
  http.headers[:user_agent] = configuration.user_agent
170
172
 
171
173
  if basic_authenticated?
172
- http.basic_auth configuration.email, configuration.password
174
+ credentials = Base64.strict_encode64("#{configuration.email}:#{configuration.password}")
175
+
176
+ http.headers[:Authorization] = "Basic #{credentials}"
173
177
  elsif token_authenticated?
174
- http.authorization "token", configuration.auth_token
178
+ http.headers[:Authorization] = "token #{configuration.auth_token}"
175
179
  end
176
180
  end
177
181
  end
@@ -1,5 +1,5 @@
1
1
  module Bugsnag
2
2
  module Api
3
- VERSION = "2.1.0"
3
+ VERSION = "2.1.1"
4
4
  end
5
5
  end
@@ -16,7 +16,7 @@ http_interactions:
16
16
  X-Bugsnag-Api:
17
17
  - 'true'
18
18
  Authorization:
19
- - Basic c3VwcG9ydEBidWdzbmFnLmNvbTpwYXNzd29yZA==
19
+ - Basic QlVHU05BR19VU0VSX0VNQUlMOkJVR1NOQUdfUEFTU1dPUkQ=
20
20
  Accept-Encoding:
21
21
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
22
22
  Accept:
@@ -16,7 +16,7 @@ http_interactions:
16
16
  X-Bugsnag-Api:
17
17
  - 'true'
18
18
  Authorization:
19
- - Basic c3VwcG9ydEBidWdzbmFnLmNvbTpwYXNzd29yZA==
19
+ - Basic QlVHU05BR19VU0VSX0VNQUlMOkJVR1NOQUdfUEFTU1dPUkQ=
20
20
  Accept-Encoding:
21
21
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
22
22
  Accept:
@@ -16,7 +16,7 @@ http_interactions:
16
16
  X-Bugsnag-Api:
17
17
  - 'true'
18
18
  Authorization:
19
- - Basic c3VwcG9ydEBidWdzbmFnLmNvbTpwYXNzd29yZA==
19
+ - Basic QlVHU05BR19VU0VSX0VNQUlMOkJVR1NOQUdfUEFTU1dPUkQ=
20
20
  Accept-Encoding:
21
21
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
22
22
  Accept:
@@ -16,7 +16,7 @@ http_interactions:
16
16
  X-Bugsnag-Api:
17
17
  - 'true'
18
18
  Authorization:
19
- - Basic c3VwcG9ydEBidWdzbmFnLmNvbTpwYXNzd29yZA==
19
+ - Basic QlVHU05BR19VU0VSX0VNQUlMOkJVR1NOQUdfUEFTU1dPUkQ=
20
20
  Accept-Encoding:
21
21
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
22
22
  Accept:
@@ -84,7 +84,7 @@ http_interactions:
84
84
  X-Bugsnag-Api:
85
85
  - 'true'
86
86
  Authorization:
87
- - Basic c3VwcG9ydEBidWdzbmFnLmNvbTpwYXNzd29yZA==
87
+ - Basic QlVHU05BR19VU0VSX0VNQUlMOkJVR1NOQUdfUEFTU1dPUkQ=
88
88
  Accept-Encoding:
89
89
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
90
90
  Accept:
@@ -16,7 +16,7 @@ http_interactions:
16
16
  X-Bugsnag-Api:
17
17
  - 'true'
18
18
  Authorization:
19
- - Basic c3VwcG9ydEBidWdzbmFnLmNvbTpwYXNzd29yZA==
19
+ - Basic QlVHU05BR19VU0VSX0VNQUlMOkJVR1NOQUdfUEFTU1dPUkQ=
20
20
  Accept-Encoding:
21
21
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
22
22
  Accept:
@@ -84,7 +84,7 @@ http_interactions:
84
84
  X-Bugsnag-Api:
85
85
  - 'true'
86
86
  Authorization:
87
- - Basic c3VwcG9ydEBidWdzbmFnLmNvbTpwYXNzd29yZA==
87
+ - Basic QlVHU05BR19VU0VSX0VNQUlMOkJVR1NOQUdfUEFTU1dPUkQ=
88
88
  Accept-Encoding:
89
89
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
90
90
  Accept:
@@ -16,7 +16,7 @@ http_interactions:
16
16
  X-Bugsnag-Api:
17
17
  - 'true'
18
18
  Authorization:
19
- - Basic c3VwcG9ydEBidWdzbmFnLmNvbTpwYXNzd29yZA==
19
+ - Basic QlVHU05BR19VU0VSX0VNQUlMOkJVR1NOQUdfUEFTU1dPUkQ=
20
20
  Accept-Encoding:
21
21
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
22
22
  Accept:
@@ -84,7 +84,7 @@ http_interactions:
84
84
  X-Bugsnag-Api:
85
85
  - 'true'
86
86
  Authorization:
87
- - Basic c3VwcG9ydEBidWdzbmFnLmNvbTpwYXNzd29yZA==
87
+ - Basic QlVHU05BR19VU0VSX0VNQUlMOkJVR1NOQUdfUEFTU1dPUkQ=
88
88
  Accept-Encoding:
89
89
  - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
90
90
  Accept:
data/spec/spec_helper.rb CHANGED
@@ -23,9 +23,28 @@ VCR.configure do |c|
23
23
  c.cassette_library_dir = "spec/cassettes"
24
24
  c.hook_into :webmock
25
25
  c.configure_rspec_metadata!
26
+
27
+ USER_AGENT_REGEX = /\ABugsnag API Ruby Gem \d+\.\d+\.\d+\z/
28
+ HEADERS_SET_BY_BUGSNAG = ["Content-Type", "X-Version", "X-Bugsnag-Api", "Authorization"]
29
+
30
+ user_agent_valid = lambda do |values|
31
+ return false if values.length != 1
32
+
33
+ values.first.match(USER_AGENT_REGEX)
34
+ end
35
+
36
+ header_matcher = lambda do |request_a, request_b|
37
+ return false unless user_agent_valid.(request_a.headers["User-Agent"])
38
+ return false unless user_agent_valid.(request_b.headers["User-Agent"])
39
+
40
+ HEADERS_SET_BY_BUGSNAG.all? do |header|
41
+ request_a.headers[header] == request_b.headers[header]
42
+ end
43
+ end
44
+
26
45
  c.default_cassette_options = {
27
- :record => ENV['TRAVIS'] ? :none : :once,
28
- :match_requests_on => [:method, :path]
46
+ :record => ENV['CI'] ? :none : :once,
47
+ :match_requests_on => [:method, :path, header_matcher]
29
48
  }
30
49
 
31
50
  c.filter_sensitive_data("https://api.bugsnag.com") { test_bugsnag_endpoint }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bugsnag-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Smith
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-28 00:00:00.000000000 Z
11
+ date: 2021-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sawyer
@@ -67,47 +67,47 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: 1.7.3
69
69
  - !ruby/object:Gem::Dependency
70
- name: json
70
+ name: webmock
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - ">"
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: 2.3.2
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - ">"
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: 2.3.2
83
83
  - !ruby/object:Gem::Dependency
84
- name: webmock
84
+ name: addressable
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - ">"
88
88
  - !ruby/object:Gem::Version
89
- version: 2.3.2
89
+ version: 2.3.6
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - ">"
95
95
  - !ruby/object:Gem::Version
96
- version: 2.3.2
96
+ version: 2.3.6
97
97
  - !ruby/object:Gem::Dependency
98
- name: addressable
98
+ name: json
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">"
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
- version: 2.3.6
103
+ version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ">"
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
- version: 2.3.6
110
+ version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rspec
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -249,7 +249,7 @@ homepage: https://github.com/bugsnag/bugsnag-api-ruby
249
249
  licenses:
250
250
  - MIT
251
251
  metadata: {}
252
- post_install_message:
252
+ post_install_message:
253
253
  rdoc_options: []
254
254
  require_paths:
255
255
  - lib
@@ -264,8 +264,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
264
264
  - !ruby/object:Gem::Version
265
265
  version: '0'
266
266
  requirements: []
267
- rubygems_version: 3.2.11
268
- signing_key:
267
+ rubygems_version: 3.2.22
268
+ signing_key:
269
269
  specification_version: 4
270
270
  summary: Bugsnag API toolkit for ruby
271
271
  test_files: