signet 0.7.1 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5f8e1b810d15d33a281c0088f76f3e555b5c55c7
4
- data.tar.gz: 4a7122855ca4411fa1deb9bde39e6b229625a622
3
+ metadata.gz: ec4912c2e8dee5bddbb079ad27efb8d99654abaf
4
+ data.tar.gz: 3e9118048022e46c0e50a25256e2448283ace5df
5
5
  SHA512:
6
- metadata.gz: 0f260df933e4df55df1731c1437b06b6e120bea0b6b86869c6bf6e74159504ce11782abc825d0c0cb02c5ae5e17ffb424e10ccb8b0ce353354bcb883d5fe0316
7
- data.tar.gz: ab2c6ad5f71b8f7d27b89bd16e3c8d3829ce305b66398267d77cbd779e865b87214afc7f4ee3ccf9302ae41bf3d0f409cdc09bd0009d5faf12f8e898cc52a1c2
6
+ metadata.gz: 48faf986e4169b761eabc7b03268e427417ce2cb7aa575dd6364e4e3883a74492b6b554c3ea950455229af51dcaab31b6fdddcdee8836f1b5361ad8c1408daf1
7
+ data.tar.gz: 6689401b7e31bf871e4264e8d12810aea2821220c05d9afb962e875b61104b085c1275e12a9c3279988f215982647918461af0a5c6108e964c2eb754c7d65618
@@ -1,3 +1,7 @@
1
+ # 0.7.2
2
+
3
+ * Don't assume Faraday form encoding middleware is present
4
+
1
5
  # 0.7.1
2
6
 
3
7
  * Fix an issue with date parsing
@@ -956,15 +956,16 @@ module Signet
956
956
  client = options[:connection] ||= Faraday.default_connection
957
957
  url = Addressable::URI.parse(self.token_credential_uri).normalize.to_s
958
958
  parameters = self.generate_access_token_request(options)
959
-
960
- response = client.post url, parameters
961
- if response.respond_to?(:status)
962
- # Faraday connection
959
+ if client.is_a?(Faraday::Connection)
960
+ response = client.post url,
961
+ Addressable::URI.form_encode(parameters),
962
+ { 'Content-Type' => 'application/x-www-form-urlencoded' }
963
963
  status = response.status.to_i
964
964
  body = response.body
965
965
  content_type = response.headers['Content-type']
966
966
  else
967
967
  # Hurley
968
+ response = client.post url, parameters
968
969
  status = response.status_code.to_i
969
970
  body = response.body
970
971
  content_type = response.header[:content_type]
@@ -18,7 +18,7 @@ unless defined? Signet::VERSION
18
18
  module VERSION
19
19
  MAJOR = 0
20
20
  MINOR = 7
21
- TINY = 1
21
+ TINY = 2
22
22
 
23
23
  STRING = [MAJOR, MINOR, TINY].join('.')
24
24
  end
@@ -263,7 +263,7 @@ describe Signet::OAuth2::Client, 'configured for assertions profile' do
263
263
  it 'should send valid access token request' do
264
264
  stubs = Faraday::Adapter::Test::Stubs.new do |stub|
265
265
  stub.post('/o/oauth2/token') do |env|
266
- params = env[:body]
266
+ params = Addressable::URI.form_unencode(env[:body])
267
267
  claim, header = JWT.decode(params.assoc("assertion").last, @key.public_key)
268
268
  expect(params.assoc("grant_type")).to eq ['grant_type','urn:ietf:params:oauth:grant-type:jwt-bearer']
269
269
  build_json_response({
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.7.1
4
+ version: 0.7.2
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: 2015-12-17 00:00:00.000000000 Z
12
+ date: 2015-12-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: addressable