oauth2 1.4.0 → 1.4.5
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 +5 -5
- data/.github/dependabot.yml +8 -0
- data/.github/workflows/style.yml +37 -0
- data/.github/workflows/test.yml +58 -0
- data/.gitignore +19 -0
- data/.jrubyrc +1 -0
- data/.rspec +4 -0
- data/.rubocop.yml +112 -0
- data/.rubocop_rspec.yml +26 -0
- data/.rubocop_todo.yml +113 -0
- data/.ruby-version +1 -0
- data/.travis.yml +75 -0
- data/CHANGELOG.md +160 -0
- data/CODE_OF_CONDUCT.md +133 -0
- data/Gemfile +61 -0
- data/LICENSE +22 -0
- data/README.md +132 -22
- data/Rakefile +45 -0
- data/gemfiles/jruby_1.7.gemfile +11 -0
- data/gemfiles/jruby_9.0.gemfile +7 -0
- data/gemfiles/jruby_9.1.gemfile +3 -0
- data/gemfiles/jruby_9.2.gemfile +3 -0
- data/gemfiles/jruby_head.gemfile +3 -0
- data/gemfiles/ruby_1.9.gemfile +11 -0
- data/gemfiles/ruby_2.0.gemfile +6 -0
- data/gemfiles/ruby_head.gemfile +9 -0
- data/gemfiles/truffleruby.gemfile +3 -0
- data/lib/oauth2/access_token.rb +14 -4
- data/lib/oauth2/authenticator.rb +10 -0
- data/lib/oauth2/client.rb +63 -16
- data/lib/oauth2/mac_token.rb +11 -3
- data/lib/oauth2/response.rb +5 -3
- data/lib/oauth2/strategy/assertion.rb +3 -3
- data/lib/oauth2/strategy/password.rb +2 -2
- data/lib/oauth2/version.rb +2 -1
- data/maintenance-branch +1 -0
- data/oauth2.gemspec +36 -9
- metadata +215 -20
- data/LICENSE.md +0 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: a85bca5fd51e149c80b5403207615e23040773582d3e2ae0fc2c44b83d49e866
|
4
|
+
data.tar.gz: 8022e428b4e48a88bbc84ec5855bce39d3b7b37ffe8a987df161103402b08585
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 810d0073495d3e5f05149b41257e02fbfd2ce09294f082dd69ddba67cc7c523d268f8163232ec6da783f05adf3f0e2876980699be3e6de58732cb1d8d988be20
|
7
|
+
data.tar.gz: d70c9a0303ae519eaa2b0db6af9e8dc56380263fbb30fce15a7ec9ff26ccc467de99a91265bc57d8bdce9bf2ade650312804e161b598e49c29ee81d2f2a3678f
|
@@ -0,0 +1,37 @@
|
|
1
|
+
name: Code Style Checks
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- 'main'
|
7
|
+
- 'master'
|
8
|
+
- '*-maintenance'
|
9
|
+
- '*-dev'
|
10
|
+
tags:
|
11
|
+
- '!*' # Do not execute on tags
|
12
|
+
pull_request:
|
13
|
+
branches:
|
14
|
+
- '*'
|
15
|
+
|
16
|
+
jobs:
|
17
|
+
rubocop:
|
18
|
+
name: Rubocop
|
19
|
+
if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')"
|
20
|
+
strategy:
|
21
|
+
fail-fast: false
|
22
|
+
matrix:
|
23
|
+
ruby:
|
24
|
+
- 2.7
|
25
|
+
runs-on: ubuntu-20.04
|
26
|
+
steps:
|
27
|
+
- name: Checkout
|
28
|
+
uses: actions/checkout@v2
|
29
|
+
- name: Setup Ruby
|
30
|
+
uses: ruby/setup-ruby@v1
|
31
|
+
with:
|
32
|
+
ruby-version: ${{ matrix.ruby }}
|
33
|
+
bundler-cache: true
|
34
|
+
- name: Install dependencies
|
35
|
+
run: bundle install --jobs 3 --retry 3
|
36
|
+
- name: Run Rubocop
|
37
|
+
run: bundle exec rubocop -DESP
|
@@ -0,0 +1,58 @@
|
|
1
|
+
name: Unit Tests
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- 'main'
|
7
|
+
- 'master'
|
8
|
+
- '*-maintenance'
|
9
|
+
- '*-dev'
|
10
|
+
tags:
|
11
|
+
- '!*' # Do not execute on tags
|
12
|
+
pull_request:
|
13
|
+
branches:
|
14
|
+
- '*'
|
15
|
+
|
16
|
+
jobs:
|
17
|
+
test:
|
18
|
+
name: Specs - Ruby ${{ matrix.ruby }} ${{ matrix.name_extra || '' }}
|
19
|
+
if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')"
|
20
|
+
strategy:
|
21
|
+
fail-fast: false
|
22
|
+
matrix:
|
23
|
+
ruby:
|
24
|
+
- 3.0.0
|
25
|
+
- 2.7
|
26
|
+
- 2.6
|
27
|
+
- 2.5
|
28
|
+
- 2.4
|
29
|
+
- 2.3
|
30
|
+
- 2.2
|
31
|
+
- 2.1
|
32
|
+
runs-on: ubuntu-20.04
|
33
|
+
continue-on-error: ${{ matrix.allow_failure || endsWith(matrix.ruby, 'head') }}
|
34
|
+
steps:
|
35
|
+
- uses: amancevice/setup-code-climate@v0
|
36
|
+
name: CodeClimate Install
|
37
|
+
if: matrix.ruby == '2.7' && github.event_name != 'pull_request'
|
38
|
+
with:
|
39
|
+
cc_test_reporter_id: ${{ secrets.CC_TEST_REPORTER_ID }}
|
40
|
+
- uses: actions/checkout@v2
|
41
|
+
- name: Setup Ruby
|
42
|
+
uses: ruby/setup-ruby@v1
|
43
|
+
with:
|
44
|
+
bundler: ${{ matrix.bundler || 2 }}
|
45
|
+
bundler-cache: true
|
46
|
+
ruby-version: ${{ matrix.ruby }}
|
47
|
+
- name: Install dependencies
|
48
|
+
run: bundle install --jobs 3 --retry 3 --binstubs --standalone
|
49
|
+
- name: CodeClimate Pre-build Notification
|
50
|
+
run: cc-test-reporter before-build
|
51
|
+
if: matrix.ruby == '2.7' && github.event_name != 'pull_request'
|
52
|
+
continue-on-error: ${{ matrix.allow_failures != 'false' }}
|
53
|
+
- name: Run tests
|
54
|
+
run: bundle exec rake test
|
55
|
+
- name: CodeClimate Post-build Notification
|
56
|
+
run: cc-test-reporter after-build
|
57
|
+
if: matrix.ruby == '2.7' && github.event_name != 'pull_request' && always()
|
58
|
+
continue-on-error: ${{ matrix.allow_failures != 'false' }}
|
data/.gitignore
ADDED
data/.jrubyrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
debug.fullTrace=true
|
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,112 @@
|
|
1
|
+
inherit_from:
|
2
|
+
- .rubocop_todo.yml
|
3
|
+
- .rubocop_rspec.yml
|
4
|
+
|
5
|
+
require:
|
6
|
+
- 'rubocop-md'
|
7
|
+
- 'rubocop-packaging'
|
8
|
+
- 'rubocop-performance'
|
9
|
+
- 'rubocop-rake'
|
10
|
+
- 'rubocop-rspec'
|
11
|
+
|
12
|
+
AllCops:
|
13
|
+
NewCops: enable
|
14
|
+
DisplayCopNames: true # Display the name of the failing cops
|
15
|
+
Exclude:
|
16
|
+
- 'gemfiles/vendor/**/*'
|
17
|
+
- 'vendor/**/*'
|
18
|
+
- '**/.irbrc'
|
19
|
+
|
20
|
+
Metrics/BlockLength:
|
21
|
+
IgnoredMethods:
|
22
|
+
- context
|
23
|
+
- describe
|
24
|
+
- it
|
25
|
+
- shared_context
|
26
|
+
- shared_examples
|
27
|
+
- shared_examples_for
|
28
|
+
- namespace
|
29
|
+
- draw
|
30
|
+
|
31
|
+
Gemspec/RequiredRubyVersion:
|
32
|
+
Enabled: false
|
33
|
+
|
34
|
+
Metrics/BlockNesting:
|
35
|
+
Max: 2
|
36
|
+
|
37
|
+
Layout/LineLength:
|
38
|
+
Enabled: false
|
39
|
+
|
40
|
+
Metrics/ParameterLists:
|
41
|
+
Max: 4
|
42
|
+
|
43
|
+
Layout/AccessModifierIndentation:
|
44
|
+
EnforcedStyle: outdent
|
45
|
+
|
46
|
+
Layout/DotPosition:
|
47
|
+
EnforcedStyle: trailing
|
48
|
+
|
49
|
+
Layout/SpaceInsideHashLiteralBraces:
|
50
|
+
EnforcedStyle: no_space
|
51
|
+
|
52
|
+
Lint/UnusedBlockArgument:
|
53
|
+
Exclude:
|
54
|
+
- 'spec/**/*.rb'
|
55
|
+
- 'gemfiles/vendor/**/*'
|
56
|
+
- 'vendor/**/*'
|
57
|
+
- '**/.irbrc'
|
58
|
+
|
59
|
+
RSpec/DescribeClass:
|
60
|
+
Exclude:
|
61
|
+
- 'spec/examples/*'
|
62
|
+
|
63
|
+
RSpec/NestedGroups:
|
64
|
+
Enabled: false
|
65
|
+
|
66
|
+
Style/ClassVars:
|
67
|
+
Enabled: false
|
68
|
+
|
69
|
+
Style/CollectionMethods:
|
70
|
+
PreferredMethods:
|
71
|
+
map: 'collect'
|
72
|
+
reduce: 'inject'
|
73
|
+
find: 'detect'
|
74
|
+
find_all: 'select'
|
75
|
+
|
76
|
+
Style/Documentation:
|
77
|
+
Enabled: false
|
78
|
+
|
79
|
+
Style/DoubleNegation:
|
80
|
+
Enabled: false
|
81
|
+
|
82
|
+
Style/EmptyMethod:
|
83
|
+
EnforcedStyle: expanded
|
84
|
+
|
85
|
+
Style/Encoding:
|
86
|
+
Enabled: false
|
87
|
+
|
88
|
+
Style/TrailingCommaInArrayLiteral:
|
89
|
+
EnforcedStyleForMultiline: comma
|
90
|
+
|
91
|
+
Style/TrailingCommaInHashLiteral:
|
92
|
+
EnforcedStyleForMultiline: comma
|
93
|
+
|
94
|
+
Style/HashSyntax:
|
95
|
+
EnforcedStyle: hash_rockets
|
96
|
+
|
97
|
+
Style/Lambda:
|
98
|
+
Enabled: false
|
99
|
+
|
100
|
+
Style/SymbolArray:
|
101
|
+
Enabled: false
|
102
|
+
|
103
|
+
Style/EachWithObject:
|
104
|
+
Enabled: false
|
105
|
+
|
106
|
+
# Once we drop Rubies that lack support for __dir__ we can turn this on.
|
107
|
+
Style/ExpandPathArguments:
|
108
|
+
Enabled: false
|
109
|
+
|
110
|
+
# On Ruby 1.9 array.to_h isn't available, needs to be Hash[array]
|
111
|
+
Style/HashConversion:
|
112
|
+
Enabled: false
|
data/.rubocop_rspec.yml
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
RSpec/FilePath:
|
2
|
+
Enabled: false
|
3
|
+
|
4
|
+
RSpec/MultipleExpectations:
|
5
|
+
Enabled: false
|
6
|
+
|
7
|
+
RSpec/NamedSubject:
|
8
|
+
Enabled: false
|
9
|
+
|
10
|
+
RSpec/ExampleLength:
|
11
|
+
Enabled: false
|
12
|
+
|
13
|
+
RSpec/VerifiedDoubles:
|
14
|
+
Enabled: false
|
15
|
+
|
16
|
+
RSpec/MessageSpies:
|
17
|
+
Enabled: false
|
18
|
+
|
19
|
+
RSpec/InstanceVariable:
|
20
|
+
Enabled: false
|
21
|
+
|
22
|
+
RSpec/NestedGroups:
|
23
|
+
Enabled: false
|
24
|
+
|
25
|
+
RSpec/ExpectInHook:
|
26
|
+
Enabled: false
|
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,113 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config`
|
3
|
+
# on 2021-03-18 18:59:52 UTC using RuboCop version 1.11.0.
|
4
|
+
# The point is for the user to remove these configuration records
|
5
|
+
# one by one as the offenses are removed from the code base.
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
8
|
+
|
9
|
+
# Offense count: 1
|
10
|
+
# Configuration parameters: AllowedMethods.
|
11
|
+
# AllowedMethods: enums
|
12
|
+
Lint/ConstantDefinitionInBlock:
|
13
|
+
Exclude:
|
14
|
+
- 'spec/oauth2/client_spec.rb'
|
15
|
+
|
16
|
+
# Offense count: 1
|
17
|
+
Lint/UselessAssignment:
|
18
|
+
Exclude:
|
19
|
+
- '**/*.md'
|
20
|
+
- '**/*.markdown'
|
21
|
+
- 'spec/oauth2/client_spec.rb'
|
22
|
+
|
23
|
+
# Offense count: 1
|
24
|
+
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
|
25
|
+
# IgnoredMethods: refine
|
26
|
+
Metrics/BlockLength:
|
27
|
+
Max: 27
|
28
|
+
|
29
|
+
# Offense count: 4
|
30
|
+
# Configuration parameters: IgnoredMethods.
|
31
|
+
Metrics/CyclomaticComplexity:
|
32
|
+
Max: 11
|
33
|
+
|
34
|
+
# Offense count: 1
|
35
|
+
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
|
36
|
+
Metrics/MethodLength:
|
37
|
+
Max: 18
|
38
|
+
|
39
|
+
# Offense count: 3
|
40
|
+
# Configuration parameters: IgnoredMethods.
|
41
|
+
Metrics/PerceivedComplexity:
|
42
|
+
Max: 11
|
43
|
+
|
44
|
+
# Offense count: 14
|
45
|
+
# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers.
|
46
|
+
# SupportedStyles: snake_case, normalcase, non_integer
|
47
|
+
# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339
|
48
|
+
Naming/VariableNumber:
|
49
|
+
Exclude:
|
50
|
+
- 'Gemfile'
|
51
|
+
|
52
|
+
# Offense count: 1
|
53
|
+
Packaging/GemspecGit:
|
54
|
+
Exclude:
|
55
|
+
- 'oauth2.gemspec'
|
56
|
+
|
57
|
+
# Offense count: 2
|
58
|
+
# Configuration parameters: MinSize.
|
59
|
+
Performance/CollectionLiteralInLoop:
|
60
|
+
Exclude:
|
61
|
+
- 'spec/oauth2/strategy/auth_code_spec.rb'
|
62
|
+
- 'spec/oauth2/strategy/client_credentials_spec.rb'
|
63
|
+
|
64
|
+
# Offense count: 7
|
65
|
+
# Configuration parameters: Prefixes.
|
66
|
+
# Prefixes: when, with, without
|
67
|
+
RSpec/ContextWording:
|
68
|
+
Exclude:
|
69
|
+
- 'spec/oauth2/access_token_spec.rb'
|
70
|
+
- 'spec/oauth2/authenticator_spec.rb'
|
71
|
+
- 'spec/oauth2/client_spec.rb'
|
72
|
+
|
73
|
+
# Offense count: 1
|
74
|
+
RSpec/LeakyConstantDeclaration:
|
75
|
+
Exclude:
|
76
|
+
- 'spec/oauth2/client_spec.rb'
|
77
|
+
|
78
|
+
# Offense count: 8
|
79
|
+
# Configuration parameters: AllowSubject.
|
80
|
+
RSpec/MultipleMemoizedHelpers:
|
81
|
+
Max: 6
|
82
|
+
|
83
|
+
# Offense count: 1
|
84
|
+
Rake/Desc:
|
85
|
+
Exclude:
|
86
|
+
- 'Rakefile'
|
87
|
+
|
88
|
+
# Offense count: 40
|
89
|
+
# Cop supports --auto-correct.
|
90
|
+
# Configuration parameters: EnforcedStyle.
|
91
|
+
# SupportedStyles: always, always_true, never
|
92
|
+
Style/FrozenStringLiteralComment:
|
93
|
+
Enabled: false
|
94
|
+
|
95
|
+
# Offense count: 1
|
96
|
+
Style/MixinUsage:
|
97
|
+
Exclude:
|
98
|
+
- 'spec/helper.rb'
|
99
|
+
|
100
|
+
# Offense count: 1
|
101
|
+
# Cop supports --auto-correct.
|
102
|
+
# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods.
|
103
|
+
# AllowedMethods: present?, blank?, presence, try, try!
|
104
|
+
Style/SafeNavigation:
|
105
|
+
Exclude:
|
106
|
+
- 'lib/oauth2/error.rb'
|
107
|
+
|
108
|
+
# Offense count: 3
|
109
|
+
# Cop supports --auto-correct.
|
110
|
+
Style/StringConcatenation:
|
111
|
+
Exclude:
|
112
|
+
- 'lib/oauth2/authenticator.rb'
|
113
|
+
- 'spec/oauth2/authenticator_spec.rb'
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.7.0
|
data/.travis.yml
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
before_install:
|
2
|
+
# rubygems 2.7.8 and greater include bundler
|
3
|
+
# - Ruby 2.2, and under, get RubyGems ~> 2.7.10, (includes bundler 1.17.3)
|
4
|
+
# - Anything else, including Ruby 2.3, and above, gets RubyGems ~> 3, and update bundler to latest
|
5
|
+
# - NOTE ON JRUBY: identifies as RUBY_VERSION ~> 1.9, 2.0, 2.3, or 2.5.
|
6
|
+
# - NOTE ON TRUFFLERUBY: identifies as RUBY_VERSION ~> 2.6
|
7
|
+
- |
|
8
|
+
rv="$(ruby -e 'STDOUT.write RUBY_VERSION')"
|
9
|
+
echo "Discovered Ruby Version of =====> $rv"
|
10
|
+
if [ "$rv" \< "2.3" ]; then
|
11
|
+
gem update --system 2.7.10
|
12
|
+
elif [ "$rv" \< "2.4" ]; then
|
13
|
+
gem update --system 2.7.10 --no-document
|
14
|
+
elif [ "$rv" = "2.5.3" ]; then
|
15
|
+
# JRUBY 9.2 Identifies as 2.5.3, and it fails to update rubygems
|
16
|
+
gem install --no-document bundler "bundler:>=2.0"
|
17
|
+
else
|
18
|
+
gem update --system --no-document --conservative
|
19
|
+
gem install --no-document bundler "bundler:>=2.0"
|
20
|
+
fi
|
21
|
+
|
22
|
+
before_script:
|
23
|
+
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
24
|
+
- chmod +x ./cc-test-reporter
|
25
|
+
- ./cc-test-reporter before-build
|
26
|
+
|
27
|
+
after_script:
|
28
|
+
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
|
29
|
+
|
30
|
+
bundler_args: --no-deployment --jobs 3 --retry 3
|
31
|
+
|
32
|
+
cache: bundler
|
33
|
+
|
34
|
+
env:
|
35
|
+
global:
|
36
|
+
- JRUBY_OPTS="$JRUBY_OPTS -Xcli.debug=true --debug"
|
37
|
+
- CC_TEST_REPORTER_ID=29caf9cf27d27ae609c088feb9d4ba34460f7a39251f2e8615c9a16f3075530e
|
38
|
+
|
39
|
+
language: ruby
|
40
|
+
|
41
|
+
matrix:
|
42
|
+
allow_failures:
|
43
|
+
- rvm: jruby-head
|
44
|
+
- rvm: ruby-head
|
45
|
+
- rvm: truffleruby
|
46
|
+
- rvm: jruby-9.0
|
47
|
+
- rvm: jruby-9.1 # jruby-9.1 often fails to download, thus failing the build.
|
48
|
+
- rvm: jruby-9.2 # jruby-9.2 often fails to download, thus failing the build.
|
49
|
+
fast_finish: true
|
50
|
+
include:
|
51
|
+
# - rvm: jruby-1.7 # targets MRI v1.9
|
52
|
+
# gemfile: gemfiles/jruby_1.7.gemfile
|
53
|
+
- rvm: 1.9
|
54
|
+
gemfile: gemfiles/ruby_1.9.gemfile
|
55
|
+
- rvm: 2.0
|
56
|
+
gemfile: gemfiles/ruby_2.0.gemfile
|
57
|
+
- rvm: jruby-9.0 # targets MRI v2.0
|
58
|
+
gemfile: gemfiles/jruby_9.0.gemfile
|
59
|
+
# DEPRECATION WARNING
|
60
|
+
# NOTE: Specs for Ruby 2.1 are now running with Github Actions
|
61
|
+
# oauth2 1.x series releases are the last to support Ruby versions above
|
62
|
+
# oauth2 2.x series releases will support Ruby versions below, and not above
|
63
|
+
# NOTE: Specs for Ruby 2.2, 2.3, 2.4, 2.5, 2.6, 2.7 & 3.0 are now running with Github Actions
|
64
|
+
- rvm: jruby-9.1 # targets MRI v2.3
|
65
|
+
gemfile: gemfiles/jruby_9.1.gemfile
|
66
|
+
- rvm: jruby-9.2 # targets MRI v2.5
|
67
|
+
gemfile: gemfiles/jruby_9.2.gemfile
|
68
|
+
- rvm: jruby-head
|
69
|
+
gemfile: gemfiles/jruby_head.gemfile
|
70
|
+
- rvm: ruby-head
|
71
|
+
gemfile: gemfiles/ruby_head.gemfile
|
72
|
+
- rvm: truffleruby
|
73
|
+
gemfile: gemfiles/truffleruby.gemfile
|
74
|
+
|
75
|
+
sudo: false
|