access_token_agent 3.3.0 → 3.4.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
  SHA1:
3
- metadata.gz: 515e66f424f27274679e49bfcbbf7a3aaed85054
4
- data.tar.gz: 50c9d660e90a2eb12f24a494a9a5006ee8b76261
3
+ metadata.gz: 0fd60d58c6d3a25047e8dc8658c0e020aead8ae7
4
+ data.tar.gz: 91938386479d3131acf3f0276e2999847aed42a4
5
5
  SHA512:
6
- metadata.gz: a1c6a0ba6263f9378ea6b4481748a30f6166cf475872205766a8f63c7fb7b3470d8c240c0caa51850fac61e3929ad5546717aa5f36a522e6c3c44f009300e56c
7
- data.tar.gz: 310906cd857492000660581b8fe314a417ef7a7fd4cee338da50263f2d62dfb503a1adcf57d02d231b7cdcd54973a69cce9635d3599b14294e24b47160beba4d
6
+ metadata.gz: b4847fe284c32ae55edcfbee16843b9aac31862418f9ebdc98a565c75a83628a7690651272489eaa9bca2b38759e8ea005d05230c4b380491b101e8fd001bce0
7
+ data.tar.gz: ca7f0a9d57f69a6b097f4a531743f54c957533671701c7f33cea1cf744e83ddf026d0bc85709be7e3c10f430bf760f23d64c4659cdf783b801f09047a8990d09
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  *no unreleased changes*
4
4
 
5
+ ## 3.4.0
6
+
7
+ - Allows value of `token_type` to have any casing
8
+
5
9
  ## 3.3.0
6
10
 
7
11
  - Add `instance` accessor to `AccessTokenAgent::Connector`
data/README.md CHANGED
@@ -15,14 +15,14 @@ OAuth2 [client credentials flow](https://tools.ietf.org/html/rfc6749#section-4.4
15
15
  Add this line to your application's Gemfile:
16
16
 
17
17
  ```ruby
18
- gem 'access_token_agent', '~> 3.1'
18
+ gem 'access_token_agent', '~> 3.4'
19
19
  ```
20
20
 
21
21
  And then execute:
22
22
 
23
23
  $ bundle
24
24
 
25
- ## Basic Configuration
25
+ ## Basic configuration
26
26
 
27
27
  Create an instance of AccessTokenAgent::Connector with the desired
28
28
  configuration and use that instance to authenticate.
@@ -63,7 +63,7 @@ AccessTokenAgent::Connector.instance = AccessTokenAgent::Connector.new(...)
63
63
 
64
64
  ## Usage
65
65
 
66
- Setup an AcccessTokenAgent::Connector instance (see Configuration) and call
66
+ Set up an AcccessTokenAgent::Connector instance (see Configuration) and call
67
67
  `authenticate` on it to receive your access_token.
68
68
 
69
69
  ```ruby
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
21
21
  s.add_development_dependency 'pry', '~> 0.10'
22
22
  s.add_development_dependency 'rspec', '~> 3.4'
23
23
  s.add_development_dependency 'rubocop', '0.51'
24
- s.add_development_dependency 'simplecov', '~> 0.11'
24
+ s.add_development_dependency 'simplecov', '~> 0.16'
25
25
  s.add_development_dependency 'vcr', '~> 3.0'
26
26
  s.add_development_dependency 'webmock', '~> 1.24'
27
27
  end
@@ -0,0 +1,7 @@
1
+ module AccessTokenAgent
2
+ class MissingTokenType < Error
3
+ def initialize
4
+ super('The access token response did not contain a token type.')
5
+ end
6
+ end
7
+ end
@@ -1,4 +1,5 @@
1
1
  require 'access_token_agent/missing_access_token'
2
+ require 'access_token_agent/missing_token_type'
2
3
  require 'access_token_agent/unsupported_token_type_error'
3
4
 
4
5
  module AccessTokenAgent
@@ -21,7 +22,8 @@ module AccessTokenAgent
21
22
  private
22
23
 
23
24
  def validate_response(auth_response)
24
- unless auth_response['token_type'] == 'bearer'
25
+ raise MissingTokenType if auth_response['token_type'].nil?
26
+ unless auth_response['token_type'].downcase == 'bearer'
25
27
  raise UnsupportedTokenTypeError, auth_response['token_type']
26
28
  end
27
29
 
@@ -1,3 +1,3 @@
1
1
  module AccessTokenAgent
2
- VERSION = '3.3.0'.freeze
2
+ VERSION = '3.4.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: access_token_agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.0
4
+ version: 3.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Beko Käuferportal GmbH
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '0.11'
89
+ version: '0.16'
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: '0.11'
96
+ version: '0.16'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: vcr
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -144,6 +144,7 @@ files:
144
144
  - lib/access_token_agent/connector.rb
145
145
  - lib/access_token_agent/error.rb
146
146
  - lib/access_token_agent/missing_access_token.rb
147
+ - lib/access_token_agent/missing_token_type.rb
147
148
  - lib/access_token_agent/token.rb
148
149
  - lib/access_token_agent/unauthorized_error.rb
149
150
  - lib/access_token_agent/unsupported_token_type_error.rb