Skip to content

Commit 0e8ccd5

Browse files
committed
Merge branch 'release/v2.0.11' into 'main'
Release/v2.0.11 See merge request oauth-xx/oauth2!651
2 parents ac2d0c9 + 07efc2b commit 0e8ccd5

39 files changed

+1386
-332
lines changed

.qlty/qlty.toml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# For a guide to configuration, visit https://qlty.sh/d/config
2+
# Or for a full reference, visit https://qlty.sh/d/qlty-toml
3+
config_version = "0"
4+
5+
exclude_patterns = [
6+
"*_min.*",
7+
"*-min.*",
8+
"*.min.*",
9+
"**/.yarn/**",
10+
"**/*.d.ts",
11+
"**/assets/**",
12+
"**/bin/**",
13+
"**/bower_components/**",
14+
"**/build/**",
15+
"**/cache/**",
16+
"**/config/**",
17+
"**/.devcontainer",
18+
"**/db/**",
19+
"**/deps/**",
20+
"**/dist/**",
21+
"**/doc/**",
22+
"**/extern/**",
23+
"**/external/**",
24+
"**/generated/**",
25+
"**/Godeps/**",
26+
"**/gradlew/**",
27+
"**/mvnw/**",
28+
"**/node_modules/**",
29+
"**/protos/**",
30+
"**/seed/**",
31+
"**/target/**",
32+
"**/templates/**",
33+
"**/testdata/**",
34+
"**/vendor/**",
35+
]
36+
37+
38+
test_patterns = [
39+
"**/test/**",
40+
"**/spec/**",
41+
"**/*.test.*",
42+
"**/*.spec.*",
43+
"**/*_test.*",
44+
"**/*_spec.*",
45+
"**/test_*.*",
46+
"**/spec_*.*",
47+
]
48+
49+
[smells]
50+
mode = "comment"
51+
52+
[smells.boolean_logic]
53+
threshold = 4
54+
enabled = true
55+
56+
[smells.file_complexity]
57+
threshold = 55
58+
enabled = false
59+
60+
[smells.return_statements]
61+
threshold = 4
62+
enabled = true
63+
64+
[smells.nested_control_flow]
65+
threshold = 4
66+
enabled = true
67+
68+
[smells.function_parameters]
69+
threshold = 4
70+
enabled = true
71+
72+
[smells.function_complexity]
73+
threshold = 5
74+
enabled = true
75+
76+
[smells.duplication]
77+
enabled = true
78+
threshold = 20

