oauth2 2.0.3 → 2.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 834cadcf40991f2fd88a74f9ee614992d17c087d5862a4f7243cb83874f87683
4
- data.tar.gz: 9a54a67d2def4e8232ff7b764ce70d87c4d9fb7125b72e234d07b84b507565b2
3
+ metadata.gz: fc4158398289799f1200f2706539766ebcec6b3be4c861427d9b11fb6f6a8d8f
4
+ data.tar.gz: cd7bec320053ae8d114f9c3f730ce7252872b2fbf0b4c716d5447ac1642b7e7e
5
5
  SHA512:
6
- metadata.gz: 190394d6e1d046de982b9ed978c54b810a15cbfbe41507c63f103a19be06b04d4a7f2a8cad4f3fc30c9cf4eed6314e353668b7e49d8e41826e1c460f944060ed
7
- data.tar.gz: 10bd8f3f468165150ce7d79c31d0a4c7be72322660ae7579bf579bf68054106f21d16b408c56eedcc3a2359f14c84c770fa89dec93d0811c2ed328aa7b365f00
6
+ metadata.gz: 57f0ddd1d875238c5b98e358cea1114fb09847c01af8231e2d6a6e6c70e928500bd3f2b45c566302f70481d802ff7db6b649105765692f7107542e49edf06e2b
7
+ data.tar.gz: 13e0e6fcf0b7090bd5068c08522fc5ca52b8f719d230e7355334785e9795581c011b437b6eca4897f86d30ef7dd856f924a8a3e5b1488e7c99a7fa595973368b
data/CHANGELOG.md CHANGED
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
4
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
+ ## [2.0.4] - 2022-07-01
8
+ ### Fixed
9
+ - [#618](https://github.com/oauth-xx/oauth2/pull/618) - In some scenarios the `snaky` option default value was not applied (@pboling)
10
+
7
11
  ## [2.0.3] - 2022-06-28
8
12
  ### Added
9
13
  - [#611](https://github.com/oauth-xx/oauth2/pull/611) - Proper deprecation warnings for `extract_access_token` argument (@pboling)
@@ -90,6 +94,9 @@ and this project adheres to [Semantic Versioning v2](https://semver.org/spec/v2.
90
94
  - [#589](https://github.com/oauth-xx/oauth2/pull/589), [#593](https://github.com/oauth-xx/oauth2/pull/593) - Remove support for expired MAC token draft spec (@stanhu)
91
95
  - [#590](https://github.com/oauth-xx/oauth2/pull/590) - _Dependency_: Removed `multi_json` (@stanhu)
92
96
 
97
+ ## [1.4.10] - 2022-07-01
98
+ - FIPS Compatibility [#587](https://github.com/oauth-xx/oauth2/pull/587) (@akostadinov)
99
+
93
100
  ## [1.4.9] - 2022-02-20
94
101
  - Fixes compatibility with Faraday v2 [572](https://github.com/oauth-xx/oauth2/issues/572)
95
102
  - Includes supported versions of Faraday in test matrix:
@@ -100,7 +107,7 @@ and this project adheres to [Semantic Versioning v2](https://semver.org/spec/v2.
100
107
 
101
108
  ## [1.4.8] - 2022-02-18
102
109
  - MFA is now required to push new gem versions (@pboling)
103
- - README overhaul w/ new Ruby Verion and Engine compatibility policies (@pboling)
110
+ - README overhaul w/ new Ruby Version and Engine compatibility policies (@pboling)
104
111
  - [#569](https://github.com/oauth-xx/oauth2/pull/569) Backport fixes ([#561](https://github.com/oauth-xx/oauth2/pull/561) by @ryogift), and add more fixes, to allow faraday 1.x and 2.x (@jrochkind)
105
112
  - Improve Code Coverage tracking (Coveralls, CodeCov, CodeClimate), and enable branch coverage (@pboling)
106
113
  - Add CodeQL, Security Policy, Funding info (@pboling)
@@ -229,7 +236,6 @@ and this project adheres to [Semantic Versioning v2](https://semver.org/spec/v2.
229
236
 
230
237
  ## [0.0.4] + [0.0.3] + [0.0.2] + [0.0.1] - 2010-04-22
231
238
 
232
- [Unreleased]: https://github.com/oauth-xx/oauth2/compare/v2.0.3...HEAD
233
239
  [0.0.1]: https://github.com/oauth-xx/oauth2/compare/311d9f4...v0.0.1
234
240
  [0.0.2]: https://github.com/oauth-xx/oauth2/compare/v0.0.1...v0.0.2
235
241
  [0.0.3]: https://github.com/oauth-xx/oauth2/compare/v0.0.2...v0.0.3
@@ -265,8 +271,11 @@ and this project adheres to [Semantic Versioning v2](https://semver.org/spec/v2.
265
271
  [1.4.7]: https://github.com/oauth-xx/oauth2/compare/v1.4.6...v1.4.7
266
272
  [1.4.8]: https://github.com/oauth-xx/oauth2/compare/v1.4.7...v1.4.8
267
273
  [1.4.9]: https://github.com/oauth-xx/oauth2/compare/v1.4.8...v1.4.9
268
- [2.0.0]: https://github.com/oauth-xx/oauth2/compare/v1.4.9...v2.0.0
274
+ [1.4.10]: https://github.com/oauth-xx/oauth2/compare/v1.4.9...v1.4.10
275
+ [2.0.0]: https://github.com/oauth-xx/oauth2/compare/v1.4.10...v2.0.0
269
276
  [2.0.1]: https://github.com/oauth-xx/oauth2/compare/v2.0.0...v2.0.1
270
277
  [2.0.2]: https://github.com/oauth-xx/oauth2/compare/v2.0.1...v2.0.2
271
278
  [2.0.3]: https://github.com/oauth-xx/oauth2/compare/v2.0.2...v2.0.3
279
+ [2.0.4]: https://github.com/oauth-xx/oauth2/compare/v2.0.3...v2.0.4
280
+ [Unreleased]: https://github.com/oauth-xx/oauth2/compare/v2.0.4...HEAD
272
281
  [gemfiles/readme]: gemfiles/README.md
data/README.md CHANGED
@@ -32,6 +32,7 @@ See the sibling `oauth` gem for OAuth 1.0 implementations in Ruby.
32
32
 
33
33
  | Version | Release Date | Readme |
34
34
  |---------|--------------|----------------------------------------------------------|
35
+ | 2.0.4 | 2022-07-01 | https://github.com/oauth-xx/oauth2/blob/v2.0.4/README.md |
35
36
  | 2.0.3 | 2022-06-28 | https://github.com/oauth-xx/oauth2/blob/v2.0.3/README.md |
36
37
  | 2.0.2 | 2022-06-24 | https://github.com/oauth-xx/oauth2/blob/v2.0.2/README.md |
37
38
  | 2.0.1 | 2022-06-22 | https://github.com/oauth-xx/oauth2/blob/v2.0.1/README.md |
@@ -43,18 +44,19 @@ See the sibling `oauth` gem for OAuth 1.0 implementations in Ruby.
43
44
  <details>
44
45
  <summary>1.4.x Readmes</summary>
45
46
 
46
- | Version | Release Date | Readme |
47
- |---------|--------------|----------------------------------------------------------|
48
- | 1.4.9 | Feb 20, 2022 | https://github.com/oauth-xx/oauth2/blob/v1.4.9/README.md |
49
- | 1.4.8 | Feb 18, 2022 | https://github.com/oauth-xx/oauth2/blob/v1.4.8/README.md |
50
- | 1.4.7 | Mar 19, 2021 | https://github.com/oauth-xx/oauth2/blob/v1.4.7/README.md |
51
- | 1.4.6 | Mar 19, 2021 | https://github.com/oauth-xx/oauth2/blob/v1.4.6/README.md |
52
- | 1.4.5 | Mar 18, 2021 | https://github.com/oauth-xx/oauth2/blob/v1.4.5/README.md |
53
- | 1.4.4 | Feb 12, 2020 | https://github.com/oauth-xx/oauth2/blob/v1.4.4/README.md |
54
- | 1.4.3 | Jan 29, 2020 | https://github.com/oauth-xx/oauth2/blob/v1.4.3/README.md |
55
- | 1.4.2 | Oct 1, 2019 | https://github.com/oauth-xx/oauth2/blob/v1.4.2/README.md |
56
- | 1.4.1 | Oct 13, 2018 | https://github.com/oauth-xx/oauth2/blob/v1.4.1/README.md |
57
- | 1.4.0 | Jun 9, 2017 | https://github.com/oauth-xx/oauth2/blob/v1.4.0/README.md |
47
+ | Version | Release Date | Readme |
48
+ |---------|--------------|-----------------------------------------------------------|
49
+ | 1.4.10 | Jul 1, 2022 | https://github.com/oauth-xx/oauth2/blob/v1.4.10/README.md |
50
+ | 1.4.9 | Feb 20, 2022 | https://github.com/oauth-xx/oauth2/blob/v1.4.9/README.md |
51
+ | 1.4.8 | Feb 18, 2022 | https://github.com/oauth-xx/oauth2/blob/v1.4.8/README.md |
52
+ | 1.4.7 | Mar 19, 2021 | https://github.com/oauth-xx/oauth2/blob/v1.4.7/README.md |
53
+ | 1.4.6 | Mar 19, 2021 | https://github.com/oauth-xx/oauth2/blob/v1.4.6/README.md |
54
+ | 1.4.5 | Mar 18, 2021 | https://github.com/oauth-xx/oauth2/blob/v1.4.5/README.md |
55
+ | 1.4.4 | Feb 12, 2020 | https://github.com/oauth-xx/oauth2/blob/v1.4.4/README.md |
56
+ | 1.4.3 | Jan 29, 2020 | https://github.com/oauth-xx/oauth2/blob/v1.4.3/README.md |
57
+ | 1.4.2 | Oct 1, 2019 | https://github.com/oauth-xx/oauth2/blob/v1.4.2/README.md |
58
+ | 1.4.1 | Oct 13, 2018 | https://github.com/oauth-xx/oauth2/blob/v1.4.1/README.md |
59
+ | 1.4.0 | Jun 9, 2017 | https://github.com/oauth-xx/oauth2/blob/v1.4.0/README.md |
58
60
  </details>
59
61
 
60
62
  <details>
@@ -144,7 +146,7 @@ The link tokens in the following sections should be kept ordered by the row and
144
146
  [📗next♻️]: https://github.com/oauth-xx/oauth2/milestone/15
145
147
  [📗next-img♻️]: https://img.shields.io/github/milestones/progress/oauth-xx/oauth2/15?label=Next%20Version
146
148
 
147
- <!-- 3️⃣ maintanence & linting -->
149
+ <!-- 3️⃣ maintenance & linting -->
148
150
  [⛳cclim-maint]: https://codeclimate.com/github/oauth-xx/oauth2/maintainability
149
151
  [⛳cclim-maint-img♻️]: https://api.codeclimate.com/v1/badges/688c612528ff90a46955/maintainability
150
152
  [🖇triage-help]: https://www.codetriage.com/oauth-xx/oauth2
@@ -229,7 +231,9 @@ If bundler is not being used to manage dependencies, install the gem by executin
229
231
 
230
232
  Available as part of the Tidelift Subscription.
231
233
 
232
- The maintainers of OAuth2 and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source packages you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact packages you use. [Learn more.](https://tidelift.com/subscription/pkg/rubygems-oauth2?utm_source=rubygems-oauth2&utm_medium=referral&utm_campaign=enterprise)
234
+ The maintainers of OAuth2 and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source packages you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact packages you use. [Learn more.][tidelift-ref]
235
+
236
+ [tidelift-ref]: https://tidelift.com/subscription/pkg/rubygems-oauth2?utm_source=rubygems-oauth2&utm_medium=referral&utm_campaign=enterprise
233
237
 
234
238
  ## Security contact information
235
239
 
@@ -289,13 +293,13 @@ fashion. If critical issues for a particular implementation exist at the time
289
293
  of a major release, support for that Ruby version may be dropped.
290
294
  </details>
291
295
 
292
- | | Ruby OAuth 2 Version | Maintenance Branch | Supported Officially | Supported Unofficially | Supported Incidentally |
293
- |:----|----------------------|--------------------|-------------------------|------------------------|------------------------|
294
- | 1️⃣ | 2.0.x | `master` | 2.7, 3.0, 3.1 | 2.5, 2.6 | 2.2, 2.3, 2.4 |
295
- | 2️⃣ | 1.4.x | `1-4-stable` | 2.5, 2.6, 2.7, 3.0, 3.1 | 2.1, 2.2, 2.3, 2.4 | 1.9, 2.0 |
296
- | 3️⃣ | older | N/A | Best of luck to you! | Please upgrade! | |
296
+ | | Ruby OAuth2 Version | Maintenance Branch | Supported Officially | Supported Unofficially | Supported Incidentally |
297
+ |:----|---------------------|--------------------|-------------------------|------------------------|------------------------|
298
+ | 1️⃣ | 2.0.x | `master` | 2.7, 3.0, 3.1 | 2.5, 2.6 | 2.2, 2.3, 2.4 |
299
+ | 2️⃣ | 1.4.x | `1-4-stable` | 2.5, 2.6, 2.7, 3.0, 3.1 | 2.1, 2.2, 2.3, 2.4 | 1.9, 2.0 |
300
+ | 3️⃣ | older | N/A | Best of luck to you! | Please upgrade! | |
297
301
 
298
- NOTE: The 1.4 series will only receive critical bug and security updates.
302
+ NOTE: The 1.4 series will only receive critical security updates.
299
303
  See [SECURITY.md][🚎sec-pol]
300
304
 
301
305
  ## Usage Examples
data/lib/oauth2/client.rb CHANGED
@@ -9,7 +9,7 @@ module OAuth2
9
9
 
10
10
  # The OAuth2::Client class
11
11
  class Client # rubocop:disable Metrics/ClassLength
12
- RESERVED_PARAM_KEYS = %w[headers parse].freeze
12
+ RESERVED_PARAM_KEYS = %w[body headers params parse snaky].freeze
13
13
 
14
14
  attr_reader :id, :secret, :site
15
15
  attr_accessor :options
@@ -108,7 +108,7 @@ module OAuth2
108
108
  # @option opts [Boolean] :raise_errors whether or not to raise an OAuth2::Error on 400+ status
109
109
  # code response for this request. Will default to client option
110
110
  # @option opts [Symbol] :parse @see Response::initialize
111
- # @option opts [Symbol] :snaky @see Response::initialize
111
+ # @option opts [true, false] :snaky (true) @see Response::initialize
112
112
  # @yield [req] @see Faraday::Connection#run_request
113
113
  def request(verb, url, opts = {}, &block)
114
114
  response = execute_request(verb, url, opts, &block)
@@ -149,7 +149,7 @@ module OAuth2
149
149
  #
150
150
  # @param params [Hash] a Hash of params for the token endpoint, except:
151
151
  # @option params [Symbol] :parse @see Response#initialize
152
- # @option params [true, false] :snaky @see Response#initialize
152
+ # @option params [true, false] :snaky (true) @see Response#initialize
153
153
  # @param access_token_opts [Hash] access token options, to pass to the AccessToken object
154
154
  # @param extract_access_token [Proc] proc that extracts the access token from the response (DEPRECATED)
155
155
  # @yield [req] @see Faraday::Connection#run_request
@@ -167,10 +167,9 @@ module OAuth2
167
167
 
168
168
  request_opts = {
169
169
  raise_errors: options[:raise_errors],
170
- parse: params.delete(:parse),
171
- snaky: params.delete(:snaky),
170
+ parse: params.fetch(:parse, Response::DEFAULT_OPTIONS[:parse]),
171
+ snaky: params.fetch(:snaky, Response::DEFAULT_OPTIONS[:snaky]),
172
172
  }
173
-
174
173
  params = authenticator.apply(params)
175
174
  headers = params.delete(:headers) || {}
176
175
  if options[:token_method] == :post
@@ -267,7 +266,10 @@ module OAuth2
267
266
  raise TimeoutError, e
268
267
  end
269
268
 
270
- Response.new(response, parse: opts[:parse], snaky: opts[:snaky])
269
+ parse = opts.fetch(:parse, Response::DEFAULT_OPTIONS[:parse])
270
+ snaky = opts.fetch(:snaky, Response::DEFAULT_OPTIONS[:snaky])
271
+
272
+ Response.new(response, parse: parse, snaky: snaky)
271
273
  end
272
274
 
273
275
  # Returns the authenticator object
@@ -7,6 +7,10 @@ require 'rack'
7
7
  module OAuth2
8
8
  # OAuth2::Response class
9
9
  class Response
10
+ DEFAULT_OPTIONS = {
11
+ parse: :automatic,
12
+ snaky: true,
13
+ }.freeze
10
14
  attr_reader :response
11
15
  attr_accessor :options
12
16
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OAuth2
4
4
  module Version
5
- VERSION = '2.0.3'.freeze
5
+ VERSION = '2.0.4'.freeze
6
6
  end
7
7
  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.3
4
+ version: 2.0.4
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-28 00:00:00.000000000 Z
13
+ date: 2022-07-01 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: faraday
@@ -112,14 +112,14 @@ dependencies:
112
112
  requirements:
113
113
  - - "~>"
114
114
  - !ruby/object:Gem::Version
115
- version: '1.0'
115
+ version: '1.1'
116
116
  type: :runtime
117
117
  prerelease: false
118
118
  version_requirements: !ruby/object:Gem::Requirement
119
119
  requirements:
120
120
  - - "~>"
121
121
  - !ruby/object:Gem::Version
122
- version: '1.0'
122
+ version: '1.1'
123
123
  - !ruby/object:Gem::Dependency
124
124
  name: addressable
125
125
  requirement: !ruby/object:Gem::Requirement
@@ -307,13 +307,24 @@ licenses:
307
307
  - MIT
308
308
  metadata:
309
309
  homepage_uri: https://github.com/oauth-xx/oauth2
310
- source_code_uri: https://github.com/oauth-xx/oauth2/tree/v2.0.3
311
- changelog_uri: https://github.com/oauth-xx/oauth2/blob/v2.0.3/CHANGELOG.md
310
+ source_code_uri: https://github.com/oauth-xx/oauth2/tree/v2.0.4
311
+ changelog_uri: https://github.com/oauth-xx/oauth2/blob/v2.0.4/CHANGELOG.md
312
312
  bug_tracker_uri: https://github.com/oauth-xx/oauth2/issues
313
- documentation_uri: https://www.rubydoc.info/gems/oauth2/2.0.3
313
+ documentation_uri: https://www.rubydoc.info/gems/oauth2/2.0.4
314
314
  wiki_uri: https://github.com/oauth-xx/oauth2/wiki
315
315
  rubygems_mfa_required: 'true'
316
- post_install_message:
316
+ post_install_message: |2+
317
+
318
+ You have installed oauth2 version OAuth2::Version, congratulations!
319
+
320
+ There are BREAKING changes, but most will not encounter them, and updating your code should be easy!
321
+
322
+ Please see:
323
+ • https://github.com/oauth-xx/oauth2#what-is-new-for-v20
324
+ • https://github.com/oauth-xx/oauth2/blob/master/CHANGELOG.md
325
+
326
+ Please report issues, and support the project! Thanks, |7eter l-|. l3oling
327
+
317
328
  rdoc_options: []
318
329
  require_paths:
319
330
  - lib