oauth2 1.3.1 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +12 -0
- data/.jrubyrc +1 -0
- data/.rspec +2 -0
- data/.rubocop.yml +80 -0
- data/.rubocop_rspec.yml +26 -0
- data/.rubocop_todo.yml +15 -0
- data/.travis.yml +49 -0
- data/CHANGELOG.md +139 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +41 -0
- data/LICENSE +22 -0
- data/README.md +101 -19
- data/Rakefile +45 -0
- data/gemfiles/jruby_1.7.gemfile +11 -0
- data/gemfiles/jruby_1.7.gemfile.lock +81 -0
- data/gemfiles/jruby_9.0.gemfile +13 -0
- data/gemfiles/jruby_9.1.gemfile +17 -0
- data/gemfiles/jruby_9.1.gemfile.lock +112 -0
- data/gemfiles/jruby_9.2.gemfile +17 -0
- data/gemfiles/jruby_9.2.gemfile.lock +112 -0
- data/gemfiles/jruby_head.gemfile +17 -0
- data/gemfiles/ruby_1.9.gemfile +16 -0
- data/gemfiles/ruby_1.9.gemfile.lock +85 -0
- data/gemfiles/ruby_2.0.gemfile +17 -0
- data/gemfiles/ruby_2.0.gemfile.lock +90 -0
- data/gemfiles/ruby_2.1.gemfile +19 -0
- data/gemfiles/ruby_2.1.gemfile.lock +109 -0
- data/gemfiles/ruby_2.2.gemfile +17 -0
- data/gemfiles/ruby_2.2.gemfile.lock +108 -0
- data/gemfiles/ruby_2.3.gemfile +17 -0
- data/gemfiles/ruby_2.3.gemfile.lock +108 -0
- data/gemfiles/ruby_2.4.gemfile +17 -0
- data/gemfiles/ruby_2.4.gemfile.lock +108 -0
- data/gemfiles/ruby_2.5.gemfile +17 -0
- data/gemfiles/ruby_2.5.gemfile.lock +108 -0
- data/gemfiles/ruby_head.gemfile +17 -0
- data/gemfiles/ruby_head.gemfile.lock +108 -0
- data/lib/oauth2/mac_token.rb +1 -1
- data/lib/oauth2/version.rb +6 -6
- data/oauth2.gemspec +25 -9
- metadata +160 -15
- 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: c91742d7784cd1d8b7e085cefa2ad5e0f5931112741ca2e6fd50a925d404854e
|
4
|
+
data.tar.gz: befcd535b9af7309adf7f320b29280ee020b9d66517cd08824b143b9b41dbd79
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8175756609903d2bd60b635301c6f3a67fe55a3c8ebb6bda5e1e6f8c66cc0d861685f4ed78882ec2602ba6e8ce113b50e3aa94cb4f907515ada5fe93e4bcb579
|
7
|
+
data.tar.gz: 711dbe14418c8599fe5ae05cffa4dd60d0a0891a1438999ef00bcea495f87ecf0a6c1d928795f61e06396a11983b9670d4a933b5db93f10b4eb350406ea348e0
|
data/.gitignore
ADDED
data/.jrubyrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
debug.fullTrace=true
|
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
require: rubocop-rspec
|
2
|
+
inherit_from:
|
3
|
+
- .rubocop_todo.yml
|
4
|
+
- .rubocop_rspec.yml
|
5
|
+
AllCops:
|
6
|
+
DisplayCopNames: true # Display the name of the failing cops
|
7
|
+
TargetRubyVersion: 2.1
|
8
|
+
Exclude:
|
9
|
+
- 'gemfiles/vendor/**/*'
|
10
|
+
- 'vendor/**/*'
|
11
|
+
- '**/.irbrc'
|
12
|
+
|
13
|
+
Gemspec/RequiredRubyVersion:
|
14
|
+
Enabled: false
|
15
|
+
|
16
|
+
Metrics/BlockLength:
|
17
|
+
Enabled: false
|
18
|
+
|
19
|
+
Metrics/BlockNesting:
|
20
|
+
Max: 2
|
21
|
+
|
22
|
+
Metrics/LineLength:
|
23
|
+
Enabled: false
|
24
|
+
|
25
|
+
Metrics/MethodLength:
|
26
|
+
Max: 15
|
27
|
+
|
28
|
+
Metrics/ParameterLists:
|
29
|
+
Max: 4
|
30
|
+
|
31
|
+
Layout/AccessModifierIndentation:
|
32
|
+
EnforcedStyle: outdent
|
33
|
+
|
34
|
+
Layout/DotPosition:
|
35
|
+
EnforcedStyle: trailing
|
36
|
+
|
37
|
+
Layout/SpaceInsideHashLiteralBraces:
|
38
|
+
EnforcedStyle: no_space
|
39
|
+
|
40
|
+
Lint/UnusedBlockArgument:
|
41
|
+
Exclude:
|
42
|
+
- 'spec/**/*.rb'
|
43
|
+
- 'gemfiles/vendor/**/*'
|
44
|
+
- 'vendor/**/*'
|
45
|
+
- '**/.irbrc'
|
46
|
+
|
47
|
+
RSpec/DescribeClass:
|
48
|
+
Exclude:
|
49
|
+
- 'spec/examples/*'
|
50
|
+
|
51
|
+
RSpec/NestedGroups:
|
52
|
+
Enabled: false
|
53
|
+
|
54
|
+
Style/ClassVars:
|
55
|
+
Enabled: false
|
56
|
+
|
57
|
+
Style/CollectionMethods:
|
58
|
+
PreferredMethods:
|
59
|
+
map: 'collect'
|
60
|
+
reduce: 'inject'
|
61
|
+
find: 'detect'
|
62
|
+
find_all: 'select'
|
63
|
+
|
64
|
+
Style/Documentation:
|
65
|
+
Enabled: false
|
66
|
+
|
67
|
+
Style/DoubleNegation:
|
68
|
+
Enabled: false
|
69
|
+
|
70
|
+
Style/EmptyMethod:
|
71
|
+
EnforcedStyle: expanded
|
72
|
+
|
73
|
+
Style/Encoding:
|
74
|
+
Enabled: false
|
75
|
+
|
76
|
+
Style/TrailingCommaInArrayLiteral:
|
77
|
+
EnforcedStyleForMultiline: comma
|
78
|
+
|
79
|
+
Style/TrailingCommaInHashLiteral:
|
80
|
+
EnforcedStyleForMultiline: comma
|
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,15 @@
|
|
1
|
+
Style/HashSyntax:
|
2
|
+
EnforcedStyle: hash_rockets
|
3
|
+
|
4
|
+
Style/Lambda:
|
5
|
+
Enabled: false
|
6
|
+
|
7
|
+
Style/SymbolArray:
|
8
|
+
Enabled: false
|
9
|
+
|
10
|
+
Style/EachWithObject:
|
11
|
+
Enabled: false
|
12
|
+
|
13
|
+
# Once we drop Rubies that lack support for __dir__ we can turn this on.
|
14
|
+
Style/ExpandPathArguments:
|
15
|
+
Enabled: false
|
data/.travis.yml
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
before_install:
|
2
|
+
- gem update --system
|
3
|
+
- gem install bundler
|
4
|
+
|
5
|
+
bundler_args: --no-deployment --jobs 3 --retry 3
|
6
|
+
|
7
|
+
cache: bundler
|
8
|
+
|
9
|
+
language: ruby
|
10
|
+
|
11
|
+
matrix:
|
12
|
+
allow_failures:
|
13
|
+
- rvm: jruby-head
|
14
|
+
- rvm: ruby-head
|
15
|
+
- rvm: rbx-3
|
16
|
+
fast_finish: true
|
17
|
+
include:
|
18
|
+
- rvm: jruby-1.7.27 # targets MRI v1.9
|
19
|
+
gemfile: gemfiles/jruby_1.7.gemfile
|
20
|
+
- rvm: 1.9.3-p551
|
21
|
+
gemfile: gemfiles/ruby_1.9.gemfile
|
22
|
+
- rvm: 2.0.0-p648
|
23
|
+
gemfile: gemfiles/ruby_2.0.gemfile
|
24
|
+
- rvm: 2.1.10
|
25
|
+
gemfile: gemfiles/ruby_2.1.gemfile
|
26
|
+
- rvm: jruby-9.0.5.0 # targets MRI v2.0
|
27
|
+
gemfile: gemfiles/jruby_9.0.gemfile
|
28
|
+
# DEPRECATION WARNING
|
29
|
+
# oauth2 1.x series releases are the last to support Ruby versions above
|
30
|
+
# oauth2 2.x series releases will support Ruby versions below, and not above
|
31
|
+
- rvm: jruby-9.1.9.0 # targets MRI v2.3
|
32
|
+
gemfile: gemfiles/jruby_9.1.gemfile
|
33
|
+
- rvm: 2.2.10
|
34
|
+
gemfile: gemfiles/ruby_2.2.gemfile
|
35
|
+
- rvm: 2.3.7
|
36
|
+
gemfile: gemfiles/ruby_2.3.gemfile
|
37
|
+
- rvm: 2.4.4
|
38
|
+
gemfile: gemfiles/ruby_2.4.gemfile
|
39
|
+
- rvm: jruby-9.2.0.0 # targets MRI v2.5
|
40
|
+
gemfile: gemfiles/jruby_9.2.gemfile
|
41
|
+
- rvm: 2.5.1
|
42
|
+
gemfile: gemfiles/ruby_2.5.gemfile
|
43
|
+
- rvm: jruby-head
|
44
|
+
gemfile: gemfiles/jruby_head.gemfile
|
45
|
+
- rvm: ruby-head
|
46
|
+
gemfile: gemfiles/ruby_head.gemfile
|
47
|
+
- rvm: rbx-3
|
48
|
+
|
49
|
+
sudo: false
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,139 @@
|
|
1
|
+
# Change Log
|
2
|
+
All notable changes to this project will be documented in this file.
|
3
|
+
|
4
|
+
## [unreleased]
|
5
|
+
|
6
|
+
- no changes yet
|
7
|
+
|
8
|
+
## [1.4.1] - 2018-10-13
|
9
|
+
|
10
|
+
- [#417](oauth-xx/oauth2#417) - update jwt dependency (@thewoolleyman)
|
11
|
+
- [#418](oauth-xx/oauth2#418) - remove rubocop dependency (temporary, added back in [#423](oauth-xx/oauth2#423)) (@pboling)
|
12
|
+
- [#419](oauth-xx/oauth2#419) - update faraday dependency (@pboling)
|
13
|
+
- [#420](oauth-xx/oauth2#420) - update [oauth2.gemspec](oauth2.gemspec) (@pboling)
|
14
|
+
- [#421](oauth-xx/oauth2#421) - fix [CHANGELOG.md](CHANGELOG.md) for previous releases (@pboling)
|
15
|
+
- [#422](oauth-xx/oauth2#422) - update [LICENSE](LICENSE) and [README.md](README.md) (@pboling)
|
16
|
+
- [#423](oauth-xx/oauth2#423) - update [builds](https://travis-ci.org/oauth-xx/oauth2/builds), [Rakefile](Rakefile) (@pboling)
|
17
|
+
- officially document supported Rubies
|
18
|
+
* Ruby 1.9.3
|
19
|
+
* Ruby 2.0.0
|
20
|
+
* Ruby 2.1
|
21
|
+
* Ruby 2.2
|
22
|
+
* [JRuby 1.7][jruby-1.7] (targets MRI v1.9)
|
23
|
+
* [JRuby 9.0][jruby-9.0] (targets MRI v2.0)
|
24
|
+
* Ruby 2.3
|
25
|
+
* Ruby 2.4
|
26
|
+
* Ruby 2.5
|
27
|
+
* [JRuby 9.1][jruby-9.1] (targets MRI v2.3)
|
28
|
+
* [JRuby 9.2][jruby-9.2] (targets MRI v2.5)
|
29
|
+
|
30
|
+
[jruby-1.7]: https://www.jruby.org/2017/05/11/jruby-1-7-27.html
|
31
|
+
[jruby-9.0]: https://www.jruby.org/2016/01/26/jruby-9-0-5-0.html
|
32
|
+
[jruby-9.1]: https://www.jruby.org/2017/05/16/jruby-9-1-9-0.html
|
33
|
+
[jruby-9.2]: https://www.jruby.org/2018/05/24/jruby-9-2-0-0.html
|
34
|
+
|
35
|
+
## [1.4.0] - 2017-06-09
|
36
|
+
|
37
|
+
- Drop Ruby 1.8.7 support (@sferik)
|
38
|
+
- Fix some RuboCop offenses (@sferik)
|
39
|
+
- _Dependency_: Remove Yardstick (@sferik)
|
40
|
+
- _Dependency_: Upgrade Faraday to 0.12 (@sferik)
|
41
|
+
|
42
|
+
## [1.3.1] - 2017-03-03
|
43
|
+
|
44
|
+
- Add support for Ruby 2.4.0 (@pschambacher)
|
45
|
+
- _Dependency_: Upgrade Faraday to Faraday 0.11 (@mcfiredrill, @rhymes, @pschambacher)
|
46
|
+
|
47
|
+
## [1.3.0] - 2016-12-28
|
48
|
+
|
49
|
+
- Add support for header-based authentication to the `Client` so it can be used across the library (@bjeanes)
|
50
|
+
- Default to header-based authentication when getting a token from an authorisation code (@maletor)
|
51
|
+
- **Breaking**: Allow an `auth_scheme` (`:basic_auth` or `:request_body`) to be set on the client, defaulting to `:request_body` to maintain backwards compatibility (@maletor, @bjeanes)
|
52
|
+
- Handle `redirect_uri` according to the OAuth 2 spec, so it is passed on redirect and at the point of token exchange (@bjeanes)
|
53
|
+
- Refactor handling of encoding of error responses (@urkle)
|
54
|
+
- Avoid instantiating an `Error` if there is no error to raise (@urkle)
|
55
|
+
- Add support for Faraday 0.10 (@rhymes)
|
56
|
+
|
57
|
+
## [1.2.0] - 2016-07-01
|
58
|
+
|
59
|
+
- Properly handle encoding of error responses (so we don't blow up, for example, when Google's response includes a ∞) (@Motoshi-Nishihira)
|
60
|
+
- Make a copy of the options hash in `AccessToken#from_hash` to avoid accidental mutations (@Linuus)
|
61
|
+
- Use `raise` rather than `fail` to throw exceptions (@sferik)
|
62
|
+
|
63
|
+
## [1.1.0] - 2016-01-30
|
64
|
+
|
65
|
+
- Various refactors (eliminating `Hash#merge!` usage in `AccessToken#refresh!`, use `yield` instead of `#call`, freezing mutable objects in constants, replacing constants with class variables) (@sferik)
|
66
|
+
- Add support for Rack 2, and bump various other dependencies (@sferik)
|
67
|
+
|
68
|
+
## [1.0.0] - 2014-07-09
|
69
|
+
|
70
|
+
### Added
|
71
|
+
- Add an implementation of the MAC token spec.
|
72
|
+
|
73
|
+
### Fixed
|
74
|
+
- Fix Base64.strict_encode64 incompatibility with Ruby 1.8.7.
|
75
|
+
|
76
|
+
## [0.5.0] - 2011-07-29
|
77
|
+
|
78
|
+
### Changed
|
79
|
+
- [breaking] `oauth_token` renamed to `oauth_bearer`.
|
80
|
+
- [breaking] `authorize_path` Client option renamed to `authorize_url`.
|
81
|
+
- [breaking] `access_token_path` Client option renamed to `token_url`.
|
82
|
+
- [breaking] `access_token_method` Client option renamed to `token_method`.
|
83
|
+
- [breaking] `web_server` renamed to `auth_code`.
|
84
|
+
|
85
|
+
## [0.4.1] - 2011-04-20
|
86
|
+
|
87
|
+
## [0.4.0] - 2011-04-20
|
88
|
+
|
89
|
+
## [0.3.0] - 2011-04-08
|
90
|
+
|
91
|
+
## [0.2.0] - 2011-04-01
|
92
|
+
|
93
|
+
## [0.1.1] - 2011-01-12
|
94
|
+
|
95
|
+
## [0.1.0] - 2010-10-13
|
96
|
+
|
97
|
+
## [0.0.13] + [0.0.12] + [0.0.11] - 2010-08-17
|
98
|
+
|
99
|
+
## [0.0.10] - 2010-06-19
|
100
|
+
|
101
|
+
## [0.0.9] - 2010-06-18
|
102
|
+
|
103
|
+
## [0.0.8] + [0.0.7] - 2010-04-27
|
104
|
+
|
105
|
+
## [0.0.6] - 2010-04-25
|
106
|
+
|
107
|
+
## [0.0.5] - 2010-04-23
|
108
|
+
|
109
|
+
## [0.0.4] + [0.0.3] + [0.0.2] + [0.0.1] - 2010-04-22
|
110
|
+
|
111
|
+
|
112
|
+
[0.0.1]: https://github.com/oauth-xx/oauth2/compare/311d9f4...v0.0.1
|
113
|
+
[0.0.2]: https://github.com/oauth-xx/oauth2/compare/v0.0.1...v0.0.2
|
114
|
+
[0.0.3]: https://github.com/oauth-xx/oauth2/compare/v0.0.2...v0.0.3
|
115
|
+
[0.0.4]: https://github.com/oauth-xx/oauth2/compare/v0.0.3...v0.0.4
|
116
|
+
[0.0.5]: https://github.com/oauth-xx/oauth2/compare/v0.0.4...v0.0.5
|
117
|
+
[0.0.6]: https://github.com/oauth-xx/oauth2/compare/v0.0.5...v0.0.6
|
118
|
+
[0.0.7]: https://github.com/oauth-xx/oauth2/compare/v0.0.6...v0.0.7
|
119
|
+
[0.0.8]: https://github.com/oauth-xx/oauth2/compare/v0.0.7...v0.0.8
|
120
|
+
[0.0.9]: https://github.com/oauth-xx/oauth2/compare/v0.0.8...v0.0.9
|
121
|
+
[0.0.10]: https://github.com/oauth-xx/oauth2/compare/v0.0.9...v0.0.10
|
122
|
+
[0.0.11]: https://github.com/oauth-xx/oauth2/compare/v0.0.10...v0.0.11
|
123
|
+
[0.0.12]: https://github.com/oauth-xx/oauth2/compare/v0.0.11...v0.0.12
|
124
|
+
[0.0.13]: https://github.com/oauth-xx/oauth2/compare/v0.0.12...v0.0.13
|
125
|
+
[0.1.0]: https://github.com/oauth-xx/oauth2/compare/v0.0.13...v0.1.0
|
126
|
+
[0.1.1]: https://github.com/oauth-xx/oauth2/compare/v0.1.0...v0.1.1
|
127
|
+
[0.2.0]: https://github.com/oauth-xx/oauth2/compare/v0.1.1...v0.2.0
|
128
|
+
[0.3.0]: https://github.com/oauth-xx/oauth2/compare/v0.2.0...v0.3.0
|
129
|
+
[0.4.0]: https://github.com/oauth-xx/oauth2/compare/v0.3.0...v0.4.0
|
130
|
+
[0.4.1]: https://github.com/oauth-xx/oauth2/compare/v0.4.0...v0.4.1
|
131
|
+
[0.5.0]: https://github.com/oauth-xx/oauth2/compare/v0.4.1...v0.5.0
|
132
|
+
[1.0.0]: https://github.com/oauth-xx/oauth2/compare/v0.9.4...v1.0.0
|
133
|
+
[1.1.0]: https://github.com/oauth-xx/oauth2/compare/v1.0.0...v1.1.0
|
134
|
+
[1.2.0]: https://github.com/oauth-xx/oauth2/compare/v1.1.0...v1.2.0
|
135
|
+
[1.3.0]: https://github.com/oauth-xx/oauth2/compare/v1.2.0...v1.3.0
|
136
|
+
[1.3.1]: https://github.com/oauth-xx/oauth2/compare/v1.3.0...v1.3.1
|
137
|
+
[1.4.0]: https://github.com/oauth-xx/oauth2/compare/v1.3.1...v1.4.0
|
138
|
+
[1.4.1]: https://github.com/oauth-xx/oauth2/compare/v1.4.0...v1.4.1
|
139
|
+
[unreleased]: https://github.com/oauth-xx/oauth2/compare/v1.4.0...1-4-stable
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at peter.boling@gmail.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
|
4
|
+
|
5
|
+
gem 'faraday', '~> 0.9.2', :platforms => [:jruby_18, :ruby_18]
|
6
|
+
gem 'jwt', '< 1.5.2', :platforms => [:jruby_18, :ruby_18]
|
7
|
+
gem 'rake', '< 11.0'
|
8
|
+
gem 'rdoc', '~> 4.2.2'
|
9
|
+
|
10
|
+
group :test do
|
11
|
+
ruby_version = Gem::Version.new(RUBY_VERSION)
|
12
|
+
if ruby_version >= Gem::Version.new('2.1')
|
13
|
+
# TODO: Upgrade to >= 0.59 when we drop Rubies below 2.2
|
14
|
+
# Error: Unsupported Ruby version 2.1 found in `TargetRubyVersion` parameter (in .rubocop.yml). 2.1-compatible analysis was dropped after version 0.58.
|
15
|
+
# Supported versions: 2.2, 2.3, 2.4, 2.5
|
16
|
+
gem 'rubocop', '~> 0.57.0'
|
17
|
+
gem 'rubocop-rspec', '~> 1.27.0' # last version that can use rubocop < 0.58
|
18
|
+
end
|
19
|
+
gem 'pry', '~> 0.11' if ruby_version >= Gem::Version.new('2.0')
|
20
|
+
gem 'rspec-pending_for'
|
21
|
+
|
22
|
+
gem 'addressable', '~> 2.3.8'
|
23
|
+
gem 'backports'
|
24
|
+
gem 'coveralls'
|
25
|
+
gem 'rack', '~> 1.2', :platforms => [:jruby_18, :jruby_19, :ruby_18, :ruby_19, :ruby_20, :ruby_21]
|
26
|
+
gem 'rspec', '>= 3'
|
27
|
+
gem 'simplecov', '>= 0.9'
|
28
|
+
|
29
|
+
platforms :jruby_18, :ruby_18 do
|
30
|
+
gem 'mime-types', '~> 1.25'
|
31
|
+
gem 'rest-client', '~> 1.6.0'
|
32
|
+
end
|
33
|
+
|
34
|
+
platforms :ruby_18, :ruby_19 do
|
35
|
+
gem 'json', '< 2.0'
|
36
|
+
gem 'term-ansicolor', '< 1.4.0'
|
37
|
+
gem 'tins', '< 1.7'
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
gemspec
|
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2011 - 2013 Michael Bleigh and Intridea, Inc.
|
4
|
+
Copyright (c) 2017 - 2018 oauth-xx organization, https://github.com/oauth-xx
|
5
|
+
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
8
|
+
in the Software without restriction, including without limitation the rights
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
11
|
+
furnished to do so, subject to the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
14
|
+
copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
22
|
+
SOFTWARE.
|
data/README.md
CHANGED
@@ -1,30 +1,55 @@
|
|
1
1
|
# OAuth2
|
2
2
|
|
3
3
|
[![Gem Version](http://img.shields.io/gem/v/oauth2.svg)][gem]
|
4
|
-
[![
|
5
|
-
[![
|
6
|
-
[![
|
4
|
+
[![Total Downloads](https://img.shields.io/gem/dt/oauth2.svg)][gem]
|
5
|
+
[![Downloads Today](https://img.shields.io/gem/rt/oauth2.svg)][gem]
|
6
|
+
[![Build Status](http://img.shields.io/travis/oauth-xx/oauth2.svg)][travis]
|
7
7
|
[![Coverage Status](http://img.shields.io/coveralls/intridea/oauth2.svg)][coveralls]
|
8
|
+
[![Maintainability](https://api.codeclimate.com/v1/badges/688c612528ff90a46955/maintainability)][codeclimate-maintainability]
|
9
|
+
[![Depfu](https://badges.depfu.com/badges/6d34dc1ba682bbdf9ae2a97848241743/count.svg)][depfu]
|
10
|
+
[![Open Source Helpers](https://www.codetriage.com/oauth-xx/oauth2/badges/users.svg)][code-triage]
|
11
|
+
[![Chat](https://img.shields.io/gitter/room/oauth-xx/oauth2.svg)](https://gitter.im/oauth-xx/oauth2)
|
12
|
+
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)][source-license]
|
13
|
+
[![Documentation](http://inch-ci.org/github/oauth-xx/oauth2.png)][inch-ci]
|
8
14
|
|
9
15
|
[gem]: https://rubygems.org/gems/oauth2
|
10
|
-
[travis]: http://travis-ci.org/
|
11
|
-
[
|
12
|
-
[codeclimate]: https://codeclimate.com/github/
|
13
|
-
[
|
16
|
+
[travis]: http://travis-ci.org/oauth-xx/oauth2
|
17
|
+
[coveralls]: https://coveralls.io/r/oauth-xx/oauth2
|
18
|
+
[codeclimate-maintainability]: https://codeclimate.com/github/oauth-xx/oauth2/maintainability
|
19
|
+
[depfu]: https://depfu.com/github/oauth-xx/oauth2
|
20
|
+
[source-license]: https://opensource.org/licenses/MIT
|
21
|
+
[inch-ci]: http://inch-ci.org/github/oauth-xx/oauth2
|
22
|
+
[code-triage]: https://www.codetriage.com/oauth-xx/oauth2
|
14
23
|
|
15
|
-
A Ruby wrapper for the OAuth 2.0 specification.
|
24
|
+
A Ruby wrapper for the [OAuth 2.0 specification][oauth2-spec].
|
25
|
+
|
26
|
+
[oauth2-spec]: https://oauth.net/2/
|
16
27
|
|
17
28
|
## Installation
|
18
|
-
|
29
|
+
|
30
|
+
Add this line to your application's Gemfile:
|
31
|
+
|
32
|
+
```ruby
|
33
|
+
gem 'oauth2'
|
34
|
+
```
|
35
|
+
|
36
|
+
And then execute:
|
37
|
+
|
38
|
+
$ bundle
|
39
|
+
|
40
|
+
Or install it yourself as:
|
41
|
+
|
42
|
+
$ gem install oauth2
|
19
43
|
|
20
44
|
## Resources
|
45
|
+
|
21
46
|
* [View Source on GitHub][code]
|
22
47
|
* [Report Issues on GitHub][issues]
|
23
48
|
* [Read More at the Wiki][wiki]
|
24
49
|
|
25
|
-
[code]: https://github.com/
|
26
|
-
[issues]: https://github.com/
|
27
|
-
[wiki]: https://
|
50
|
+
[code]: https://github.com/oauth-xx/oauth2
|
51
|
+
[issues]: https://github.com/oauth-xx/oauth2/issues
|
52
|
+
[wiki]: https://github.com/oauth-xx/oauth2/wiki
|
28
53
|
|
29
54
|
## Usage Examples
|
30
55
|
|
@@ -100,19 +125,33 @@ You can always use the #request method on the OAuth2::Client instance to make
|
|
100
125
|
requests for tokens for any Authentication grant type.
|
101
126
|
|
102
127
|
## Supported Ruby Versions
|
128
|
+
|
103
129
|
This library aims to support and is [tested against][travis] the following Ruby
|
104
130
|
implementations:
|
105
131
|
|
106
|
-
|
132
|
+
### Rubies with support ending at Oauth2 2.x
|
133
|
+
|
107
134
|
* Ruby 1.9.3
|
108
135
|
* Ruby 2.0.0
|
109
136
|
* Ruby 2.1
|
110
137
|
* Ruby 2.2
|
111
|
-
*
|
138
|
+
* [JRuby 1.7][jruby-1.7] (targets MRI v1.9)
|
139
|
+
* [JRuby 9.0][jruby-9.0] (targets MRI v2.0)
|
140
|
+
|
141
|
+
---
|
142
|
+
|
143
|
+
### Rubies with continued support past Oauth2 2.x
|
144
|
+
|
145
|
+
* Ruby 2.3 - Support through version 3.x series
|
112
146
|
* Ruby 2.4
|
113
|
-
*
|
147
|
+
* Ruby 2.5
|
148
|
+
* [JRuby 9.1][jruby-9.1] (targets MRI v2.3)
|
149
|
+
* [JRuby 9.2][jruby-9.2] (targets MRI v2.5)
|
114
150
|
|
115
|
-
[jruby]:
|
151
|
+
[jruby-1.7]: https://www.jruby.org/2017/05/11/jruby-1-7-27.html
|
152
|
+
[jruby-9.0]: https://www.jruby.org/2016/01/26/jruby-9-0-5-0.html
|
153
|
+
[jruby-9.1]: https://www.jruby.org/2017/05/16/jruby-9-1-9-0.html
|
154
|
+
[jruby-9.2]: https://www.jruby.org/2018/05/24/jruby-9-2-0-0.html
|
116
155
|
|
117
156
|
If something doesn't work on one of these interpreters, it's a bug.
|
118
157
|
|
@@ -127,8 +166,51 @@ implementation, you will be responsible for providing patches in a timely
|
|
127
166
|
fashion. If critical issues for a particular implementation exist at the time
|
128
167
|
of a major release, support for that Ruby version may be dropped.
|
129
168
|
|
169
|
+
## Versioning
|
170
|
+
|
171
|
+
This library aims to adhere to [Semantic Versioning 2.0.0][semver].
|
172
|
+
Violations of this scheme should be reported as bugs. Specifically,
|
173
|
+
if a minor or patch version is released that breaks backward
|
174
|
+
compatibility, a new version should be immediately released that
|
175
|
+
restores compatibility. Breaking changes to the public API will
|
176
|
+
only be introduced with new major versions.
|
177
|
+
|
178
|
+
As a result of this policy, you can (and should) specify a
|
179
|
+
dependency on this gem using the [Pessimistic Version Constraint][pvc] with two digits of precision.
|
180
|
+
|
181
|
+
For example:
|
182
|
+
|
183
|
+
```ruby
|
184
|
+
spec.add_dependency 'oauth2', '~> 1.4'
|
185
|
+
```
|
186
|
+
|
187
|
+
[semver]: http://semver.org/
|
188
|
+
[pvc]: http://guides.rubygems.org/patterns/#pessimistic-version-constraint
|
189
|
+
|
130
190
|
## License
|
131
|
-
Copyright (c) 2011-2013 Michael Bleigh and Intridea, Inc. See [LICENSE][] for
|
132
|
-
details.
|
133
191
|
|
134
|
-
[
|
192
|
+
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)][source-license]
|
193
|
+
|
194
|
+
- Copyright (c) 2011-2013 Michael Bleigh and Intridea, Inc.
|
195
|
+
- Copyright (c) 2017-2018 [oauth-xx organization][oauth-xx]
|
196
|
+
- See [LICENSE][license] for details.
|
197
|
+
|
198
|
+
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Foauth-xx%2Foauth2.svg?type=large)][fossa2]
|
199
|
+
|
200
|
+
[license]: LICENSE
|
201
|
+
[oauth-xx]: https://github.com/oauth-xx
|
202
|
+
[fossa2]: https://app.fossa.io/projects/git%2Bgithub.com%2Foauth-xx%2Foauth2?ref=badge_large
|
203
|
+
|
204
|
+
## Development
|
205
|
+
|
206
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
207
|
+
|
208
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
209
|
+
|
210
|
+
## Contributing
|
211
|
+
|
212
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/oauth-xx/oauth2. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
213
|
+
|
214
|
+
## Code of Conduct
|
215
|
+
|
216
|
+
Everyone interacting in the OAuth2 project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/oauth-xx/oauth2/blob/master/CODE_OF_CONDUCT.md).
|