oauth2 2.0.0.rc1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -2
- data/lib/oauth2/access_token.rb +1 -1
- data/lib/oauth2/client.rb +3 -1
- data/lib/oauth2/version.rb +1 -57
- data/lib/oauth2.rb +5 -0
- metadata +22 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7bd40b127f03fb47d5d897e4dd917ef3530fe06a863ce40485d3e9d02db32bc7
|
4
|
+
data.tar.gz: 331dd1ee11d2e9490372c8c2106ca3492c9e743b066510ba3b111c7c0e8c5834
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33a5d808e3388045e441fb386793cfdd69264af585f0582e044f59a736276dbe3d84c9f98be77cc5d0b9f29c3cc569c61721dfd5816d2654b57f6170213ed8a1
|
7
|
+
data.tar.gz: 9be4ba6cf11c62156b2f25fae2f04fb556166f4cbb7b8997d46af525968519073fcd6380008a2cc45ddb38986e0267becd7dfcc4f8f23560c437a2ce6f3be348
|
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
|
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
|
-
## [
|
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/access_token.rb
CHANGED
@@ -88,7 +88,7 @@ module OAuth2
|
|
88
88
|
#
|
89
89
|
# @return [AccessToken] a new AccessToken
|
90
90
|
# @note options should be carried over to the new AccessToken
|
91
|
-
def refresh(params = {}, access_token_opts = {}, access_token_class
|
91
|
+
def refresh(params = {}, access_token_opts = {}, access_token_class: self.class)
|
92
92
|
raise('A refresh_token is not available') unless refresh_token
|
93
93
|
|
94
94
|
params[:grant_type] = 'refresh_token'
|
data/lib/oauth2/client.rb
CHANGED
@@ -273,7 +273,9 @@ module OAuth2
|
|
273
273
|
def parse_response(response, access_token_opts, access_token_class)
|
274
274
|
data = response.parsed
|
275
275
|
|
276
|
-
|
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
|
data/lib/oauth2/version.rb
CHANGED
@@ -2,62 +2,6 @@
|
|
2
2
|
|
3
3
|
module OAuth2
|
4
4
|
module Version
|
5
|
-
VERSION = '2.0.0
|
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'.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
|
4
|
+
version: 2.0.0
|
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-
|
13
|
+
date: 2022-06-21 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
|
297
|
-
changelog_uri: https://github.com/oauth-xx/oauth2/blob/v2.0.0
|
310
|
+
source_code_uri: https://github.com/oauth-xx/oauth2/tree/v2.0.0
|
311
|
+
changelog_uri: https://github.com/oauth-xx/oauth2/blob/v2.0.0/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
|
313
|
+
documentation_uri: https://www.rubydoc.info/gems/oauth2/2.0.0
|
300
314
|
wiki_uri: https://github.com/oauth-xx/oauth2/wiki
|
301
315
|
rubygems_mfa_required: 'true'
|
302
316
|
post_install_message:
|
@@ -310,11 +324,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
310
324
|
version: 2.2.0
|
311
325
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
312
326
|
requirements:
|
313
|
-
- - "
|
327
|
+
- - ">="
|
314
328
|
- !ruby/object:Gem::Version
|
315
|
-
version:
|
329
|
+
version: '0'
|
316
330
|
requirements: []
|
317
|
-
rubygems_version: 3.3.
|
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.
|