oauth2 2.0.0.rc2 → 2.0.0.rc3

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: dbd97bd821d080a346022a1be5b7cc638dcd21964f5f2eb1d5bef6c2feaa5d95
4
- data.tar.gz: d3b376e2ffdf58445da10fb6dfffd9268a33b640e50394e57915b68fb0c6e6a9
3
+ metadata.gz: 0e2faffc19628919996428503133639534edbd8b3de6924811665c73bd24629d
4
+ data.tar.gz: 20d14dffb4e3ef670ee62762d73cf64e1e8312520c57a6d6602a27f623a27da8
5
5
  SHA512:
6
- metadata.gz: a6659d15e190363eb065b089bb2c16c1a1a76681a02608a2630f0b4af5c0ac8c7e23e479e3b77400298f861675030c218e11357518729c12d2c6c24e0a49f93f
7
- data.tar.gz: 4b168e3dd8de638369477e59bbbbf6804fc29528dbf191718d7a4ceb885f359b6212856e9319ede017b91166be131105c7310677ce7b297659ed4d0412af7c13
6
+ metadata.gz: 51e8ddd541f7197a3e6d08f35cfc09b7839218e3b4022bea854930fe49a78fe38f26c76c40f70be61f39282efa6c6a1ca7bcb5515a889dea6eb5bd9e3d6cb515
7
+ data.tar.gz: 46fa2325488eb90f8133806f90a6a6eb734d1b9fd25998d5dfdb2e690babbfe30d0d6f5112e57e33fed64fbb50b1ca24d1ea922adc00cd2819a3746c703650c8
data/CHANGELOG.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # Changelog
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
- The format (since v2.0.0) is based on [Keep a Changelog v1](https://keepachangelog.com/en/1.0.0/),
4
+ The format (since v2) is based on [Keep a Changelog v1](https://keepachangelog.com/en/1.0.0/),
5
5
  and this project adheres to [Semantic Versioning v2](https://semver.org/spec/v2.0.0.html).
6
6
 
7
- ## [Unreleased]
7
+ ## [2.0.0.rc3] - 2022-06-16
8
8
  ### Added
9
9
  - [#158](https://github.com/oauth-xx/oauth2/pull/158), [#344](https://github.com/oauth-xx/oauth2/pull/344) - Optionally pass raw response to parsers (@niels)
10
10
  - [#190](https://github.com/oauth-xx/oauth2/pull/190), [#332](https://github.com/oauth-xx/oauth2/pull/332), [#334](https://github.com/oauth-xx/oauth2/pull/334), [#335](https://github.com/oauth-xx/oauth2/pull/335), [#360](https://github.com/oauth-xx/oauth2/pull/360), [#426](https://github.com/oauth-xx/oauth2/pull/426), [#427](https://github.com/oauth-xx/oauth2/pull/427), [#461](https://github.com/oauth-xx/oauth2/pull/461) - Documentation (@josephpage, @pboling, @meganemura, @joshRpowell, @elliotcm)
@@ -60,6 +60,9 @@ and this project adheres to [Semantic Versioning v2](https://semver.org/spec/v2.
60
60
  - [#472](https://github.com/oauth-xx/oauth2/pull/472) - **Security**: Add checks to enforce `client_secret` is *never* passed in authorize_url query params for `implicit` and `auth_code` grant types (@dfockler)
61
61
  - [#482](https://github.com/oauth-xx/oauth2/pull/482) - _Documentation_: Update last of `intridea` links to `oauth-xx` (@pboling)
62
62
  - [#536](https://github.com/oauth-xx/oauth2/pull/536) - **Security**: Compatibility with more (and recent) Ruby OpenSSL versions, Github Actions, Rubocop updated, analogous to [#535](https://github.com/oauth-xx/oauth2/pull/535) on `1-4-stable` branch (@pboling)
63
+ - [#595](https://github.com/oauth-xx/oauth2/pull/595) - Graceful handling of empty responses from `Client#get_token`, respecting `:raise_errors` config (@stanhu)
64
+ - [#596](https://github.com/oauth-xx/oauth2/pull/596) - Consistency between `AccessToken#refresh` and `Client#get_token` named arguments (@stanhu)
65
+ - [#598](https://github.com/oauth-xx/oauth2/pull/598) - Fix unparseable data not raised as error in `Client#get_token`, respecting `:raise_errors` config (@stanhu)
63
66
  ### Removed
64
67
  - [#341](https://github.com/oauth-xx/oauth2/pull/341) - Remove Rdoc & Jeweler related files (@josephpage)
65
68
  - [#342](https://github.com/oauth-xx/oauth2/pull/342) - **BREAKING**: Dropped support for Ruby 1.8 (@josephpage)
data/lib/oauth2/client.rb CHANGED
@@ -273,13 +273,13 @@ module OAuth2
273
273
  def parse_response(response, access_token_opts, access_token_class)
274
274
  data = response.parsed
275
275
 
276
- if options[:raise_errors] && data.is_a?(Hash) && !access_token_class.contains_token?(data)
276
+ unless data.is_a?(Hash) && access_token_class.contains_token?(data)
277
+ return unless options[:raise_errors]
278
+
277
279
  error = Error.new(response)
278
280
  raise(error)
279
281
  end
280
282
 
281
- return unless data.is_a?(Hash)
282
-
283
283
  build_access_token(response, access_token_opts, access_token_class)
284
284
  end
285
285
 
@@ -2,62 +2,6 @@
2
2
 
3
3
  module OAuth2
4
4
  module Version
5
- VERSION = '2.0.0.rc2'.freeze
6
-
7
- module_function
8
-
9
- # The version number as a string
10
- #
11
- # @return [String]
12
- def to_s
13
- VERSION
14
- end
15
-
16
- # The major version
17
- #
18
- # @return [Integer]
19
- def major
20
- to_a[0].to_i
21
- end
22
-
23
- # The minor version
24
- #
25
- # @return [Integer]
26
- def minor
27
- to_a[1].to_i
28
- end
29
-
30
- # The patch version
31
- #
32
- # @return [Integer]
33
- def patch
34
- to_a[2].to_i
35
- end
36
-
37
- # The pre-release version, if any
38
- #
39
- # @return [String, NilClass]
40
- def pre
41
- to_a[3]
42
- end
43
-
44
- # The version number as a hash
45
- #
46
- # @return [Hash]
47
- def to_h
48
- {
49
- major: major,
50
- minor: minor,
51
- patch: patch,
52
- pre: pre,
53
- }
54
- end
55
-
56
- # The version number as an array
57
- #
58
- # @return [Array]
59
- def to_a
60
- VERSION.split('.')
61
- end
5
+ VERSION = '2.0.0.rc3'.freeze
62
6
  end
63
7
  end
data/lib/oauth2.rb CHANGED
@@ -6,6 +6,7 @@ require 'time'
6
6
 
7
7
  # third party gems
8
8
  require 'rash'
9
+ require 'version_gem'
9
10
 
10
11
  # includes gem files
11
12
  require 'oauth2/version'
@@ -25,3 +26,7 @@ require 'oauth2/response'
25
26
  # The namespace of this library
26
27
  module OAuth2
27
28
  end
29
+
30
+ OAuth2::Version.class_eval do
31
+ extend VersionGem::Basic
32
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oauth2
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.rc2
4
+ version: 2.0.0.rc3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Boling
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2022-06-12 00:00:00.000000000 Z
13
+ date: 2022-06-20 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: faraday
@@ -106,6 +106,20 @@ dependencies:
106
106
  - - "<"
107
107
  - !ruby/object:Gem::Version
108
108
  version: '1'
109
+ - !ruby/object:Gem::Dependency
110
+ name: version_gem
111
+ requirement: !ruby/object:Gem::Requirement
112
+ requirements:
113
+ - - "~>"
114
+ - !ruby/object:Gem::Version
115
+ version: '1.0'
116
+ type: :runtime
117
+ prerelease: false
118
+ version_requirements: !ruby/object:Gem::Requirement
119
+ requirements:
120
+ - - "~>"
121
+ - !ruby/object:Gem::Version
122
+ version: '1.0'
109
123
  - !ruby/object:Gem::Dependency
110
124
  name: addressable
111
125
  requirement: !ruby/object:Gem::Requirement
@@ -293,10 +307,10 @@ licenses:
293
307
  - MIT
294
308
  metadata:
295
309
  homepage_uri: https://github.com/oauth-xx/oauth2
296
- source_code_uri: https://github.com/oauth-xx/oauth2/tree/v2.0.0.rc2
297
- changelog_uri: https://github.com/oauth-xx/oauth2/blob/v2.0.0.rc2/CHANGELOG.md
310
+ source_code_uri: https://github.com/oauth-xx/oauth2/tree/v2.0.0.rc3
311
+ changelog_uri: https://github.com/oauth-xx/oauth2/blob/v2.0.0.rc3/CHANGELOG.md
298
312
  bug_tracker_uri: https://github.com/oauth-xx/oauth2/issues
299
- documentation_uri: https://www.rubydoc.info/gems/oauth2/2.0.0.rc2
313
+ documentation_uri: https://www.rubydoc.info/gems/oauth2/2.0.0.rc3
300
314
  wiki_uri: https://github.com/oauth-xx/oauth2/wiki
301
315
  rubygems_mfa_required: 'true'
302
316
  post_install_message:
@@ -314,7 +328,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
314
328
  - !ruby/object:Gem::Version
315
329
  version: 1.3.1
316
330
  requirements: []
317
- rubygems_version: 3.3.15
331
+ rubygems_version: 3.3.16
318
332
  signing_key:
319
333
  specification_version: 4
320
334
  summary: A Ruby wrapper for the OAuth 2.0 protocol.