oauth 0.5.7 → 0.5.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +64 -104
  3. data/CODE_OF_CONDUCT.md +0 -0
  4. data/CONTRIBUTING.md +23 -0
  5. data/LICENSE +0 -0
  6. data/README.md +245 -96
  7. data/SECURITY.md +16 -0
  8. data/TODO +0 -0
  9. data/lib/oauth/cli/authorize_command.rb +8 -10
  10. data/lib/oauth/cli/base_command.rb +8 -6
  11. data/lib/oauth/cli/help_command.rb +0 -0
  12. data/lib/oauth/cli/query_command.rb +3 -3
  13. data/lib/oauth/cli/sign_command.rb +12 -15
  14. data/lib/oauth/cli/version_command.rb +0 -0
  15. data/lib/oauth/cli.rb +2 -2
  16. data/lib/oauth/client/action_controller_request.rb +14 -15
  17. data/lib/oauth/client/em_http.rb +28 -28
  18. data/lib/oauth/client/helper.rb +14 -17
  19. data/lib/oauth/client/net_http.rb +27 -27
  20. data/lib/oauth/client.rb +0 -0
  21. data/lib/oauth/consumer.rb +52 -62
  22. data/lib/oauth/errors/error.rb +0 -0
  23. data/lib/oauth/errors/problem.rb +0 -0
  24. data/lib/oauth/errors/unauthorized.rb +0 -0
  25. data/lib/oauth/errors.rb +0 -0
  26. data/lib/oauth/helper.rb +7 -7
  27. data/lib/oauth/oauth.rb +4 -4
  28. data/lib/oauth/oauth_test_helper.rb +0 -0
  29. data/lib/oauth/request_proxy/action_controller_request.rb +0 -0
  30. data/lib/oauth/request_proxy/action_dispatch_request.rb +0 -0
  31. data/lib/oauth/request_proxy/base.rb +3 -3
  32. data/lib/oauth/request_proxy/curb_request.rb +0 -0
  33. data/lib/oauth/request_proxy/em_http_request.rb +0 -0
  34. data/lib/oauth/request_proxy/jabber_request.rb +0 -0
  35. data/lib/oauth/request_proxy/mock_request.rb +0 -0
  36. data/lib/oauth/request_proxy/net_http.rb +2 -2
  37. data/lib/oauth/request_proxy/rack_request.rb +0 -0
  38. data/lib/oauth/request_proxy/rest_client_request.rb +2 -2
  39. data/lib/oauth/request_proxy/typhoeus_request.rb +0 -0
  40. data/lib/oauth/request_proxy.rb +3 -3
  41. data/lib/oauth/server.rb +8 -10
  42. data/lib/oauth/signature/base.rb +3 -4
  43. data/lib/oauth/signature/hmac/sha1.rb +1 -1
  44. data/lib/oauth/signature/hmac/sha256.rb +1 -1
  45. data/lib/oauth/signature/plaintext.rb +0 -0
  46. data/lib/oauth/signature/rsa/sha1.rb +3 -3
  47. data/lib/oauth/signature.rb +5 -5
  48. data/lib/oauth/token.rb +0 -0
  49. data/lib/oauth/tokens/access_token.rb +0 -0
  50. data/lib/oauth/tokens/consumer_token.rb +2 -2
  51. data/lib/oauth/tokens/request_token.rb +7 -8
  52. data/lib/oauth/tokens/server_token.rb +0 -1
  53. data/lib/oauth/tokens/token.rb +0 -0
  54. data/lib/oauth/version.rb +1 -1
  55. data/lib/oauth.rb +0 -0
  56. metadata +17 -182
data/README.md CHANGED
@@ -1,59 +1,240 @@
1
+ <p align="center">
2
+ <a href="http://oauth.net/core/1.0/" target="_blank" rel="noopener">
3
+ <img width="124px" src="https://github.com/oauth-xx/oauth-ruby/raw/master/docs/images/logo/Oauth_logo.svg?raw=true" alt="OAuth 1.0 Logo by Chris Messina, CC BY-SA 3.0, via Wikimedia Commons">
4
+ </a>
5
+ <a href="https://www.ruby-lang.org/" target="_blank" rel="noopener">
6
+ <img width="124px" src="https://github.com/oauth-xx/oauth-ruby/raw/master/docs/images/logo/ruby-logo-198px.svg?raw=true" alt="Yukihiro Matsumoto, Ruby Visual Identity Team, CC BY-SA 2.5">
7
+ </a>
8
+ </p>
9
+
1
10
  # Ruby OAuth
2
11
 
12
+ OAuth 1.0 is an industry-standard protocol for authorization.
13
+
14
+ This is a RubyGem for implementing both OAuth 1.0 clients and servers in Ruby applications.
15
+ See the sibling `oauth2` gem for OAuth 2.0 implementations in Ruby.
16
+
17
+ * [OAuth 1.0 Spec][oauth1-spec]
18
+ * [oauth2 sibling gem][sibling-gem] for OAuth 2.0 implementations in Ruby.
19
+
20
+ [oauth1-spec]: http://oauth.net/core/1.0/
21
+ [sibling-gem]: https://github.com/oauth-xx/oauth-ruby
22
+
3
23
  **NOTE**
4
24
 
5
- This README, on branch `v0.5-maintenance`, targets 0.5.x series releases. For later releases please see the `msater` branch README.
25
+ This README, on branch `v0.5-maintenance`, targets 0.5.x series releases. For later releases please see the `master` branch README.
6
26
 
