oauth2 1.4.6 → 1.4.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -1
  3. data/README.md +1 -0
  4. data/lib/oauth2/access_token.rb +3 -5
  5. data/lib/oauth2/version.rb +7 -3
  6. data/spec/helper.rb +37 -0
  7. data/spec/oauth2/access_token_spec.rb +216 -0
  8. data/spec/oauth2/authenticator_spec.rb +84 -0
  9. data/spec/oauth2/client_spec.rb +506 -0
  10. data/spec/oauth2/mac_token_spec.rb +117 -0
  11. data/spec/oauth2/response_spec.rb +90 -0
  12. data/spec/oauth2/strategy/assertion_spec.rb +58 -0
  13. data/spec/oauth2/strategy/auth_code_spec.rb +107 -0
  14. data/spec/oauth2/strategy/base_spec.rb +5 -0
  15. data/spec/oauth2/strategy/client_credentials_spec.rb +69 -0
  16. data/spec/oauth2/strategy/implicit_spec.rb +26 -0
  17. data/spec/oauth2/strategy/password_spec.rb +55 -0
  18. data/spec/oauth2/version_spec.rb +23 -0
  19. metadata +31 -31
  20. data/.document +0 -5
  21. data/.github/dependabot.yml +0 -8
  22. data/.github/workflows/style.yml +0 -37
  23. data/.github/workflows/test.yml +0 -58
  24. data/.gitignore +0 -19
  25. data/.jrubyrc +0 -1
  26. data/.rspec +0 -4
  27. data/.rubocop.yml +0 -112
  28. data/.rubocop_rspec.yml +0 -26
  29. data/.rubocop_todo.yml +0 -113
  30. data/.ruby-version +0 -1
  31. data/.travis.yml +0 -75
  32. data/CONTRIBUTING.md +0 -18
  33. data/Gemfile +0 -61
  34. data/Rakefile +0 -45
  35. data/gemfiles/jruby_1.7.gemfile +0 -11
  36. data/gemfiles/jruby_9.0.gemfile +0 -7
  37. data/gemfiles/jruby_9.1.gemfile +0 -3
  38. data/gemfiles/jruby_9.2.gemfile +0 -3
  39. data/gemfiles/jruby_head.gemfile +0 -3
  40. data/gemfiles/ruby_1.9.gemfile +0 -11
  41. data/gemfiles/ruby_2.0.gemfile +0 -6
  42. data/gemfiles/ruby_head.gemfile +0 -9
  43. data/gemfiles/truffleruby.gemfile +0 -3
  44. data/maintenance-branch +0 -1
  45. data/oauth2.gemspec +0 -52
