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.
data/CHANGELOG.md ADDED
@@ -0,0 +1,160 @@
1
+ # Change Log
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ ## unreleased
5
+
6
+ ## [1.4.5] - 2020-03-18
7
+
8
+ - [#535](https://github.com/oauth-xx/oauth2/pull/535) - Compatibility with range of supported Ruby OpenSSL versions, Rubocop updates, Github Actions (@pboling)
9
+ - [#518](https://github.com/oauth-xx/oauth2/pull/518) - Add extract_access_token option to OAuth2::Client (@jonspalmer)
10
+
11
+ ## [1.4.4] - 2020-02-12
12
+
13
+ - [#408](https://github.com/oauth-xx/oauth2/pull/408) - Fixed expires_at for formatted time (@Lomey)
14
+
15
+ ## [1.4.3] - 2020-01-29
16
+
17
+ - [#483](https://github.com/oauth-xx/oauth2/pull/483) - add project metadata to gemspec (@orien)
18
+ - [#495](https://github.com/oauth-xx/oauth2/pull/495) - support additional types of access token requests (@SteveyblamFreeagent, @thomcorley, @dgholz)
19
+ - Adds support for private_key_jwt and tls_client_auth
20
+ - [#433](https://github.com/oauth-xx/oauth2/pull/433) - allow field names with square brackets and numbers in params (@asm256)
21
+
22
+ ## [1.4.2] - 2019-10-01
23
+
24
+ - [#478](https://github.com/oauth-xx/oauth2/pull/478) - support latest version of faraday & fix build (@pboling)
25
+ - officially support Ruby 2.6 and truffleruby
26
+
27
+ ## [1.4.1] - 2018-10-13
28
+
29
+ - [#417](https://github.com/oauth-xx/oauth2/pull/417) - update jwt dependency (@thewoolleyman)
30
+ - [#419](https://github.com/oauth-xx/oauth2/pull/419) - remove rubocop dependency (temporary, added back in [#423](https://github.com/oauth-xx/oauth2/pull/423)) (@pboling)
31
+ - [#418](https://github.com/oauth-xx/oauth2/pull/418) - update faraday dependency (@pboling)
32
+ - [#420](https://github.com/oauth-xx/oauth2/pull/420) - update [oauth2.gemspec](https://github.com/oauth-xx/oauth2/blob/1-4-stable/oauth2.gemspec) (@pboling)
33
+ - [#421](https://github.com/oauth-xx/oauth2/pull/421) - fix [CHANGELOG.md](https://github.com/oauth-xx/oauth2/blob/1-4-stable/CHANGELOG.md) for previous releases (@pboling)
34
+ - [#422](https://github.com/oauth-xx/oauth2/pull/422) - update [LICENSE](https://github.com/oauth-xx/oauth2/blob/1-4-stable/LICENSE) and [README.md](https://github.com/oauth-xx/oauth2/blob/1-4-stable/README.md) (@pboling)
35
+ - [#423](https://github.com/oauth-xx/oauth2/pull/423) - update [builds](https://travis-ci.org/oauth-xx/oauth2/builds), [Rakefile](https://github.com/oauth-xx/oauth2/blob/1-4-stable/Rakefile) (@pboling)
36
+ - officially document supported Rubies
37
+ * Ruby 1.9.3
38
+ * Ruby 2.0.0
39
+ * Ruby 2.1
40
+ * Ruby 2.2
41
+ * [JRuby 1.7][jruby-1.7] (targets MRI v1.9)
42
+ * [JRuby 9.0][jruby-9.0] (targets MRI v2.0)
43
+ * Ruby 2.3
44
+ * Ruby 2.4
45
+ * Ruby 2.5
46
+ * [JRuby 9.1][jruby-9.1] (targets MRI v2.3)
47
+ * [JRuby 9.2][jruby-9.2] (targets MRI v2.5)
48
+
49
+ [jruby-1.7]: https://www.jruby.org/2017/05/11/jruby-1-7-27.html
50
+ [jruby-9.0]: https://www.jruby.org/2016/01/26/jruby-9-0-5-0.html
51
+ [jruby-9.1]: https://www.jruby.org/2017/05/16/jruby-9-1-9-0.html
52
+ [jruby-9.2]: https://www.jruby.org/2018/05/24/jruby-9-2-0-0.html
53
+
54
+ ## [1.4.0] - 2017-06-09
55
+
56
+ - Drop Ruby 1.8.7 support (@sferik)
57
+ - Fix some RuboCop offenses (@sferik)
58
+ - _Dependency_: Remove Yardstick (@sferik)
59
+ - _Dependency_: Upgrade Faraday to 0.12 (@sferik)
60
+
61
+ ## [1.3.1] - 2017-03-03
62
+
63
+ - Add support for Ruby 2.4.0 (@pschambacher)
64
+ - _Dependency_: Upgrade Faraday to Faraday 0.11 (@mcfiredrill, @rhymes, @pschambacher)
65
+
66
+ ## [1.3.0] - 2016-12-28
67
+
68
+ - Add support for header-based authentication to the `Client` so it can be used across the library (@bjeanes)
69
+ - Default to header-based authentication when getting a token from an authorisation code (@maletor)
70
+ - **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)
71
+ - Handle `redirect_uri` according to the OAuth 2 spec, so it is passed on redirect and at the point of token exchange (@bjeanes)
72
+ - Refactor handling of encoding of error responses (@urkle)
73
+ - Avoid instantiating an `Error` if there is no error to raise (@urkle)
74
+ - Add support for Faraday 0.10 (@rhymes)
75
+
76
+ ## [1.2.0] - 2016-07-01
77
+
78
+ - Properly handle encoding of error responses (so we don't blow up, for example, when Google's response includes a ∞) (@Motoshi-Nishihira)
79
+ - Make a copy of the options hash in `AccessToken#from_hash` to avoid accidental mutations (@Linuus)
80
+ - Use `raise` rather than `fail` to throw exceptions (@sferik)
81
+
82
+ ## [1.1.0] - 2016-01-30
83
+
84
+ - 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)
85
+ - Add support for Rack 2, and bump various other dependencies (@sferik)
86
+
87
+ ## [1.0.0] - 2014-07-09
88
+
89
+ ### Added
90
+ - Add an implementation of the MAC token spec.
91
+
92
+ ### Fixed
93
+ - Fix Base64.strict_encode64 incompatibility with Ruby 1.8.7.
94
+
95
+ ## [0.5.0] - 2011-07-29
96
+
97
+ ### Changed
98
+ - [breaking] `oauth_token` renamed to `oauth_bearer`.
99
+ - [breaking] `authorize_path` Client option renamed to `authorize_url`.
100
+ - [breaking] `access_token_path` Client option renamed to `token_url`.
101
+ - [breaking] `access_token_method` Client option renamed to `token_method`.
102
+ - [breaking] `web_server` renamed to `auth_code`.
103
+
104
+ ## [0.4.1] - 2011-04-20
105
+
106
+ ## [0.4.0] - 2011-04-20
107
+
108
+ ## [0.3.0] - 2011-04-08
109
+
110
+ ## [0.2.0] - 2011-04-01
111
+
112
+ ## [0.1.1] - 2011-01-12
113
+
114
+ ## [0.1.0] - 2010-10-13
115
+
116
+ ## [0.0.13] + [0.0.12] + [0.0.11] - 2010-08-17
117
+
118
+ ## [0.0.10] - 2010-06-19
119
+
120
+ ## [0.0.9] - 2010-06-18
121
+
122
+ ## [0.0.8] + [0.0.7] - 2010-04-27
123
+
124
+ ## [0.0.6] - 2010-04-25
125
+
126
+ ## [0.0.5] - 2010-04-23
127
+
128
+ ## [0.0.4] + [0.0.3] + [0.0.2] + [0.0.1] - 2010-04-22
129
+
130
+
131
+ [0.0.1]: https://github.com/oauth-xx/oauth2/compare/311d9f4...v0.0.1
132
+ [0.0.2]: https://github.com/oauth-xx/oauth2/compare/v0.0.1...v0.0.2
133
+ [0.0.3]: https://github.com/oauth-xx/oauth2/compare/v0.0.2...v0.0.3
134
+ [0.0.4]: https://github.com/oauth-xx/oauth2/compare/v0.0.3...v0.0.4
135
+ [0.0.5]: https://github.com/oauth-xx/oauth2/compare/v0.0.4...v0.0.5
136
+ [0.0.6]: https://github.com/oauth-xx/oauth2/compare/v0.0.5...v0.0.6
137
+ [0.0.7]: https://github.com/oauth-xx/oauth2/compare/v0.0.6...v0.0.7
138
+ [0.0.8]: https://github.com/oauth-xx/oauth2/compare/v0.0.7...v0.0.8
139
+ [0.0.9]: https://github.com/oauth-xx/oauth2/compare/v0.0.8...v0.0.9
140
+ [0.0.10]: https://github.com/oauth-xx/oauth2/compare/v0.0.9...v0.0.10
141
+ [0.0.11]: https://github.com/oauth-xx/oauth2/compare/v0.0.10...v0.0.11
142
+ [0.0.12]: https://github.com/oauth-xx/oauth2/compare/v0.0.11...v0.0.12
143
+ [0.0.13]: https://github.com/oauth-xx/oauth2/compare/v0.0.12...v0.0.13
144
+ [0.1.0]: https://github.com/oauth-xx/oauth2/compare/v0.0.13...v0.1.0
145
+ [0.1.1]: https://github.com/oauth-xx/oauth2/compare/v0.1.0...v0.1.1
146
+ [0.2.0]: https://github.com/oauth-xx/oauth2/compare/v0.1.1...v0.2.0
147
+ [0.3.0]: https://github.com/oauth-xx/oauth2/compare/v0.2.0...v0.3.0
148
+ [0.4.0]: https://github.com/oauth-xx/oauth2/compare/v0.3.0...v0.4.0
149
+ [0.4.1]: https://github.com/oauth-xx/oauth2/compare/v0.4.0...v0.4.1
150
+ [0.5.0]: https://github.com/oauth-xx/oauth2/compare/v0.4.1...v0.5.0
151
+ [1.0.0]: https://github.com/oauth-xx/oauth2/compare/v0.9.4...v1.0.0
152
+ [1.1.0]: https://github.com/oauth-xx/oauth2/compare/v1.0.0...v1.1.0
153
+ [1.2.0]: https://github.com/oauth-xx/oauth2/compare/v1.1.0...v1.2.0
154
+ [1.3.0]: https://github.com/oauth-xx/oauth2/compare/v1.2.0...v1.3.0
155
+ [1.3.1]: https://github.com/oauth-xx/oauth2/compare/v1.3.0...v1.3.1
156
+ [1.4.0]: https://github.com/oauth-xx/oauth2/compare/v1.3.1...v1.4.0
157
+ [1.4.1]: https://github.com/oauth-xx/oauth2/compare/v1.4.0...v1.4.1
158
+ [1.4.2]: https://github.com/oauth-xx/oauth2/compare/v1.4.1...v1.4.2
159
+ [1.4.3]: https://github.com/oauth-xx/oauth2/compare/v1.4.2...v1.4.3
160
+ [unreleased]: https://github.com/oauth-xx/oauth2/compare/v1.4.1...HEAD
@@ -0,0 +1,133 @@
1
+
2
+ # Contributor Covenant Code of Conduct
3
+
4
+ ## Our Pledge
5
+
6
+ We as members, contributors, and leaders pledge to make participation in our
7
+ community a harassment-free experience for everyone, regardless of age, body
8
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
9
+ identity and expression, level of experience, education, socio-economic status,
10
+ nationality, personal appearance, race, religion, or sexual identity
11
+ and orientation.
12
+
13
+ We pledge to act and interact in ways that contribute to an open, welcoming,
14
+ diverse, inclusive, and healthy community.
15
+
16
+ ## Our Standards
17
+
18
+ Examples of behavior that contributes to a positive environment for our
19
+ community include:
20
+
21
+ * Demonstrating empathy and kindness toward other people
22
+ * Being respectful of differing opinions, viewpoints, and experiences
23
+ * Giving and gracefully accepting constructive feedback
24
+ * Accepting responsibility and apologizing to those affected by our mistakes,
25
+ and learning from the experience
26
+ * Focusing on what is best not just for us as individuals, but for the
27
+ overall community
28
+
29
+ Examples of unacceptable behavior include:
30
+
31
+ * The use of sexualized language or imagery, and sexual attention or
32
+ advances of any kind
33
+ * Trolling, insulting or derogatory comments, and personal or political attacks
34
+ * Public or private harassment
35
+ * Publishing others' private information, such as a physical or email
36
+ address, without their explicit permission
37
+ * Other conduct which could reasonably be considered inappropriate in a
38
+ professional setting
39
+
40
+ ## Enforcement Responsibilities
41
+
42
+ Community leaders are responsible for clarifying and enforcing our standards of
43
+ acceptable behavior and will take appropriate and fair corrective action in
44
+ response to any behavior that they deem inappropriate, threatening, offensive,
45
+ or harmful.
46
+
47
+ Community leaders have the right and responsibility to remove, edit, or reject
48
+ comments, commits, code, wiki edits, issues, and other contributions that are
49
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
50
+ decisions when appropriate.
51
+
52
+ ## Scope
53
+
54
+ This Code of Conduct applies within all community spaces, and also applies when
55
+ an individual is officially representing the community in public spaces.
56
+ Examples of representing our community include using an official e-mail address,
57
+ posting via an official social media account, or acting as an appointed
58
+ representative at an online or offline event.
59
+
60
+ ## Enforcement
61
+
62
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
63
+ reported to the community leaders responsible for enforcement at
64
+ [INSERT CONTACT METHOD].
65
+ All complaints will be reviewed and investigated promptly and fairly.
66
+
67
+ All community leaders are obligated to respect the privacy and security of the
68
+ reporter of any incident.
69
+
70
+ ## Enforcement Guidelines
71
+
72
+ Community leaders will follow these Community Impact Guidelines in determining
73
+ the consequences for any action they deem in violation of this Code of Conduct:
74
+
75
+ ### 1. Correction
76
+
77
+ **Community Impact**: Use of inappropriate language or other behavior deemed
78
+ unprofessional or unwelcome in the community.
79
+
80
+ **Consequence**: A private, written warning from community leaders, providing
81
+ clarity around the nature of the violation and an explanation of why the
82
+ behavior was inappropriate. A public apology may be requested.
83
+
84
+ ### 2. Warning
85
+
86
+ **Community Impact**: A violation through a single incident or series
87
+ of actions.
88
+
89
+ **Consequence**: A warning with consequences for continued behavior. No
90
+ interaction with the people involved, including unsolicited interaction with
91
+ those enforcing the Code of Conduct, for a specified period of time. This
92
+ includes avoiding interactions in community spaces as well as external channels
93
+ like social media. Violating these terms may lead to a temporary or
94
+ permanent ban.
95
+
96
+ ### 3. Temporary Ban
97
+
98
+ **Community Impact**: A serious violation of community standards, including
99
+ sustained inappropriate behavior.
100
+
101
+ **Consequence**: A temporary ban from any sort of interaction or public
102
+ communication with the community for a specified period of time. No public or
103
+ private interaction with the people involved, including unsolicited interaction
104
+ with those enforcing the Code of Conduct, is allowed during this period.
105
+ Violating these terms may lead to a permanent ban.
106
+
107
+ ### 4. Permanent Ban
108
+
109
+ **Community Impact**: Demonstrating a pattern of violation of community
110
+ standards, including sustained inappropriate behavior, harassment of an
111
+ individual, or aggression toward or disparagement of classes of individuals.
112
+
113
+ **Consequence**: A permanent ban from any sort of public interaction within
114
+ the community.
115
+
116
+ ## Attribution
117
+
118
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
119
+ version 2.0, available at
120
+ [https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0].
121
+
122
+ Community Impact Guidelines were inspired by
123
+ [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
124
+
125
+ For answers to common questions about this code of conduct, see the FAQ at
126
+ [https://www.contributor-covenant.org/faq][FAQ]. Translations are available
127
+ at [https://www.contributor-covenant.org/translations][translations].
128
+
129
+ [homepage]: https://www.contributor-covenant.org
130
+ [v2.0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html
131
+ [Mozilla CoC]: https://github.com/mozilla/diversity
132
+ [FAQ]: https://www.contributor-covenant.org/faq
133
+ [translations]: https://www.contributor-covenant.org/translations
data/Gemfile ADDED
@@ -0,0 +1,61 @@
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/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,73 @@
1
1
  # OAuth2
2
2
 
3
+ If you need the readme for a released version of the gem please find it below:
4
+
5
+ | Version | Release Date | Readme |
6
+ |----------|--------------|----------------------------------------------------------|
7
+ | 1.4.4 | Feb 12, 2020 | https://github.com/oauth-xx/oauth2/blob/v1.4.4/README.md |
8
+ | 1.4.3 | Jan 29, 2020 | https://github.com/oauth-xx/oauth2/blob/v1.4.3/README.md |
9
+ | 1.4.2 | Oct 1, 2019 | https://github.com/oauth-xx/oauth2/blob/v1.4.2/README.md |
10
+ | 1.4.1 | Oct 13, 2018 | https://github.com/oauth-xx/oauth2/blob/v1.4.1/README.md |
11
+ | 1.4.0 | Jun 9, 2017 | https://github.com/oauth-xx/oauth2/blob/v1.4.0/README.md |
12
+ | 1.3.1 | Mar 3, 2017 | https://github.com/oauth-xx/oauth2/blob/v1.3.1/README.md |
13
+ | 1.3.0 | Dec 27, 2016 | https://github.com/oauth-xx/oauth2/blob/v1.3.0/README.md |
14
+ | 1.2.0 | Jun 30, 2016 | https://github.com/oauth-xx/oauth2/blob/v1.2.0/README.md |
15
+ | 1.1.0 | Jan 30, 2016 | https://github.com/oauth-xx/oauth2/blob/v1.1.0/README.md |
16
+ | 1.0.0 | May 23, 2014 | https://github.com/oauth-xx/oauth2/blob/v1.0.0/README.md |
17
+ | < 1.0.0 | Find here | https://github.com/oauth-xx/oauth2/tags |
18
+
3
19
  [![Gem Version](http://img.shields.io/gem/v/oauth2.svg)][gem]
4
- [![Build Status](http://img.shields.io/travis/intridea/oauth2.svg)][travis]
5
- [![Dependency Status](http://img.shields.io/gemnasium/intridea/oauth2.svg)][gemnasium]
6
- [![Code Climate](http://img.shields.io/codeclimate/github/intridea/oauth2.svg)][codeclimate]
7
- [![Coverage Status](http://img.shields.io/coveralls/intridea/oauth2.svg)][coveralls]
20
+ [![Total Downloads](https://img.shields.io/gem/dt/oauth2.svg)][gem]
21
+ [![Downloads Today](https://img.shields.io/gem/rt/oauth2.svg)][gem]
22
+ [![Build Status](https://travis-ci.org/oauth-xx/oauth2.svg?branch=1-4-stable)][travis]
23
+ [![Test Coverage](https://api.codeclimate.com/v1/badges/688c612528ff90a46955/test_coverage)][codeclimate-coverage]
24
+ [![Maintainability](https://api.codeclimate.com/v1/badges/688c612528ff90a46955/maintainability)][codeclimate-maintainability]
25
+ [![Depfu](https://badges.depfu.com/badges/6d34dc1ba682bbdf9ae2a97848241743/count.svg)][depfu]
26
+ [![Open Source Helpers](https://www.codetriage.com/oauth-xx/oauth2/badges/users.svg)][code-triage]
27
+ [![Chat](https://img.shields.io/gitter/room/oauth-xx/oauth2.svg)](https://gitter.im/oauth-xx/oauth2)
28
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)][source-license]
29
+ [![Documentation](http://inch-ci.org/github/oauth-xx/oauth2.png)][inch-ci]
8
30
 
9
31
  [gem]: https://rubygems.org/gems/oauth2
10
- [travis]: http://travis-ci.org/intridea/oauth2
11
- [gemnasium]: https://gemnasium.com/intridea/oauth2
12
- [codeclimate]: https://codeclimate.com/github/intridea/oauth2
13
- [coveralls]: https://coveralls.io/r/intridea/oauth2
32
+ [travis]: http://travis-ci.org/oauth-xx/oauth2
33
+ [coveralls]: https://coveralls.io/r/oauth-xx/oauth2
34
+ [codeclimate-maintainability]: https://codeclimate.com/github/oauth-xx/oauth2/maintainability
35
+ [codeclimate-coverage]: https://codeclimate.com/github/oauth-xx/oauth2/test_coverage
36
+ [depfu]: https://depfu.com/github/oauth-xx/oauth2
37
+ [source-license]: https://opensource.org/licenses/MIT
38
+ [inch-ci]: http://inch-ci.org/github/oauth-xx/oauth2
39
+ [code-triage]: https://www.codetriage.com/oauth-xx/oauth2
40
+ [fossa1]: https://app.fossa.io/projects/git%2Bgithub.com%2Foauth-xx%2Foauth2?ref=badge_shield
41
+
42
+ A Ruby wrapper for the [OAuth 2.0 specification][oauth2-spec].
14
43
 
15
- A Ruby wrapper for the OAuth 2.0 specification.
44
+ [oauth2-spec]: https://oauth.net/2/
16
45
 
17
46
  ## Installation
18
- gem install oauth2
47
+
48
+ Add this line to your application's Gemfile:
49
+
50
+ ```ruby
51
+ gem 'oauth2'
52
+ ```
53
+
54
+ And then execute:
55
+
56
+ $ bundle
57
+
58
+ Or install it yourself as:
59
+
60
+ $ gem install oauth2
19
61
 
20
62
  ## Resources
63
+
21
64
  * [View Source on GitHub][code]
22
65
  * [Report Issues on GitHub][issues]
23
66
  * [Read More at the Wiki][wiki]
24
67
 
25
- [code]: https://github.com/intridea/oauth2
26
- [issues]: https://github.com/intridea/oauth2/issues
27
- [wiki]: https://wiki.github.com/intridea/oauth2
68
+ [code]: https://github.com/oauth-xx/oauth2
69
+ [issues]: https://github.com/oauth-xx/oauth2/issues
70
+ [wiki]: https://wiki.github.com/oauth-xx/oauth2
28
71
 
29
72
  ## Usage Examples
30
73
 
@@ -36,11 +79,12 @@ client.auth_code.authorize_url(:redirect_uri => 'http://localhost:8080/oauth2/ca
36
79
  # => "https://example.org/oauth/authorization?response_type=code&client_id=client_id&redirect_uri=http://localhost:8080/oauth2/callback"
37
80
 
38
81
  token = client.auth_code.get_token('authorization_code_value', :redirect_uri => 'http://localhost:8080/oauth2/callback', :headers => {'Authorization' => 'Basic some_password'})
39
- response = token.get('/api/resource', :params => { 'query_foo' => 'bar' })
82
+ response = token.get('/api/resource', :params => {'query_foo' => 'bar'})
40
83
  response.class.name
41
84
  # => OAuth2::Response
42
85
  ```
43
86
  ## OAuth2::Response
87
+
44
88
  The AccessToken methods #get, #post, #put and #delete and the generic #request
45
89
  will return an instance of the #OAuth2::Response class.
46
90
 
@@ -53,12 +97,14 @@ The original response body, headers, and status can be accessed via their
53
97
  respective methods.
54
98
 
55
99
  ## OAuth2::AccessToken
100
+
56
101
  If you have an existing Access Token for a user, you can initialize an instance
57
102
  using various class methods including the standard new, from_hash (if you have
58
103
  a hash of the values), or from_kvform (if you have an
59
104
  application/x-www-form-urlencoded encoded string of the values).
60
105
 
61
106
  ## OAuth2::Error
107
+
62
108
  On 400+ status code responses, an OAuth2::Error will be raised. If it is a
63
109
  standard OAuth2 error response, the body will be parsed and #code and #description will contain the values provided from the error and
64
110
  error_description parameters. The #response property of OAuth2::Error will
@@ -70,6 +116,7 @@ instance will be returned as usual and on 400+ status code responses, the
70
116
  Response instance will contain the OAuth2::Error instance.
71
117
 
72
118
  ## Authorization Grants
119
+
73
120
  Currently the Authorization Code, Implicit, Resource Owner Password Credentials, Client Credentials, and Assertion
74
121
  authentication grant types have helper strategy classes that simplify client
75
122
  use. They are available via the #auth_code, #implicit, #password, #client_credentials, and #assertion methods respectively.
@@ -100,18 +147,38 @@ You can always use the #request method on the OAuth2::Client instance to make
100
147
  requests for tokens for any Authentication grant type.
101
148
 
102
149
  ## Supported Ruby Versions
150
+
103
151
  This library aims to support and is [tested against][travis] the following Ruby
104
152
  implementations:
105
153
 
154
+ ### Rubies with support ending at Oauth2 1.x
155
+
106
156
  * Ruby 1.9.3
157
+ - [JRuby 1.7][jruby-1.7] (targets MRI v1.9)
158
+
107
159
  * Ruby 2.0.0
160
+ - [JRuby 9.0][jruby-9.0] (targets MRI v2.0)
108
161
  * Ruby 2.1
109
- * Ruby 2.2
110
- * Ruby 2.3
111
- * Ruby 2.4
112
- * [JRuby 9K][jruby]
113
162
 
114
- [jruby]: http://jruby.org/
163
+ ---
164
+
165
+ ### Rubies with continued support past Oauth2 2.x
166
+
167
+ * Ruby 2.2 - Support ends with version 2.x series
168
+ * Ruby 2.3 - Support ends with version 3.x series
169
+ - [JRuby 9.1][jruby-9.1] (targets MRI v2.3)
170
+ * Ruby 2.4 - Support ends with version 4.x series
171
+ * Ruby 2.5 - Support ends with version 5.x series
172
+ - [JRuby 9.2][jruby-9.2] (targets MRI v2.5)
173
+ - [truffleruby][truffleruby] (targets MRI 2.5)
174
+ * Ruby 2.6 - Support ends with version 6.x series
175
+ * Ruby 2.7 - Support ends with version 7.x series
176
+
177
+ [jruby-1.7]: https://www.jruby.org/2017/05/11/jruby-1-7-27.html
178
+ [jruby-9.0]: https://www.jruby.org/2016/01/26/jruby-9-0-5-0.html
179
+ [jruby-9.1]: https://www.jruby.org/2017/05/16/jruby-9-1-9-0.html
180
+ [jruby-9.2]: https://www.jruby.org/2018/05/24/jruby-9-2-0-0.html
181
+ [truffleruby]: https://github.com/oracle/truffleruby
115
182
 
116
183
  If something doesn't work on one of these interpreters, it's a bug.
117
184
 
@@ -126,8 +193,51 @@ implementation, you will be responsible for providing patches in a timely
126
193
  fashion. If critical issues for a particular implementation exist at the time
127
194
  of a major release, support for that Ruby version may be dropped.
128
195
 
196
+ ## Versioning
197
+
198
+ This library aims to adhere to [Semantic Versioning 2.0.0][semver].
199
+ Violations of this scheme should be reported as bugs. Specifically,
200
+ if a minor or patch version is released that breaks backward
201
+ compatibility, a new version should be immediately released that
202
+ restores compatibility. Breaking changes to the public API will
203
+ only be introduced with new major versions.
204
+
205
+ As a result of this policy, you can (and should) specify a
206
+ dependency on this gem using the [Pessimistic Version Constraint][pvc] with two digits of precision.
207
+
208
+ For example:
209
+
210
+ ```ruby
211
+ spec.add_dependency 'oauth2', '~> 1.4'
212
+ ```
213
+
214
+ [semver]: http://semver.org/
215
+ [pvc]: http://guides.rubygems.org/patterns/#pessimistic-version-constraint
216
+
129
217
  ## License
130
- Copyright (c) 2011-2013 Michael Bleigh and Intridea, Inc. See [LICENSE][] for
131
- details.
132
218
 
133
- [license]: LICENSE.md
219
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)][source-license]
220
+
221
+ - Copyright (c) 2011-2013 Michael Bleigh and Intridea, Inc.
222
+ - Copyright (c) 2017-2018 [oauth-xx organization][oauth-xx]
223
+ - See [LICENSE][license] for details.
224
+
225
+ [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Foauth-xx%2Foauth2.svg?type=large)][fossa2]
226
+
227
+ [license]: LICENSE
228
+ [oauth-xx]: https://github.com/oauth-xx
229
+ [fossa2]: https://app.fossa.io/projects/git%2Bgithub.com%2Foauth-xx%2Foauth2?ref=badge_large
230
+
231
+ ## Development
232
+
233
+ After checking out the repo, run `bundle install` to install dependencies. Then, run `rake spec` to run the tests.
234
+
235
+ 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).
236
+
237
+ ## Contributing
238
+
239
+ 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.
240
+
241
+ ## Code of Conduct
242
+
243
+ 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).