signet 0.9.2 → 0.10.0

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
  SHA256:
3
- metadata.gz: 680cfcd2752495cc3e2086d74b858d6d279b78a223a2102e1a076736c3dd2fd9
4
- data.tar.gz: 3e073eeb03f3017b17ca776cb6c7a1c7b6495cebe61a0931206af608a736eb33
3
+ metadata.gz: cca16d5ecdcc2714f91dda26893593bc4864b3108fb705b02df3267e2deb5864
4
+ data.tar.gz: 06bd27996b7e0bcc297934f89727be25d1027ae623d94a72635c7ce40edf9d10
5
5
  SHA512:
6
- metadata.gz: 0bd67c59d78d3e1b10f54de27168bc95022b3b36ed001773cc83ba06eb36cfa8a81d244da724952b7c88a4a9a272fa4ab128af9c1774683460392167302777bc
7
- data.tar.gz: 4516060a3baced5581ad3534cc13d195a5855c97d4bdbd1fe4a801034ef80d320527c692943cf37ae36d55dd889b0598c37966d9162a5464cd5fac76e8e2b13e
6
+ metadata.gz: 86a51a0441913e042ed13cd8667168cd7a37e5787714a50b361b5b6e37536be723a22132e7782ee5c8605d01bff35d2acb821f8e14d809f8917815d7c7084542
7
+ data.tar.gz: 13796569d062502f45820b91085a555858d1cce5bd53a4133e230023aca5bfbcbbee3223ea0dbe3393669c91635d0a2142a5d898d2a9800cc5a3e74413fc705e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 0.10.0 (2018-09-21)
2
+ * Add UnexpectedStatusError class for http status errors that are not handled.
3
+
1
4
  ## 0.9.2 (2018-09-12)
2
5
  * Update issued_at correctly when it is set simultaneously with expires_in.
3
6
 
data/lib/signet/errors.rb CHANGED
@@ -39,6 +39,11 @@ module Signet
39
39
  class RemoteServerError < StandardError
40
40
  end
41
41
 
42
+ ##
43
+ # An error indicating that the server sent an unexpected http status
44
+ class UnexpectedStatusError < StandardError
45
+ end
46
+
42
47
  ##
43
48
  # An error indicating the remote server refused to authorize the client.
44
49
  class AuthorizationError < StandardError
@@ -1006,9 +1006,7 @@ module Signet
1006
1006
  if body.to_s.strip.length > 0
1007
1007
  message += " Server message:\n#{response.body.to_s.strip}"
1008
1008
  end
1009
- raise ::Signet::AuthorizationError.new(
1010
- message, :response => response
1011
- )
1009
+ raise ::Signet::UnexpectedStatusError.new(message)
1012
1010
  end
1013
1011
  end
1014
1012
 
@@ -17,8 +17,8 @@ unless defined? Signet::VERSION
17
17
  module Signet
18
18
  module VERSION
19
19
  MAJOR = 0
20
- MINOR = 9
21
- TINY = 2
20
+ MINOR = 10
21
+ TINY = 0
22
22
  PRE = nil
23
23
 
24
24
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
@@ -589,7 +589,7 @@ describe Signet::OAuth2::Client, 'configured for Google userinfo API' do
589
589
  stubs.verify_stubbed_calls
590
590
  end
591
591
 
592
- it 'should raise an error if the token server gives an unexpected status' do
592
+ it 'should raise an unexpected error if the token server gives an unexpected status' do
593
593
  @client.client_id = 'client-12345'
594
594
  @client.client_secret = 'secret-12345'
595
595
  stubs = Faraday::Adapter::Test::Stubs.new do |stub|
@@ -604,7 +604,7 @@ describe Signet::OAuth2::Client, 'configured for Google userinfo API' do
604
604
  @client.fetch_access_token!(
605
605
  :connection => connection
606
606
  )
607
- end).to raise_error(Signet::AuthorizationError)
607
+ end).to raise_error(Signet::UnexpectedStatusError)
608
608
  stubs.verify_stubbed_calls
609
609
  end
610
610
 
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.9.2
4
+ version: 0.10.0
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: 2018-09-13 00:00:00.000000000 Z
12
+ date: 2018-09-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: addressable