signet 0.16.0 → 0.16.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: 7bc1d85dc2f8c727e54436bb38a284576cb81ea5ee0b0af58860678cb069bde9
4
- data.tar.gz: e0b149f3ee841fe5f30af08a2d0e6cebbfbc173d1370d4e4a8fc3b2109fa54a0
3
+ metadata.gz: 53569e11ad43433cd62b3d887bc959a632a835e6fa72ada936856967820e24df
4
+ data.tar.gz: 30970162c79ed861a09a6424bb84822685a2f5413d9ac1c0b5172cad3fa8a197
5
5
  SHA512:
6
- metadata.gz: 2ef091d389b3ac52e87dba96f8647a072acf11a346244600bca551b23ead3c24bb73d75209af7c79c261769d5589053c84a3bb837fb57f2b063e19d3516d0ad4
7
- data.tar.gz: d8a38134dd48453e0e976639b7ded1838ee363ab3b27917847f27e8de98adcb9f60f28359a90459a75537a03595417bd7275e4b3f291019cb13ea4eb09383495
6
+ metadata.gz: e4d619adaec9829803ac0fbc1e6f3c13f6d2b03caa64252bc35d4df0bcd72b9ef995b3f1a157c5ab02e328c88ca0d74b25edefebbf08e7ab41361017a5d5fdd8
7
+ data.tar.gz: ea2ed4ad72eace1d2ec0936a0243ca7ad07920cc9fee43a27f2c3f6de100370c60953a7842f6a416490e5bd93d7f17ff7771d7c7ef515fe8ad7ffcc4474547a1
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Release History
2
2
 
3
+ ### [0.16.1](https://www.github.com/googleapis/signet/compare/signet/v0.16.0...signet/v0.16.1) (2022-02-24)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * Support Faraday 2 ([f1c6cc3](https://www.github.com/googleapis/signet/commit/f1c6cc373876ea84281fadf72d7041976f2bc133))
9
+
3
10
  ## [0.16.0](https://www.github.com/googleapis/signet/compare/signet/v0.15.0...signet/v0.16.0) (2021-09-03)
4
11
 
5
12
 
@@ -926,7 +926,7 @@ module Signet
926
926
 
927
927
  content_type = request["Content-Type"].to_s
928
928
  content_type = content_type.split(";", 2).first if content_type.index ";"
929
- if request.method == :post && content_type == "application/x-www-form-urlencoded"
929
+ if request.http_method == :post && content_type == "application/x-www-form-urlencoded"
930
930
  # Serializes the body in case a hash/array was passed. Noop if already string like
931
931
  encoder = Faraday::Request::UrlEncoded.new(->(_env) {})
932
932
  encoder.call env
@@ -152,12 +152,12 @@ module Signet
152
152
  # @return [Hash] normalized request components
153
153
  def verify_request_components options = {}
154
154
  if options[:request]
155
- if options[:request].is_a?(Faraday::Request) || options[:request].is_a?(Array)
155
+ if options[:request].is_a? Faraday::Request
156
156
  request = options[:request]
157
157
  elsif options[:adapter]
158
158
  request = options[:adapter].adapt_request options[:request]
159
159
  end
160
- method = request.method
160
+ method = request.http_method
161
161
  uri = request.path
162
162
  headers = request.headers
163
163
  body = request.body
@@ -993,7 +993,14 @@ module Signet
993
993
  url = Addressable::URI.parse token_credential_uri
994
994
  parameters = generate_access_token_request options
995
995
  if client.is_a? Faraday::Connection
996
- client.basic_auth client_id, client_secret if options[:use_basic_auth]
996
+ if options[:use_basic_auth]
997
+ # The Basic Auth middleware usage differs before and after Faraday v2
998
+ if Gem::Version.new(Faraday::VERSION).segments.first >= 2
999
+ client.request :authorization, :basic, client_id, client_secret
1000
+ else
1001
+ client.request :basic_auth, client_id, client_secret
1002
+ end
1003
+ end
997
1004
  response = client.post url.normalize.to_s,
998
1005
  Addressable::URI.form_encode(parameters),
999
1006
  "Content-Type" => "application/x-www-form-urlencoded"
@@ -13,5 +13,5 @@
13
13
  # limitations under the License.
14
14
 
15
15
  module Signet
16
- VERSION = "0.16.0".freeze
16
+ VERSION = "0.16.1".freeze
17
17
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: signet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0
4
+ version: 0.16.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bob Aman
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-09-03 00:00:00.000000000 Z
12
+ date: 2022-02-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: addressable
@@ -31,20 +31,20 @@ dependencies:
31
31
  requirements:
32
32
  - - ">="
33
33
  - !ruby/object:Gem::Version
34
- version: 0.17.3
34
+ version: 0.17.5
35
35
  - - "<"
36
36
  - !ruby/object:Gem::Version
37
- version: '2.0'
37
+ version: '3.0'
38
38
  type: :runtime
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
41
41
  requirements:
42
42
  - - ">="
43
43
  - !ruby/object:Gem::Version
44
- version: 0.17.3
44
+ version: 0.17.5
45
45
  - - "<"
46
46
  - !ruby/object:Gem::Version
47
- version: '2.0'
47
+ version: '3.0'
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: jwt
50
50
  requirement: !ruby/object:Gem::Requirement
@@ -228,7 +228,7 @@ homepage: https://github.com/googleapis/signet
228
228
  licenses:
229
229
  - Apache-2.0
230
230
  metadata:
231
- changelog_uri: https://github.com/googleapis/signet/blob/master/CHANGELOG.md
231
+ changelog_uri: https://github.com/googleapis/signet/blob/main/CHANGELOG.md
232
232
  source_code_uri: https://github.com/googleapis/signet
233
233
  bug_tracker_uri: https://github.com/googleapis/signet/issues
234
234
  post_install_message:
@@ -248,7 +248,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
248
248
  - !ruby/object:Gem::Version
249
249
  version: 1.3.5
250
250
  requirements: []
251
- rubygems_version: 3.2.17
251
+ rubygems_version: 3.3.5
252
252
  signing_key:
253
253
  specification_version: 4
254
254
  summary: Signet is an OAuth 1.0 / OAuth 2.0 implementation.