.rubocop_gradual.lock

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
[9, 9, 25, "ThreadSafety/ClassInstanceVariable: Avoid class instance variables.", 2012823020],
1919
[13, 9, 25, "ThreadSafety/ClassInstanceVariable: Avoid class instance variables.", 2012823020]
2020
],
21-
"lib/oauth2/response.rb:2808363818": [
22-
[35, 5, 204, "Style/ClassMethodsDefinitions: Use `class << self` to define a class method.", 996912427]
21+
"lib/oauth2/response.rb:2054901929": [
22+
[53, 5, 204, "Style/ClassMethodsDefinitions: Use `class << self` to define a class method.", 996912427]
2323
],
24-
"oauth2.gemspec:1301437182": [
24+
"oauth2.gemspec:3059367295": [
2525
[5, 23, 12, "Gemspec/RubyVersionGlobalsUsage: Do not use `RUBY_VERSION` in gemspec file.", 31296028]
2626
],
2727
"spec/oauth2/access_token_spec.rb:1202129469": [
@@ -37,23 +37,23 @@
3737
[69, 15, 38, "RSpec/ContextWording: Context description should match /^when\\b/, /^with\\b/, or /^without\\b/.", 1480816240],
3838
[79, 13, 23, "RSpec/ContextWording: Context description should match /^when\\b/, /^with\\b/, or /^without\\b/.", 2314399065]
3939
],
40-
"spec/oauth2/client_spec.rb:1455422151": [
40+
"spec/oauth2/client_spec.rb:3334307042": [
4141
[6, 1, 29, "RSpec/SpecFilePathFormat: Spec path should end with `o_auth2/client*_spec.rb`.", 439549885],
4242
[175, 7, 492, "RSpec/NoExpectationExample: No expectation found in this example.", 1272021224],
4343
[194, 7, 592, "RSpec/NoExpectationExample: No expectation found in this example.", 3428877205],
4444
[207, 15, 20, "RSpec/ContextWording: Context description should match /^when\\b/, /^with\\b/, or /^without\\b/.", 2320605227],
4545
[222, 15, 20, "RSpec/ContextWording: Context description should match /^when\\b/, /^with\\b/, or /^without\\b/.", 1276531672],
4646
[237, 15, 43, "RSpec/ContextWording: Context description should match /^when\\b/, /^with\\b/, or /^without\\b/.", 1383956904],
4747
[252, 15, 43, "RSpec/ContextWording: Context description should match /^when\\b/, /^with\\b/, or /^without\\b/.", 3376202107],
48-
[827, 5, 360, "RSpec/NoExpectationExample: No expectation found in this example.", 536201463],
49-
[836, 5, 461, "RSpec/NoExpectationExample: No expectation found in this example.", 3392600621],
50-
[847, 5, 340, "RSpec/NoExpectationExample: No expectation found in this example.", 244592251],
51-
[975, 11, 99, "Style/ClassMethodsDefinitions: Use `class << self` to define a class method.", 3084776886],
52-
[979, 11, 82, "Style/ClassMethodsDefinitions: Use `class << self` to define a class method.", 1524553529],
53-
[987, 7, 89, "RSpec/NoExpectationExample: No expectation found in this example.", 4609419],
54-
[1075, 11, 99, "Style/ClassMethodsDefinitions: Use `class << self` to define a class method.", 3084776886],
55-
[1079, 11, 82, "Style/ClassMethodsDefinitions: Use `class << self` to define a class method.", 1524553529],
56-
[1159, 17, 12, "RSpec/ContextWording: Context description should match /^when\\b/, /^with\\b/, or /^without\\b/.", 664794325]
48+
[839, 5, 360, "RSpec/NoExpectationExample: No expectation found in this example.", 536201463],
49+
[848, 5, 461, "RSpec/NoExpectationExample: No expectation found in this example.", 3392600621],
50+
[859, 5, 340, "RSpec/NoExpectationExample: No expectation found in this example.", 244592251],
51+
[987, 11, 99, "Style/ClassMethodsDefinitions: Use `class << self` to define a class method.", 3084776886],
52+
[991, 11, 82, "Style/ClassMethodsDefinitions: Use `class << self` to define a class method.", 1524553529],
53+
[999, 7, 89, "RSpec/NoExpectationExample: No expectation found in this example.", 4609419],
54+
[1087, 11, 99, "Style/ClassMethodsDefinitions: Use `class << self` to define a class method.", 3084776886],
55+
[1091, 11, 82, "Style/ClassMethodsDefinitions: Use `class << self` to define a class method.", 1524553529],
56+
[1171, 17, 12, "RSpec/ContextWording: Context description should match /^when\\b/, /^with\\b/, or /^without\\b/.", 664794325]
5757
],
5858
"spec/oauth2/error_spec.rb:1692696277": [
5959
[23, 1, 28, "RSpec/SpecFilePathFormat: Spec path should end with `o_auth2/error*_spec.rb`.", 3385870076],
@@ -65,9 +65,8 @@
6565
[375, 11, 534, "RSpec/NoExpectationExample: No expectation found in this example.", 3347340910],
6666
[391, 11, 210, "RSpec/NoExpectationExample: No expectation found in this example.", 3948582233]
6767
],
68-
"spec/oauth2/response_spec.rb:3742350944": [
69-
[3, 1, 31, "RSpec/SpecFilePathFormat: Spec path should end with `o_auth2/response*_spec.rb`.", 3190869319],
70-
[317, 33, 2, "RSpec/BeEq: Prefer `be` over `eq`.", 5860785]
68+
"spec/oauth2/response_spec.rb:2248532534": [
69+
[3, 1, 31, "RSpec/SpecFilePathFormat: Spec path should end with `o_auth2/response*_spec.rb`.", 3190869319]
7170
],
7271
"spec/oauth2/strategy/assertion_spec.rb:793170256": [
7372
[6, 1, 42, "RSpec/SpecFilePathFormat: Spec path should end with `o_auth2/strategy/assertion*_spec.rb`.", 3665690869]

CHANGELOG.md

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,37 @@ and this project adheres to [Semantic Versioning v2](https://semver.org/spec/v2.
66

77
## [Unreleased]
88
### Added
9+
### Changed
10+
### Deprecated
11+
### Removed
12+
### Fixed
13+
### Security
14+
15+
## [2.0.11] - 2025-05-23
16+
- TAG: [v2.0.11][2.0.11t]
17+
- COVERAGE: 100.00% -- 518/518 lines in 14 files
18+
- BRANCH COVERAGE: 100.00% -- 172/172 branches in 14 files
19+
- 80.00% documented
20+
### Added
21+
- [gh651](https://github.com/oauth-xx/oauth2/pull/651) - `:snaky_hash_klass` option (@pboling)
22+
- More documentation
923
- Codeberg as ethical mirror (@pboling)
1024
- https://codeberg.org/oauth-xx/oauth2
1125
- Don't check for cert if SKIP_GEM_SIGNING is set (@pboling)
1226
- All runtime deps, including oauth-xx sibling gems, are now tested against HEAD (@pboling)
13-
- YARD config, GFM compatible with relative file links
14-
- Documentation site on GitHub Pages
27+
- YARD config, GFM compatible with relative file links (@pboling)
28+
- Documentation site on GitHub Pages (@pboling)
1529
- [oauth2.galtzo.com](https://oauth2.galtzo.com)
16-
- [!649](https://gitlab.com/oauth-xx/oauth2/-/merge_requests/649) - Test compatibility with all key minor versions of Hashie v0, v1, v2, v3, v4, v5, HEAD
30+
- [!649](https://gitlab.com/oauth-xx/oauth2/-/merge_requests/649) - Test compatibility with all key minor versions of Hashie v0, v1, v2, v3, v4, v5, HEAD (@pboling)
31+
- [gh651](https://github.com/oauth-xx/oauth2/pull/651) - Mock OAuth2 server for testing (@pboling)
32+
- https://github.com/navikt/mock-oauth2-server
1733
### Changed
18-
- Updated `spec.homepage_uri` in gemspec to GitHub Pages YARD documentation site
19-
### Deprecated
20-
### Removed
34+
- [gh651](https://github.com/oauth-xx/oauth2/pull/651) - Upgraded to snaky_hash v2.0.3 (@pboling)
35+
- Provides solution for serialization issues
36+
- Updated `spec.homepage_uri` in gemspec to GitHub Pages YARD documentation site (@pboling)
2137
### Fixed
38+
- [gh650](https://github.com/oauth-xx/oauth2/pull/650) - Regression in return type of `OAuth2::Response#parsed` (@pboling)
2239
- Incorrect documentation related to silencing warnings (@pboling)
23-
### Security
2440

2541
## [2.0.10] - 2025-05-17
2642
- TAG: [v2.0.10][2.0.10t]
@@ -379,7 +395,9 @@ and this project adheres to [Semantic Versioning v2](https://semver.org/spec/v2.
379395

380396
[gemfiles/readme]: gemfiles/README.md
381397

382-
[Unreleased]: https://gitlab.com/oauth-xx/oauth2/-/compare/v2.0.10...HEAD
398+
[Unreleased]: https://gitlab.com/oauth-xx/oauth2/-/compare/v2.0.11...HEAD
399+
[2.0.11]: https://gitlab.com/oauth-xx/oauth2/-/compare/v2.0.10...v2.0.11
400+
[2.0.11t]: https://gitlab.com/oauth-xx/oauth2/-/tags/v2.0.11
383401
[2.0.10]: https://gitlab.com/oauth-xx/oauth2/-/compare/v2.0.9...v2.0.10
384402
[2.0.10t]: https://gitlab.com/oauth-xx/oauth2/-/tags/v2.0.10
385403
[2.0.9]: https://gitlab.com/oauth-xx/oauth2/-/compare/v2.0.8...v2.0.9

Gemfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ GIT
2323
PATH
2424
remote: .
2525
specs:
26-
oauth2 (2.0.10)
26+
oauth2 (2.0.11)
2727
faraday (>= 0.17.3, < 4.0)
2828
jwt (>= 1.0, < 4.0)
2929
logger (~> 1.2)
3030
multi_xml (~> 0.5)
3131
rack (>= 1.2, < 4)
32-
snaky_hash (~> 2.0, >= 2.0.2)
32+
snaky_hash (~> 2.0, >= 2.0.3)
3333
version_gem (>= 1.1.8, < 3)
3434

3535
GEM
@@ -251,7 +251,7 @@ GEM
251251
simplecov-rcov (0.3.7)
252252
simplecov (>= 0.4.1)
253253
simplecov_json_formatter (0.1.4)
254-
snaky_hash (2.0.2)
254+
snaky_hash (2.0.3)
255255
hashie (>= 0.1.0, < 6)
256256
version_gem (>= 1.1.8, < 3)
257257
standard (1.50.0)

README.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
## 🔐 OAuth2
1111

12-
[![Version][👽versioni]][👽version] [![License: MIT][📄license-img]][📄license-ref] [![Downloads Rank][👽dl-ranki]][👽dl-rank] [![Open Source Helpers][👽oss-helpi]][👽oss-help] [![Depfu][🔑depfui♻️]][🔑depfu] [![Coveralls Test Coverage][🔑coveralls-img]][🔑coveralls] [![QLTY Test Coverage][🔑qlty-covi♻️]][🔑qlty-cov] [![CI Heads][🚎3-hd-wfi]][🚎3-hd-wf] [![CI Runtime Dependencies @ HEAD][🚎12-crh-wfi]][🚎12-crh-wf] [![CI Current][🚎11-c-wfi]][🚎11-c-wf] [![CI Truffle Ruby][🚎9-t-wfi]][🚎9-t-wf] [![CI JRuby][🚎10-j-wfi]][🚎10-j-wf] [![CI Supported][🚎6-s-wfi]][🚎6-s-wf] [![CI Legacy][🚎4-lg-wfi]][🚎4-lg-wf] [![CI Unsupported][🚎7-us-wfi]][🚎7-us-wf] [![CI Ancient][🚎1-an-wfi]][🚎1-an-wf] [![CI Caboose is an absolute WAGON][🚎13-cbs-wfi]][🚎13-cbs-wf] [![CI Test Coverage][🚎2-cov-wfi]][🚎2-cov-wf] [![CI Style][🚎5-st-wfi]][🚎5-st-wf] [![CodeQL][🖐codeQL-img]][🖐codeQL]
12+
[![Version][👽versioni]][👽version] [![License: MIT][📄license-img]][📄license-ref] [![Downloads Rank][👽dl-ranki]][👽dl-rank] [![Open Source Helpers][👽oss-helpi]][👽oss-help] [![Depfu][🔑depfui♻️]][🔑depfu] [![Coveralls Test Coverage][🔑coveralls-img]][🔑coveralls] [![QLTY Test Coverage][🔑qlty-covi♻️]][🔑qlty-cov] [![QLTY Maintainability][🔑qlty-mnti♻️]][🔑qlty-mnt] [![CI Heads][🚎3-hd-wfi]][🚎3-hd-wf] [![CI Runtime Dependencies @ HEAD][🚎12-crh-wfi]][🚎12-crh-wf] [![CI Current][🚎11-c-wfi]][🚎11-c-wf] [![CI Truffle Ruby][🚎9-t-wfi]][🚎9-t-wf] [![CI JRuby][🚎10-j-wfi]][🚎10-j-wf] [![CI Supported][🚎6-s-wfi]][🚎6-s-wf] [![CI Legacy][🚎4-lg-wfi]][🚎4-lg-wf] [![CI Unsupported][🚎7-us-wfi]][🚎7-us-wf] [![CI Ancient][🚎1-an-wfi]][🚎1-an-wf] [![CI Caboose is an absolute WAGON][🚎13-cbs-wfi]][🚎13-cbs-wf] [![CI Test Coverage][🚎2-cov-wfi]][🚎2-cov-wf] [![CI Style][🚎5-st-wfi]][🚎5-st-wf] [![CodeQL][🖐codeQL-img]][🖐codeQL]
1313

1414
---
1515

@@ -145,7 +145,7 @@ One of these might be what you are looking for:
145145
| Works with JRuby | [![JRuby 9.2 Compat][💎jruby-9.2i]][🚎10-j-wf] [![JRuby 9.3 Compat][💎jruby-9.3i]][🚎10-j-wf] [![JRuby 9.4 Compat][💎jruby-9.4i]][🚎10-j-wf] [![JRuby 10.0 Compat][💎jruby-c-i]][🚎11-c-wf] [![JRuby HEAD Compat][💎jruby-headi]][🚎3-hd-wf] |
146146
| Works with Truffle Ruby | [![Truffle Ruby 23.1 Compat][💎truby-23.1i]][🚎9-t-wf] [![Truffle Ruby 24.1 Compat][💎truby-c-i]][🚎11-c-wf] [![Truffle Ruby HEAD Compat][💎truby-headi]][🚎3-hd-wf] |
147147
| Works with MRI Ruby 3 | [![Ruby 3.0 Compat][💎ruby-3.0i]][🚎4-lg-wf] [![Ruby 3.1 Compat][💎ruby-3.1i]][🚎6-s-wf] [![Ruby 3.2 Compat][💎ruby-3.2i]][🚎6-s-wf] [![Ruby 3.3 Compat][💎ruby-3.3i]][🚎6-s-wf] [![Ruby 3.4 Compat][💎ruby-c-i]][🚎11-c-wf] [![Ruby HEAD Compat][💎ruby-headi]][🚎3-hd-wf] |
148-
| Works with MRI Ruby 2 | [![Ruby 2.3 Compat][💎ruby-2.3i]][🚎1-an-wf] [![Ruby 2.4 Compat][💎ruby-2.4i]][🚎1-an-wf] [![Ruby 2.5 Compat][💎ruby-2.5i]][🚎1-an-wf] [![Ruby 2.6 Compat][💎ruby-2.6i]][🚎7-us-wf] [![Ruby 2.7 Compat][💎ruby-2.7i]][🚎7-us-wf] |
148+
| Works with MRI Ruby 2 | [![Ruby 2.3 Compat][💎ruby-2.3i]][🚎13-cbs-wf] [![Ruby 2.4 Compat][💎ruby-2.4i]][🚎1-an-wf] [![Ruby 2.5 Compat][💎ruby-2.5i]][🚎1-an-wf] [![Ruby 2.6 Compat][💎ruby-2.6i]][🚎7-us-wf] [![Ruby 2.7 Compat][💎ruby-2.7i]][🚎7-us-wf] |
149149
| Source | [![Source on GitLab.com][📜src-gl-img]][📜src-gl] [![Source on CodeBerg.org][📜src-cb-img]][📜src-cb] [![Source on Github.com][📜src-gh-img]][📜src-gh] [![The best SHA: dQw4w9WgXcQ!][🧮kloc-img]][🧮kloc] |
150150
| Documentation | [![Discussion][⛳gg-discussions-img]][⛳gg-discussions] [![Current release on RubyDoc.info][📜docs-cr-rd-img]][🚎yard-current] [![HEAD on RubyDoc.info][📜docs-head-rd-img]][🚎yard-head] [![BDFL Blog][🚂bdfl-blog-img]][🚂bdfl-blog] [![Wiki][📜wiki-img]][📜wiki] |
151151
| Compliance | [![License: MIT][📄license-img]][📄license-ref] [![📄ilo-declaration-img]][📄ilo-declaration] [![Security Policy][🔐security-img]][🔐security] [![Contributor Covenant 2.1][🪇conduct-img]][🪇conduct] [![SemVer 2.0.0][📌semver-img]][📌semver] |
@@ -328,19 +328,17 @@ For more see [SECURITY.md][🔐security].
328328

329329
## What is new for v2.0?
330330

331-
- Officially support Ruby versions >= 2.7
332-
- Unofficially support Ruby versions >= 2.5
333-
- Incidentally support Ruby versions >= 2.2
331+
- Works with Ruby versions >= 2.2
334332
- Drop support for the expired MAC Draft (all versions)
335333
- Support IETF rfc7523 JWT Bearer Tokens
336334
- Support IETF rfc7231 Relative Location in Redirect
337335
- Support IETF rfc6749 Don't set oauth params when nil
338336
- Support IETF rfc7009 Token Revocation (since v2.0.10)
339337
- Support [OIDC 1.0 Private Key JWT](https://openid.net/specs/openid-connect-core-1_0.html#ClientAuthentication); based on the OAuth JWT assertion specification [(RFC 7523)](https://tools.ietf.org/html/rfc7523)
340338
- Support new formats, including from [jsonapi.org](http://jsonapi.org/format/): `application/vdn.api+json`, `application/vnd.collection+json`, `application/hal+json`, `application/problem+json`
341-
- Adds new option to `OAuth2::Client#get_token`:
339+
- Adds option to `OAuth2::Client#get_token`:
342340
- `:access_token_class` (`AccessToken`); user specified class to use for all calls to `get_token`
343-
- Adds new option to `OAuth2::AccessToken#initialize`:
341+
- Adds option to `OAuth2::AccessToken#initialize`:
344342
- `:expires_latency` (`nil`); number of seconds by which AccessToken validity will be reduced to offset latency
345343
- By default, keys are transformed to snake case.
346344
- Original keys will still work as previously, in most scenarios, thanks to [snaky_hash][snaky_hash] gem.
@@ -487,16 +485,16 @@ response.parsed.class.name # => SnakyHash::StringKeyed (from snaky_hash g
487485

488486
As of v2.0.11, if you need to serialize the parsed result, you can!
489487

490-
There are two ways to do this.
488+
There are two ways to do this, and the second option recommended.
489+
490+
1. Globally configure `SnakyHash::StringKeyed` to use the serializer. Put this in your code somewhere reasonable (like an initializer for Rails):
491491

492-
1. Global: put this in your code somewhere reasonable (like an initializer for Rails):
493492
```ruby
494493
SnakyHash::StringKeyed.class_eval do
495494
extend SnakyHash::Serializer
496495
end
497496
```
498497

499-
2.
500498

501499
#### What if I hate snakes and/or indifference?
502500

@@ -510,7 +508,7 @@ response.parsed.class.name # => Hash (just, regular old Hash)
510508
```
511509

512510
<details>
513-
<summary>Debugging</summary>
511+
<summary>Debugging & Logging</summary>
514512

515513
Set an environment variable as per usual (e.g. with [dotenv](https://github.com/bkeepers/dotenv)).
516514

0 commit comments

Comments
 (0)