data/.rubocop_rspec.yml DELETED
@@ -1,26 +0,0 @@
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 DELETED
@@ -1,113 +0,0 @@
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 DELETED
@@ -1 +0,0 @@
1
- 2.7.0
data/.travis.yml DELETED
@@ -1,75 +0,0 @@
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
data/CONTRIBUTING.md DELETED
@@ -1,18 +0,0 @@
1
- ## Submitting a Pull Request
2
- 1. [Fork the repository.][fork]
3
- 2. [Create a topic branch.][branch]
4
- 3. Add specs for your unimplemented feature or bug fix.
5
- 4. Run `bundle exec rake spec`. If your specs pass, return to step 3.
6
- 5. Implement your feature or bug fix.
7
- 6. Run `bundle exec rake`. If your specs fail, return to step 5.
8
- 7. Run `open coverage/index.html`. If your changes are not completely covered
9
- by your tests, return to step 3.
10
- 8. Add documentation for your feature or bug fix.
11
- 9. Run `bundle exec rake verify_measurements`. If your changes are not 100%
12
- documented, go back to step 8.
13
- 10. Commit and push your changes.
14
- 11. [Submit a pull request.][pr]
15
-
16
- [fork]: http://help.github.com/fork-a-repo/
17
- [branch]: http://learn.github.com/p/branching.html
18
- [pr]: http://help.github.com/send-pull-requests/
data/Gemfile DELETED
@@ -1,61 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
-
5
- gemspec
6
-
7
- git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
8
-
9
- gem 'faraday', ['>= 0.8', '< 2.0'], :platforms => [:jruby_18, :ruby_18]
10
- gem 'jwt', '< 1.5.2', :platforms => [:jruby_18, :ruby_18]
11
- gem 'rake', '< 11.0'
12
-
13
- ruby_version = Gem::Version.new(RUBY_VERSION)
14
-
15
- ### deps for documentation and rdoc.info
16
- group :documentation do
17
- gem 'github-markup', :platform => :mri
18
- gem 'rdoc'
19
- gem 'redcarpet', :platform => :mri
20
- gem 'yard', :require => false
21
- end
22
-
23
- group :development, :test do
24
- if ruby_version >= Gem::Version.new('2.4')
25
- # No need to run byebug / pry on earlier versions
26
- gem 'byebug', :platform => :mri
27
- gem 'pry', :platform => :mri
28
- gem 'pry-byebug', :platform => :mri
29
- end
30
-
31
- if ruby_version >= Gem::Version.new('2.7')
32
- # No need to run rubocop or simplecov on earlier versions
33
- gem 'rubocop', '~> 1.9', :platform => :mri
34
- gem 'rubocop-md', :platform => :mri
35
- gem 'rubocop-packaging', :platform => :mri
36
- gem 'rubocop-performance', :platform => :mri
37
- gem 'rubocop-rake', :platform => :mri
38
- gem 'rubocop-rspec', :platform => :mri
39
-
40
- gem 'coveralls'
41
- gem 'simplecov', :platform => :mri
42
- end
43
- end
44
-
45
- group :test do
46
- gem 'addressable', '~> 2.3.8'
47
- gem 'backports'
48
- gem 'rack', '~> 1.2', :platforms => [:jruby_18, :jruby_19, :ruby_18, :ruby_19, :ruby_20, :ruby_21]
49
- gem 'rspec', '>= 3'
50
-
51
- platforms :jruby_18, :ruby_18 do
52
- gem 'mime-types', '~> 1.25'
53
- gem 'rest-client', '~> 1.6.0'
54
- end
55
-
56
- platforms :ruby_18, :ruby_19 do
57
- gem 'json', '< 2.0'
58
- gem 'term-ansicolor', '< 1.4.0'
59
- gem 'tins', '< 1.7'
60
- end
61
- end
data/Rakefile DELETED
@@ -1,45 +0,0 @@
1
- # encoding: utf-8
2
-
3
- # !/usr/bin/env rake
4
-
5
- require 'bundler/gem_tasks'
6
-
7
- begin
8
- require 'wwtd/tasks'
9
- rescue LoadError
10
- puts 'failed to load wwtd'
11
- end
12
-
13
- begin
14
- require 'rspec/core/rake_task'
15
- RSpec::Core::RakeTask.new(:spec)
16
- rescue LoadError
17
- task :spec do
18
- warn 'rspec is disabled'
19
- end
20
- end
21
- task :test => :spec
22
-
23
- begin
24
- require 'rubocop/rake_task'
25
- RuboCop::RakeTask.new do |task|
26
- task.options = ['-D'] # Display the name of the failing cops
27
- end
28
- rescue LoadError
29
- task :rubocop do
30
- warn 'RuboCop is disabled'
31
- end
32
- end
33
-
34
- namespace :doc do
35
- require 'rdoc/task'
36
- require 'oauth2/version'
37
- RDoc::Task.new do |rdoc|
38
- rdoc.rdoc_dir = 'rdoc'
39
- rdoc.title = "oauth2 #{OAuth2::Version}"
40
- rdoc.main = 'README.md'
41
- rdoc.rdoc_files.include('README.md', 'LICENSE.md', 'lib/**/*.rb')
42
- end
43
- end
44
-
45
- task :default => [:test, :rubocop]
@@ -1,11 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gem 'faraday', '~> 0.15.4'
4
-
5
- gem 'json', '< 2.0'
6
- gem 'rack', '~> 1.2'
7
- gem 'rake', ['>= 10.0', '< 12']
8
- gem 'term-ansicolor', '< 1.4.0'
9
- gem 'tins', '< 1.7'
10
-
11
- gemspec :path => '../'
@@ -1,7 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gem 'faraday', '~> 0.15.4'
4
-
5
- gem 'rake', ['>= 10.0', '< 12']
6
-
7
- gemspec :path => '../'
@@ -1,3 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec :path => '../'
@@ -1,3 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec :path => '../'
@@ -1,3 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec :path => '../'
@@ -1,11 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gem 'faraday', '~> 0.15.4'
4
-
5
- gem 'json', '< 2.0'
6
- gem 'rack', '~> 1.2'
7
- gem 'rake', ['>= 10.0', '< 12']
8
- gem 'term-ansicolor', '< 1.4.0'
9
- gem 'tins', '< 1.7'
10
-
11
- gemspec :path => '../'
@@ -1,6 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gem 'faraday', '~> 0.15.4'
4
- gem 'rack', '~> 1.2'
5
-
6
- gemspec :path => '../'
@@ -1,9 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- group :development do
4
- gem 'byebug'
5
- gem 'pry'
6
- gem 'pry-byebug'
7
- end
8
-
9
- gemspec :path => '../'
@@ -1,3 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec :path => '../'
data/maintenance-branch DELETED
@@ -1 +0,0 @@
1
- master
data/oauth2.gemspec DELETED
@@ -1,52 +0,0 @@
1
- # coding: utf-8
2
-
3
- lib = File.expand_path('../lib', __FILE__)
4
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
- require 'oauth2/version'
6
-
7
- Gem::Specification.new do |spec|
8
- spec.add_dependency 'faraday', ['>= 0.8', '< 2.0']
9
- spec.add_dependency 'jwt', ['>= 1.0', '< 3.0']
10
- spec.add_dependency 'multi_json', '~> 1.3'
11
- spec.add_dependency 'multi_xml', '~> 0.5'
12
- spec.add_dependency 'rack', ['>= 1.2', '< 3']
13
-
14
- spec.authors = ['Peter Boling', 'Michael Bleigh', 'Erik Michaels-Ober']
15
- spec.description = 'A Ruby wrapper for the OAuth 2.0 protocol built with a similar style to the original OAuth spec.'
16
- spec.email = ['peter.boling@gmail.com']
17
- spec.homepage = 'https://github.com/oauth-xx/oauth2'
18
- spec.licenses = %w[MIT]
19
- spec.name = 'oauth2'
20
- spec.required_ruby_version = '>= 1.9.0'
21
- spec.required_rubygems_version = '>= 1.3.5'
22
- spec.summary = 'A Ruby wrapper for the OAuth 2.0 protocol.'
23
- spec.version = OAuth2::Version.to_s
24
-
25
- spec.metadata = {
26
- 'bug_tracker_uri' => 'https://github.com/oauth-xx/oauth2/issues',
27
- 'changelog_uri' => "https://github.com/oauth-xx/oauth2/blob/v#{spec.version}/CHANGELOG.md",
28
- 'documentation_uri' => "https://www.rubydoc.info/gems/oauth2/#{spec.version}",
29
- 'source_code_uri' => "https://github.com/oauth-xx/oauth2/tree/v#{spec.version}",
30
- 'wiki_uri' => 'https://github.com/oauth-xx/oauth2/wiki',
31
- }
32
-
33
- spec.require_paths = %w[lib]
34
- spec.bindir = 'exe'
35
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
36
- spec.files = `git ls-files -z`.split("\x0").reject do |f|
37
- f.match(%r{^(bin|test|spec|features)/})
38
- end
39
-
40
- spec.add_development_dependency 'addressable', '~> 2.3'
41
- spec.add_development_dependency 'backports', '~> 3.11'
42
- spec.add_development_dependency 'bundler', '>= 1.16'
43
- spec.add_development_dependency 'coveralls', '~> 0.8'
44
- spec.add_development_dependency 'rake', '~> 12.3'
45
- spec.add_development_dependency 'rdoc', ['>= 5.0', '< 7']
46
- spec.add_development_dependency 'rspec', '~> 3.0'
47
- spec.add_development_dependency 'rspec-block_is_expected'
48
- spec.add_development_dependency 'rspec-pending_for'
49
- spec.add_development_dependency 'rspec-stubbed_env'
50
- spec.add_development_dependency 'silent_stream'
51
- spec.add_development_dependency 'wwtd'
52
- end