7
27
  ## Status
8
28
 
9
- | Project | Ruby Oauth |
10
- |--------------------------- |--------------------------- |
11
- | name, license, docs | [![RubyGems.org](https://img.shields.io/badge/name-oauth-brightgreen.svg?style=flat)][rubygems] [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)][license-ref] [![RubyDoc.info](https://img.shields.io/badge/documentation-rubydoc-brightgreen.svg?style=flat)][documentation] |
12
- | version & downloads | [![Version](https://img.shields.io/gem/v/oauth.svg)][rubygems] [![Downloads Today](https://img.shields.io/gem/rd/oauth.svg)][rubygems] [![Homepage](https://img.shields.io/badge/source-github-brightgreen.svg?style=flat)][source] |
13
- | dependencies & linting | [![Depfu](https://badges.depfu.com/badges/d570491bac0ad3b0b65deb3c82028327/count.svg)][depfu] [![lint status](https://github.com/oauth-xx/oauth-ruby/actions/workflows/style.yml/badge.svg)][actions] |
14
- | unit tests | [![supported rubies](https://github.com/oauth-xx/oauth-ruby/actions/workflows/supported.yml/badge.svg)][actions] [![unsupported status](https://github.com/oauth-xx/oauth-ruby/actions/workflows/unsupported.yml/badge.svg)][actions] |
15
- | coverage & maintainability | [![Test Coverage](https://api.codeclimate.com/v1/badges/3cf23270c21e8791d788/test_coverage)][climate_coverage] [![codecov](https://codecov.io/gh/oauth-xx/oauth-ruby/branch/master/graph/badge.svg?token=4ZNAWNxrf9)][codecov_coverage] [![Maintainability](https://api.codeclimate.com/v1/badges/3cf23270c21e8791d788/maintainability)][climate_maintainability] |
16
- | resources | [![Discussion](https://img.shields.io/badge/discussions-github-brightgreen.svg?style=flat)][gh_discussions] [![Mailing List](https://img.shields.io/badge/group-mailinglist-violet.svg?style=social&logo=google)][mailinglist] [![Join the chat at https://gitter.im/oauth-xx/oauth-ruby](https://badges.gitter.im/Join%20Chat.svg)][chat] [![Blog](https://img.shields.io/badge/blog-railsbling-brightgreen.svg?style=flat)][blogpage] |
17
- | Spread ~♡ⓛⓞⓥⓔ♡~ | [![Open Source Helpers](https://www.codetriage.com/oauth-xx/oauth-ruby/badges/users.svg)][code_triage] [![Liberapay Patrons](https://img.shields.io/liberapay/patrons/pboling.svg?logo=liberapay)][liberapay_donate] [🌏][aboutme] [👼][angelme] [💻][coderme] [🌹][politicme] [![Tweet @ Peter][followme-img]][tweetme] |
29
+ <!--
30
+ Numbering rows and badges in each row as a visual "database" lookup,
31
+ as the table is extremely dense, and it can be very difficult to find anything
32
+ Putting one on each row here, to document the emoji that should be used, and for ease of copy/paste.
33
+
34
+ row #s:
35
+ 1️⃣
36
+ 2️⃣
37
+ 3️⃣
38
+ 4️⃣
39
+ 5️⃣
40
+ 6️⃣
41
+ 7️⃣
42
+
43
+ badge #s:
44
+ ⛳️
45
+ 🖇
46
+ 🏘
47
+ 🚎
48
+ 🖐
49
+ 🧮
50
+ 📗
51
+
52
+ appended indicators:
53
+ ♻️ - URL needs to be updated from SASS integration. Find / Replace is insufficient.
54
+ -->
55
+
56
+ | | Project | bundle add oauth2 |
57
+ |:----|-----------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
58
+ | 1️⃣ | name, license, docs | [![RubyGems.org][⛳️name-img]][⛳️gem] [![License: MIT][🖇src-license-img]][🖇src-license] [![FOSSA][🏘fossa-img]][🏘fossa] [![RubyDoc.info][🚎yard-img]][🚎yard] [![InchCI][🖐inch-ci-img]][🚎yard] |
59
+ | 2️⃣ | version & activity | [![Gem Version][⛳️version-img]][⛳️gem] [![Total Downloads][🖇DL-total-img]][⛳️gem] [![Download Rank][🏘DL-rank-img]][⛳️gem] [![Source Code][🚎src-home-img]][🚎src-home] [![Open PRs][🖐prs-o-img]][🖐prs-o] [![Closed PRs][🧮prs-c-img]][🧮prs-c] <!--[![Next Version][📗next-img]][📗next]--> |
60
+ | 3️⃣ | maintanence & linting | [![Maintainability][⛳cclim-maint-img♻️]][⛳cclim-maint] [![Helpers][🖇triage-help-img]][🖇triage-help] [![Depfu][🏘depfu-img♻️]][🏘depfu♻️] [![Contributors][🚎contributors-img]][🚎contributors] [![Style][🖐style-wf-img]][🖐style-wf] [![Kloc Roll][🧮kloc-img]][🧮kloc] |
61
+ | 4️⃣ | testing | [![Open Issues][⛳iss-o-img]][⛳iss-o] [![Closed Issues][🖇iss-c-img]][🖇iss-c] [![Supported][🏘sup-wf-img]][🏘sup-wf] [![Heads][🚎heads-wf-img]][🚎heads-wf] [![Unofficial Support][🖐uns-wf-img]][🖐uns-wf] [![MacOS][🧮mac-wf-img]][🧮mac-wf] [![Windows][📗win-wf-img]][📗win-wf] |
62
+ | 5️⃣ | coverage & security | [![CodeClimate][⛳cclim-cov-img♻️]][⛳cclim-cov] [![CodeCov][🖇codecov-img♻️]][🖇codecov] [![Coveralls][🏘coveralls-img]][🏘coveralls] [![Security Policy][🚎sec-pol-img]][🚎sec-pol] [![CodeQL][🖐codeQL-img]][🖐codeQL] [![Code Coverage][🧮cov-wf-img]][🧮cov-wf] |
63
+ | 6️⃣ | resources | [![Discussion][⛳gh-discussions-img]][⛳gh-discussions] [![Get help on Codementor][🖇codementor-img]][🖇codementor] [![Chat][🏘chat-img]][🏘chat] [![Blog][🚎blog-img]][🚎blog] [![Blog][🖐wiki-img]][🖐wiki] |
64
+ | 7️⃣ | spread 💖 | [![Liberapay Patrons][⛳liberapay-img]][⛳liberapay] [![Sponsor Me][🖇sponsor-img]][🖇sponsor] [![Tweet @ Peter][🏘tweet-img]][🏘tweet] [🌏][aboutme] [👼][angelme] [💻][coderme] [🌹][politicme] |
65
+
66
+ <!--
67
+ The link tokens in the following sections should be kept ordered by the row and badge numbering scheme
68
+ -->
69
+
70
+ <!-- 1️⃣ name, license, docs -->
71
+ [⛳️gem]: https://rubygems.org/gems/oauth
72
+ [⛳️name-img]: https://img.shields.io/badge/name-oauth-brightgreen.svg?style=flat
73
+ [🖇src-license]: https://opensource.org/licenses/MIT
74
+ [🖇src-license-img]: https://img.shields.io/badge/License-MIT-green.svg
75
+ [🏘fossa]: https://app.fossa.io/projects/git%2Bgithub.com%2Foauth-xx%2Foauth-ruby?ref=badge_shield
76
+ [🏘fossa-img]: https://app.fossa.io/api/projects/git%2Bgithub.com%2Foauth-xx%2Foauth-ruby.svg?type=shield
77
+ [🚎yard]: https://www.rubydoc.info/github/oauth-xx/oauth-ruby
78
+ [🚎yard-img]: https://img.shields.io/badge/documentation-rubydoc-brightgreen.svg?style=flat
79
+ [🖐inch-ci-img]: http://inch-ci.org/github/oauth-xx/oauth-ruby.png
80
+
81
+ <!-- 2️⃣ version & activity -->
82
+ [⛳️version-img]: http://img.shields.io/gem/v/oauth.svg
83
+ [🖇DL-total-img]: https://img.shields.io/gem/dt/oauth.svg
84
+ [🏘DL-rank-img]: https://img.shields.io/gem/rt/oauth.svg
85
+ [🚎src-home]: https://github.com/oauth-xx/oauth-ruby
86
+ [🚎src-home-img]: https://img.shields.io/badge/source-github-brightgreen.svg?style=flat
87
+ [🖐prs-o]: https://github.com/oauth-xx/oauth-ruby/pulls
88
+ [🖐prs-o-img]: https://img.shields.io/github/issues-pr/oauth-xx/oauth-ruby
89
+ [🧮prs-c]: https://github.com/oauth-xx/oauth-ruby/pulls?q=is%3Apr+is%3Aclosed
90
+ [🧮prs-c-img]: https://img.shields.io/github/issues-pr-closed/oauth-xx/oauth-ruby
91
+ [📗next]: https://github.com/oauth-xx/oauth-ruby/milestone/1
92
+ [📗next-img]: https://img.shields.io/github/milestones/progress/oauth-xx/oauth-ruby/1?label=Next%20Version
93
+
94
+ <!-- 3️⃣ maintanence & linting -->
95
+ [⛳cclim-maint]: https://codeclimate.com/github/oauth-xx/oauth-ruby/maintainability
96
+ [⛳cclim-maint-img♻️]: https://api.codeclimate.com/v1/badges/3cf23270c21e8791d788/maintainability
97
+ [🖇triage-help]: https://www.codetriage.com/oauth-xx/oauth-ruby
98
+ [🖇triage-help-img]: https://www.codetriage.com/oauth-xx/oauth-ruby/badges/users.svg
99
+ [🏘depfu♻️]: https://depfu.com/github/oauth-xx/oauth-ruby?project_id=22868
100
+ [🏘depfu-img♻️]: https://badges.depfu.com/badges/d570491bac0ad3b0b65deb3c82028327/count.svg
101
+ [🚎contributors]: https://github.com/oauth-xx/oauth-ruby/graphs/contributors
102
+ [🚎contributors-img]: https://img.shields.io/github/contributors-anon/oauth-xx/oauth-ruby
103
+ [🖐style-wf]: https://github.com/oauth-xx/oauth-ruby/actions/workflows/style.yml
104
+ [🖐style-wf-img]: https://github.com/oauth-xx/oauth-ruby/actions/workflows/style.yml/badge.svg
105
+ [🧮kloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
106
+ [🧮kloc-img]: https://img.shields.io/tokei/lines/github.com/oauth-xx/oauth-ruby
107
+
108
+ <!-- 4️⃣ testing -->
109
+ [⛳iss-o]: https://github.com/oauth-xx/oauth-ruby/issues
110
+ [⛳iss-o-img]: https://img.shields.io/github/issues-raw/oauth-xx/oauth-ruby
111
+ [🖇iss-c]: https://github.com/oauth-xx/oauth-ruby/issues?q=is%3Aissue+is%3Aclosed
112
+ [🖇iss-c-img]: https://img.shields.io/github/issues-closed-raw/oauth-xx/oauth-ruby
113
+ [🏘sup-wf]: https://github.com/oauth-xx/oauth-ruby/actions/workflows/supported.yml
114
+ [🏘sup-wf-img]: https://github.com/oauth-xx/oauth-ruby/actions/workflows/supported.yml/badge.svg
115
+ [🚎heads-wf]: https://github.com/oauth-xx/oauth-ruby/actions/workflows/heads.yml
116
+ [🚎heads-wf-img]: https://github.com/oauth-xx/oauth-ruby/actions/workflows/heads.yml/badge.svg
117
+ [🖐uns-wf]: https://github.com/oauth-xx/oauth-ruby/actions/workflows/unsupported.yml
118
+ [🖐uns-wf-img]: https://github.com/oauth-xx/oauth-ruby/actions/workflows/unsupported.yml/badge.svg
119
+ [🧮mac-wf]: https://github.com/oauth-xx/oauth-ruby/actions/workflows/macos.yml
120
+ [🧮mac-wf-img]: https://github.com/oauth-xx/oauth-ruby/actions/workflows/macos.yml/badge.svg
121
+ [📗win-wf]: https://github.com/oauth-xx/oauth-ruby/actions/workflows/windows.yml
122
+ [📗win-wf-img]: https://github.com/oauth-xx/oauth-ruby/actions/workflows/windows.yml/badge.svg
123
+
124
+ <!-- 5️⃣ coverage & security -->
125
+ [⛳cclim-cov]: https://codeclimate.com/github/oauth-xx/oauth-ruby/test_coverage
126
+ [⛳cclim-cov-img♻️]: https://api.codeclimate.com/v1/badges/3cf23270c21e8791d788/test_coverage
127
+ [🖇codecov-img♻️]: https://codecov.io/gh/oauth-xx/oauth-ruby/branch/v0.5-maintenance/graph/badge.svg?token=4ZNAWNxrf9
128
+ [🖇codecov]: https://codecov.io/gh/oauth-xx/oauth-ruby
129
+ [🏘coveralls]: https://coveralls.io/github/oauth-xx/oauth-ruby?branch=v0.5-maintenance
130
+ [🏘coveralls-img]: https://coveralls.io/repos/github/oauth-xx/oauth-ruby/badge.svg?branch=v0.5-maintenance
131
+ [🚎sec-pol]: https://github.com/oauth-xx/oauth-ruby/blob/master/SECURITY.md
132
+ [🚎sec-pol-img]: https://img.shields.io/badge/security-policy-brightgreen.svg?style=flat
133
+ [🖐codeQL]: https://github.com/oauth-xx/oauth-ruby/security/code-scanning
134
+ [🖐codeQL-img]: https://github.com/oauth-xx/oauth-ruby/actions/workflows/codeql-analysis.yml/badge.svg
135
+ [🧮cov-wf]: https://github.com/oauth-xx/oauth-ruby/actions/workflows/coverage.yml
136
+ [🧮cov-wf-img]: https://github.com/oauth-xx/oauth-ruby/actions/workflows/coverage.yml/badge.svg
137
+
138
+ <!-- 6️⃣ resources -->
139
+ [⛳gh-discussions]: https://github.com/oauth-xx/oauth-ruby/discussions
140
+ [⛳gh-discussions-img]: https://img.shields.io/github/discussions/oauth-xx/oauth-ruby
141
+ [🖇codementor]: https://www.codementor.io/peterboling?utm_source=github&utm_medium=button&utm_term=peterboling&utm_campaign=github
142
+ [🖇codementor-img]: https://cdn.codementor.io/badges/get_help_github.svg
143
+ [🏘chat]: https://gitter.im/oauth-xx/oauth-ruby
144
+ [🏘chat-img]: https://img.shields.io/gitter/room/oauth-xx/oauth-ruby.svg
145
+ [🚎blog]: http://www.railsbling.com/tags/oauth-ruby/
146
+ [🚎blog-img]: https://img.shields.io/badge/blog-railsbling-brightgreen.svg?style=flat
147
+ [🖐wiki]: https://github.com/oauth-xx/oauth-ruby/wiki
148
+ [🖐wiki-img]: https://img.shields.io/badge/wiki-examples-brightgreen.svg?style=flat
149
+
150
+ <!-- 7️⃣ spread 💖 -->
151
+ [⛳liberapay-img]: https://img.shields.io/liberapay/patrons/pboling.svg?logo=liberapay
152
+ [⛳liberapay]: https://liberapay.com/pboling/donate
153
+ [🖇sponsor-img]: https://img.shields.io/badge/sponsor-pboling.svg?style=social&logo=github
154
+ [🖇sponsor]: https://github.com/sponsors/pboling
155
+ [🏘tweet-img]: https://img.shields.io/twitter/follow/galtzo.svg?style=social&label=Follow
156
+ [🏘tweet]: http://twitter.com/galtzo
157
+
158
+ <!-- Maintainer Contact Links -->
159
+ [railsbling]: http://www.railsbling.com
160
+ [peterboling]: http://www.peterboling.com
161
+ [aboutme]: https://about.me/peter.boling
162
+ [angelme]: https://angel.co/peter-boling
163
+ [coderme]:http://coderwall.com/pboling
164
+ [politicme]: https://nationalprogressiveparty.org
165
+
18
166
 
19
- ## What
167
+ ## Installation
20
168
 
21
- This is a RubyGem for implementing both OAuth 1.0 clients and servers in Ruby
22
- applications.
169
+ Install the gem and add to the application's Gemfile by executing:
23
170
 
24
- See the OAuth 1.0 spec http://oauth.net/core/1.0/
171
+ $ bundle add oauth
25
172
 
26
- See the sibling gem [oauth2](https://github.com/oauth-xx/oauth2) for OAuth 2.0 implementations in Ruby.
173
+ If bundler is not being used to manage dependencies, install the gem by executing:
27
174
 
28
- ## Installation
175
+ $ gem install oauth
29
176
 
30
- Add this line to your application's Gemfile:
177
+ ## OAuth for Enterprise
31
178
 
32
- ```ruby
33
- gem "oauth"
34
- ```
179
+ Available as part of the Tidelift Subscription.
35
180
 
36
- And then execute:
181
+ The maintainers of OAuth2 and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source packages you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact packages you use. [Learn more.](https://tidelift.com/subscription/pkg/rubygems-oauth?utm_source=rubygems-oauth&utm_medium=referral&utm_campaign=enterprise)
37
182
 
38
- $ bundle install
183
+ ## Security contact information [![Security Policy][🚎sec-pol-img]][🚎sec-pol]
39
184
 
40
- Or install it yourself as:
185
+ To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security).
186
+ Tidelift will coordinate the fix and disclosure.
41
187
 
42
- $ gem install oauth
188
+ For more see [SECURITY.md][🚎sec-pol].
43
189
 
44
190
  ## Compatibility
45
191
 
46
- Targeted ruby compatibility is non-EOL versions of Ruby, currently 2.6, 2.7, and
47
- 3.0. Ruby is limited to 2.0+ in the gemspec, and this may change while the gem is
48
- still at version 0.x. The `master` branch currently targets 0.6.x releases.
192
+ Targeted ruby compatibility is non-EOL versions of Ruby, currently 2.7, 3.0, and
193
+ 3.1. Ruby is limited to 2.0+ in the gemspec on this `v0.5-maintenance` branch, and
194
+ this will change with minor version bumps, while the gem is still in 0.x,
195
+ in accordance with the SemVer spec.
196
+
197
+ The `master` branch now targets 0.6.x releases.
198
+ See `v0.5-maintenance` branch for older rubies.
199
+
200
+ NOTE: If there is another 0.5.x release it is anticipated to be the last of the 0.5.x series.
201
+
202
+ <details>
203
+ <summary>Ruby Engine Compatibility Policy</summary>
204
+
205
+ This gem is tested against MRI, JRuby, and Truffleruby.
206
+ Each of those has varying versions that target a specific version of MRI Ruby.
207
+ This gem should work in the just-listed Ruby engines according to the targeted MRI compatibility in the table below.
208
+ If you would like to add support for additional engines,
209
+ first make sure Github Actions supports the engine,
210
+ then submit a PR to the correct maintenance branch as according to the table below.
211
+ </details>
49
212
 
50
- | Ruby OAuth Version | Maintenance Branch | Officially Supported Rubies | Unofficially Supported Rubies |
51
- |--------------------- | ------------------ | ------------------------------------------- | ----------------------------- |
52
- | 0.7.x (hypothetical) | N/A | 2.7, 3.0, 3.1 | 2.6 |
53
- | 0.6.x | `master` | 2.6, 2.7, 3.0 | 2.3, 2.4, 2.5 |
54
- | 0.5.x | `v0.5-maintenance` | 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 3.0 | |
213
+ <details>
214
+ <summary>Ruby Version Compatibility Policy</summary>
55
215
 
56
- NOTE: 0.5.7 is anticipated as last release of the 0.5.x series.
216
+ If something doesn't work on one of these interpreters, it's a bug.
217
+
218
+ This library may inadvertently work (or seem to work) on other Ruby
219
+ implementations, however support will only be provided for the versions listed
220
+ above.
221
+
222
+ If you would like this library to support another Ruby version, you may
223
+ volunteer to be a maintainer. Being a maintainer entails making sure all tests
224
+ run and pass on that implementation. When something breaks on your
225
+ implementation, you will be responsible for providing patches in a timely
226
+ fashion. If critical issues for a particular implementation exist at the time
227
+ of a major release, support for that Ruby version may be dropped.
228
+ </details>
229
+
230
+ | | Ruby OAuth Version | Maintenance Branch | Supported Officially | Supported Unofficially | Supported Incidentally |
231
+ |:----|--------------------|--------------------|----------------------|------------------------------|------------------------|
232
+ | 1️⃣ | 0.6.x (unreleased) | `master` | 2.7, 3.0, 3.1 | 2.5, 2.6 | 2.4 |
233
+ | 2️⃣ | 0.5.x | `v0.5-maintenance` | 2.7, 3.0, 3.1 | 2.1, 2.2, 2.3, 2.4, 2.5, 2.6 | 2.0 |
234
+ | 3️⃣ | older | N/A | Best of luck to you! | Please upgrade! | |
235
+
236
+ NOTE: Once 1.0 is released, the 0.x series will only receive critical bug and security updates.
237
+ See [SECURITY.md][🚎sec-pol]
57
238
 
58
239
  ## Basics
59
240
 
@@ -117,34 +298,29 @@ OAuth provider if you choose.
117
298
 
118
299
  ## Contributing
119
300
 
120
- Bug reports and pull requests are welcome on GitHub at [https://github.com/oauth-xx/oauth-ruby][source]. This project is
121
- intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to
122
- the [code of conduct][conduct].
123
-
124
- To submit a patch, please fork the oauth project and create a patch with
125
- tests. Once you're happy with it send a pull request and post a message to the
126
- [google group][mailinglist].
301
+ See [CONTRIBUTING.md][contributing]
127
302
 
128
303
  ## Contributors
129
304
 
130
- [![Contributors](https://contrib.rocks/image?repo=oauth-xx/oauth-ruby)]("https://github.com/oauth-xx/oauth-ruby/graphs/contributors")
305
+ [![Contributors](https://contrib.rocks/image?repo=oauth-xx/oauth-ruby)][contributors]
131
306
 
132
- Made with [contributors-img](https://contrib.rocks).
307
+ Made with [contributors-img][contrib-rocks].
133
308
 
134
309
  ## Versioning
135
310
 
136
311
  This library aims to adhere to [Semantic Versioning 2.0.0][semver]. Violations of this scheme should be reported as
137
312
  bugs. Specifically, if a minor or patch version is released that breaks backward compatibility, a new version should be
138
313
  immediately released that restores compatibility. Breaking changes to the public API will only be introduced with new
139
- major versions.
314
+ major versions. Compatibility with a major and minor versions of Ruby will only be changed with a major version bump.
140
315
 
141
316
  As a result of this policy, you can (and should) specify a dependency on this gem using
142
- the [Pessimistic Version Constraint][pvc] with two digits of precision.
317
+ the [Pessimistic Version Constraint][pvc] with two digits of precision once it hits a 1.0 release.
318
+ While on 0.x releases three digits of precision should be used.
143
319
 
144
320
  For example:
145
321
 
146
322
  ```ruby
147
- spec.add_dependency "oauth", "~> 0.5"
323
+ spec.add_dependency "oauth", "~> 0.5.9"
148
324
  ```
149
325
 
150
326
  ## License
@@ -160,64 +336,37 @@ individuals. The current maintainer is Peter Boling ([@pboling][gh_sponsors]).
160
336
 
161
337
  Comments are welcome. Contact the [OAuth Ruby mailing list (Google Group)][mailinglist] or [GitHub Discussions][gh_discussions].
162
338
 
163
- [copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
164
-
165
- [gh_discussions]: https://github.com/oauth-xx/oauth-ruby/discussions
166
-
167
- [mailinglist]: http://groups.google.com/group/oauth-ruby
339
+ [comment]: <> (Following links are used by README, CONTRIBUTING, Homepage)
168
340
 
169
341
  [conduct]: https://github.com/oauth-xx/oauth-ruby/blob/master/CODE_OF_CONDUCT.md
342
+ [contributing]: https://github.com/oauth-xx/oauth-ruby/blob/master/CONTRIBUTING.md
343
+ [contributors]: https://github.com/oauth-xx/oauth-ruby/graphs/contributors
344
+ [mailinglist]: http://groups.google.com/group/oauth-ruby
345
+ [source]: https://github.com/oauth-xx/oauth-ruby/
170
346
 
171
- [license]: LICENSE
172
-
173
- [license-ref]: https://opensource.org/licenses/MIT
174
-
175
- [semver]: http://semver.org/
176
-
177
- [pvc]: http://guides.rubygems.org/patterns/#pessimistic-version-constraint
178
-
179
- [railsbling]: http://www.railsbling.com
180
-
181
- [peterboling]: http://www.peterboling.com
347
+ [comment]: <> (Following links are used by README, Homepage)
182
348
 
183
349
  [aboutme]: https://about.me/peter.boling
184
-
185
- [angelme]: https://angel.co/peter-boling
186
-
187
- [coderme]:http://coderwall.com/pboling
188
-
189
- [followme-img]: https://img.shields.io/twitter/follow/galtzo.svg?style=social&label=Follow
190
-
191
- [tweetme]: http://twitter.com/galtzo
192
-
193
- [politicme]: https://nationalprogressiveparty.org
194
-
195
- [documentation]: https://rubydoc.info/github/oauth-xx/oauth-ruby/main
196
-
197
- [source]: https://github.com/oauth-xx/oauth-ruby/
198
-
199
350
  [actions]: https://github.com/oauth-xx/oauth-ruby/actions
200
-
201
- [issues]: https://github.com/oauth-xx/oauth-ruby/issues
202
-
203
- [climate_maintainability]: https://codeclimate.com/github/oauth-xx/oauth-ruby/maintainability
204
-
351
+ [angelme]: https://angel.co/peter-boling
352
+ [blogpage]: http://www.railsbling.com/tags/oauth/
353
+ [chat]: https://gitter.im/oauth-xx/oauth-ruby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
205
354
  [climate_coverage]: https://codeclimate.com/github/oauth-xx/oauth-ruby/test_coverage
206
-
207
- [codecov_coverage]: https://codecov.io/gh/oauth-xx/oauth-ruby
208
-
355
+ [climate_maintainability]: https://codeclimate.com/github/oauth-xx/oauth-ruby/maintainability
209
356
  [code_triage]: https://www.codetriage.com/oauth-xx/oauth-ruby
210
-
357
+ [codecov_coverage]: https://codecov.io/gh/oauth-xx/oauth-ruby
358
+ [coderme]:http://coderwall.com/pboling
211
359
  [depfu]: https://depfu.com/github/oauth-xx/oauth-ruby?project_id=22868
212
-
213
- [blogpage]: http://www.railsbling.com/tags/oauth/
214
-
215
- [rubygems]: https://rubygems.org/gems/oauth
216
-
217
- [chat]: https://gitter.im/oauth-xx/oauth-ruby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
218
-
219
- [maintenancee_policy]: https://guides.rubyonrails.org/maintenance_policy.html#security-issues
220
-
360
+ [documentation]: https://rubydoc.info/github/oauth-xx/oauth-ruby
361
+ [followme-img]: https://img.shields.io/twitter/follow/galtzo.svg?style=social&label=Follow
362
+ [gh_discussions]: https://github.com/oauth-xx/oauth-ruby/discussions
363
+ [gh_sponsors]: https://github.com/sponsors/pboling
364
+ [license]: https://github.com/oauth-xx/oauth-ruby/blob/master/LICENSE
365
+ [license-ref]: https://opensource.org/licenses/MIT
221
366
  [liberapay_donate]: https://liberapay.com/pboling/donate
222
-
223
- [gh_sponsors]: https://github.com/sponsors/pboling
367
+ [politicme]: https://nationalprogressiveparty.org
368
+ [pvc]: http://guides.rubygems.org/patterns/#pessimistic-version-constraint
369
+ [rubygems]: https://rubygems.org/gems/oauth
370
+ [security]: https://github.com/oauth-xx/oauth-ruby/blob/master/SECURITY.md
371
+ [semver]: http://semver.org/
372
+ [tweetme]: http://twitter.com/galtzo
data/SECURITY.md ADDED
@@ -0,0 +1,16 @@
1
+ # Security Policy
2
+
3
+ ## Supported Versions
4
+
5
+ | Version | Supported |
6
+ | ------- | ------------------ |
7
+ | 0.7.x | :white_check_mark: |
8
+ | 0.6.x | :white_check_mark: |
9
+ | 0.5.x | :white_check_mark: |
10
+ | <= 0.5 | :x: |
11
+
12
+ ## Reporting a Vulnerability
13
+
14
+ Peter Boling is the primary maintainer of the this gem. Please find a way to [contact him directly][contact] to report the issue. Include as much relevant information as possible.
15
+
16
+ [contact]: https://railsbling.com/contact
data/TODO CHANGED
File without changes
@@ -1,6 +1,5 @@
1
1
  class OAuth::CLI
2
2
  class AuthorizeCommand < BaseCommand
3
-
4
3
  def required_options
5
4
  [:uri]
6
5
  end
@@ -25,7 +24,7 @@ class OAuth::CLI
25
24
  def get_request_token
26
25
  consumer = get_consumer
27
26
  scope_options = options[:scope] ? { "scope" => options[:scope] } : {}
28
- consumer.get_request_token({ :oauth_callback => options[:oauth_callback] }, scope_options)
27
+ consumer.get_request_token({ oauth_callback: options[:oauth_callback] }, scope_options)
29
28
  rescue OAuth::Unauthorized => e
30
29
  alert "A problem occurred while attempting to authorize:"
31
30
  alert e
@@ -36,14 +35,13 @@ class OAuth::CLI
36
35
  OAuth::Consumer.new \
37
36
  options[:oauth_consumer_key],
38
37
  options[:oauth_consumer_secret],
39
- :access_token_url => options[:access_token_url],
40
- :authorize_url => options[:authorize_url],
41
- :request_token_url => options[:request_token_url],
42
- :scheme => options[:scheme],
43
- :http_method => options[:method].to_s.downcase.to_sym
38
+ access_token_url: options[:access_token_url],
39
+ authorize_url: options[:authorize_url],
40
+ request_token_url: options[:request_token_url],
41
+ scheme: options[:scheme],
42
+ http_method: options[:method].to_s.downcase.to_sym
44
43
  end
45
44
 
46
-
47
45
  def ask_user_for_verifier
48
46
  if options[:version] == "1.0a"
49
47
  puts "Please enter the verification code provided by the SP (oauth_verifier):"
@@ -56,10 +54,10 @@ class OAuth::CLI
56
54
  end
57
55
 
58
56
  def verbosely_get_access_token(request_token, oauth_verifier)
59
- access_token = request_token.get_access_token(:oauth_verifier => oauth_verifier)
57
+ access_token = request_token.get_access_token(oauth_verifier: oauth_verifier)
60
58
 
61
59
  puts "Response:"
62
- access_token.params.each do |k,v|
60
+ access_token.params.each do |k, v|
63
61
  puts " #{k}: #{v}" unless k.is_a?(Symbol)
64
62
  end
65
63
  rescue OAuth::Unauthorized => e
@@ -1,7 +1,9 @@
1
1
  class OAuth::CLI
2
2
  class BaseCommand
3
3
  def initialize(stdout, stdin, stderr, arguments)
4
- @stdout, @stdin, @stderr = stdout, stdin, stderr
4
+ @stdout = stdout
5
+ @stdin = stdin
6
+ @stderr = stderr
5
7
 
6
8
  @options = {}
7
9
  option_parser.parse!(arguments)
@@ -38,11 +40,11 @@ class OAuth::CLI
38
40
  options[:verbose]
39
41
  end
40
42
 
41
- def puts(string=nil)
43
+ def puts(string = nil)
42
44
  @stdout.puts(string)
43
45
  end
44
46
 
45
- def alert(string=nil)
47
+ def alert(string = nil)
46
48
  @stderr.puts(string)
47
49
  end
48
50
 
@@ -50,8 +52,8 @@ class OAuth::CLI
50
52
  @parameters ||= begin
51
53
  escaped_pairs = options[:params].collect do |pair|
52
54
  if pair =~ /:/
53
- Hash[*pair.split(":", 2)].collect do |k,v|
54
- [CGI.escape(k.strip), CGI.escape(v.strip)] * "="
55
+ Hash[*pair.split(":", 2)].collect do |k, v|
56
+ [CGI.escape(k.strip), CGI.escape(v.strip)].join("=")
55
57
  end
56
58
  else
57
59
  pair
@@ -68,7 +70,7 @@ class OAuth::CLI
68
70
  "oauth_token" => options[:oauth_token],
69
71
  "oauth_signature_method" => options[:oauth_signature_method],
70
72
  "oauth_version" => options[:oauth_version]
71
- }.reject { |_k,v| v.nil? || v == "" }.merge(cli_params)
73
+ }.reject { |_k, v| v.nil? || v == "" }.merge(cli_params)
72
74
  end
73
75
  end
74
76
 
File without changes
@@ -3,7 +3,7 @@ class OAuth::CLI
3
3
  extend OAuth::Helper
4
4
 
5
5
  def required_options
6
- [:oauth_consumer_key, :oauth_consumer_secret, :oauth_token, :oauth_token_secret]
6
+ %i[oauth_consumer_key oauth_consumer_secret oauth_token oauth_token_secret]
7
7
  end
8
8
 
9
9
  def _run
@@ -13,8 +13,8 @@ class OAuth::CLI
13
13
 
14
14
  # append params to the URL
15
15
  uri = URI.parse(options[:uri])
16
- params = parameters.map { |k,v| Array(v).map { |v2| "#{OAuth::Helper.escape(k)}=#{OAuth::Helper.escape(v2)}" } * "&" }
17
- uri.query = [uri.query, *params].reject { |x| x.nil? } * "&"
16
+ params = parameters.map { |k, v| Array(v).map { |v2| "#{OAuth::Helper.escape(k)}=#{OAuth::Helper.escape(v2)}" } * "&" }
17
+ uri.query = [uri.query, *params].reject(&:nil?) * "&"
18
18
  puts uri.to_s
19
19
 
20
20
  response = access_token.request(options[:method].to_s.downcase.to_sym, uri.to_s)
@@ -1,23 +1,20 @@
1
1
  class OAuth::CLI
2
2
  class SignCommand < BaseCommand
3
-
4
3
  def required_options
5
- [:oauth_consumer_key, :oauth_consumer_secret, :oauth_token, :oauth_token_secret]
4
+ %i[oauth_consumer_key oauth_consumer_secret oauth_token oauth_token_secret]
6
5
  end
7
6
 
8
7
  def _run
9
8
  request = OAuth::RequestProxy.proxy \
10
- "method" => options[:method],
11
- "uri" => options[:uri],
12
- "parameters" => parameters
9
+ "method" => options[:method],
10
+ "uri" => options[:uri],
11
+ "parameters" => parameters
13
12
 
14
- if verbose?
15
- puts_verbose_parameters(request)
16
- end
13
+ puts_verbose_parameters(request) if verbose?
17
14
 
18
15
  request.sign! \
19
- :consumer_secret => options[:oauth_consumer_secret],
20
- :token_secret => options[:oauth_token_secret]
16
+ consumer_secret: options[:oauth_consumer_secret],
17
+ token_secret: options[:oauth_token_secret]
21
18
 
22
19
  if verbose?
23
20
  puts_verbose_request(request)
@@ -28,15 +25,15 @@ class OAuth::CLI
28
25
 
29
26
  def puts_verbose_parameters(request)
30
27
  puts "OAuth parameters:"
31
- request.oauth_parameters.each do |k,v|
32
- puts " " + [k, v] * ": "
28
+ request.oauth_parameters.each do |k, v|
29
+ puts " " + [k, v].join(": ")
33
30
  end
34
31
  puts
35
32
 
36
33
  if request.non_oauth_parameters.any?
37
34
  puts "Parameters:"
38
- request.non_oauth_parameters.each do |k,v|
39
- puts " " + [k, v] * ": "
35
+ request.non_oauth_parameters.each do |k, v|
36
+ puts " " + [k, v].join(": ")
40
37
  end
41
38
  puts
42
39
  end
@@ -58,7 +55,7 @@ class OAuth::CLI
58
55
  else
59
56
  puts "OAuth Request URI: #{request.signed_uri}"
60
57
  puts "Request URI: #{request.signed_uri(false)}"
61
- puts "Authorization header: #{request.oauth_header(:realm => options[:realm])}"
58
+ puts "Authorization header: #{request.oauth_header(realm: options[:realm])}"
62
59
  end
63
60
  puts "Signature: #{request.oauth_signature}"
64
61
  puts "Escaped signature: #{OAuth::Helper.escape(request.oauth_signature)}"
File without changes
data/lib/oauth/cli.rb CHANGED
@@ -18,8 +18,8 @@ module OAuth
18
18
  "v" => "version",
19
19
  "q" => "query",
20
20
  "a" => "authorize",
21
- "s" => "sign",
22
- }
21
+ "s" => "sign"
22
+ }.freeze
23
23
 
24
24
  def initialize(stdout, stdin, stderr, command, arguments)
25
25
  klass = get_command_class(parse_command(command))