oauth 1.1.2 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +263 -225
- data/CITATION.cff +0 -0
- data/CODE_OF_CONDUCT.md +0 -0
- data/CONTRIBUTING.md +12 -23
- data/FUNDING.md +2 -2
- data/LICENSE.txt +0 -0
- data/README.md +27 -23
- data/REEK +2 -0
- data/RUBOCOP.md +0 -0
- data/SECURITY.md +5 -23
- data/lib/oauth/client/action_controller_request.rb +8 -4
- data/lib/oauth/client/em_http.rb +0 -0
- data/lib/oauth/client/helper.rb +0 -0
- data/lib/oauth/client/net_http.rb +0 -0
- data/lib/oauth/client.rb +0 -0
- data/lib/oauth/consumer.rb +22 -6
- data/lib/oauth/errors/error.rb +0 -0
- data/lib/oauth/errors/problem.rb +0 -0
- data/lib/oauth/errors/unauthorized.rb +0 -0
- data/lib/oauth/errors.rb +0 -0
- data/lib/oauth/helper.rb +0 -0
- data/lib/oauth/oauth.rb +0 -0
- data/lib/oauth/oauth_test_helper.rb +0 -0
- data/lib/oauth/optional.rb +0 -0
- data/lib/oauth/request_proxy/action_controller_request.rb +0 -0
- data/lib/oauth/request_proxy/action_dispatch_request.rb +0 -7
- data/lib/oauth/request_proxy/base.rb +23 -15
- data/lib/oauth/request_proxy/curb_request.rb +0 -0
- data/lib/oauth/request_proxy/em_http_request.rb +0 -0
- data/lib/oauth/request_proxy/jabber_request.rb +0 -0
- data/lib/oauth/request_proxy/mock_request.rb +0 -0
- data/lib/oauth/request_proxy/net_http.rb +0 -0
- data/lib/oauth/request_proxy/rack_request.rb +0 -4
- data/lib/oauth/request_proxy/rest_client_request.rb +0 -0
- data/lib/oauth/request_proxy/typhoeus_request.rb +0 -0
- data/lib/oauth/request_proxy.rb +17 -13
- data/lib/oauth/server.rb +0 -0
- data/lib/oauth/signature/base.rb +14 -4
- data/lib/oauth/signature/hmac/sha1.rb +0 -0
- data/lib/oauth/signature/hmac/sha256.rb +0 -0
- data/lib/oauth/signature/plaintext.rb +0 -0
- data/lib/oauth/signature/rsa/sha1.rb +0 -0
- data/lib/oauth/signature.rb +43 -39
- data/lib/oauth/token.rb +0 -0
- data/lib/oauth/tokens/access_token.rb +0 -0
- data/lib/oauth/tokens/consumer_token.rb +6 -4
- data/lib/oauth/tokens/request_token.rb +0 -0
- data/lib/oauth/tokens/server_token.rb +0 -0
- data/lib/oauth/tokens/token.rb +13 -1
- data/lib/oauth/version.rb +2 -1
- data/lib/oauth.rb +1 -0
- data/sig/oauth/consumer.rbs +9 -0
- data/sig/oauth/signature/base.rbs +12 -0
- data/sig/oauth/tokens/token.rbs +8 -0
- data.tar.gz.sig +0 -0
- metadata +72 -32
- metadata.gz.sig +0 -0
data/CITATION.cff
CHANGED
|
File without changes
|
data/CODE_OF_CONDUCT.md
CHANGED
|
File without changes
|
data/CONTRIBUTING.md
CHANGED
|
@@ -24,9 +24,10 @@ Follow these instructions:
|
|
|
24
24
|
|
|
25
25
|
## Executables vs Rake tasks
|
|
26
26
|
|
|
27
|
-
Executables shipped by
|
|
28
|
-
|
|
27
|
+
Executables shipped by dependencies, such as oauth, and stone_checksums, are available
|
|
28
|
+
after running `bin/setup`. These include:
|
|
29
29
|
|
|
30
|
+
- gem_checksums
|
|
30
31
|
- kettle-changelog
|
|
31
32
|
- kettle-commit-msg
|
|
32
33
|
- oauth-setup
|
|
@@ -35,20 +36,10 @@ They will work when oauth is installed globally (i.e., `gem install oauth`) and
|
|
|
35
36
|
- kettle-readme-backers
|
|
36
37
|
- kettle-release
|
|
37
38
|
|
|
38
|
-
|
|
39
|
-
See the full list of rake tasks in head of Rakefile
|
|
39
|
+
There are many Rake tasks available as well. You can see them by running:
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
group :development do
|
|
44
|
-
gem "oauth", require: false
|
|
45
|
-
end
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
**Rakefile**
|
|
49
|
-
```ruby
|
|
50
|
-
# Rakefile
|
|
51
|
-
require "oauth"
|
|
41
|
+
```shell
|
|
42
|
+
bin/rake -T
|
|
52
43
|
```
|
|
53
44
|
|
|
54
45
|
## Environment Variables for Local Development
|
|
@@ -118,10 +109,8 @@ bundle exec rake test
|
|
|
118
109
|
|
|
119
110
|
### Spec organization (required)
|
|
120
111
|
|
|
121
|
-
- One spec file per class/module. For each class or module under `lib/`, keep all of its unit tests in a single spec file under `spec/` that mirrors the path and file name exactly: `lib/oauth/
|
|
122
|
-
- Never add a second spec file for the same class/module. Examples of disallowed names: `*_more_spec.rb`, `*_extra_spec.rb`, `*_status_spec.rb`, or any other suffix that still targets the same class. If you find yourself wanting a second file, merge those examples into the canonical spec file for that class/module.
|
|
112
|
+
- One spec file per class/module. For each class or module under `lib/`, keep all of its unit tests in a single spec file under `spec/` that mirrors the path and file name exactly: `lib/oauth/my_class.rb` -> `spec/oauth/my_class_spec.rb`.
|
|
123
113
|
- Exception: Integration specs that intentionally span multiple classes. Place these under `spec/integration/` (or a clearly named integration folder), and do not directly mirror a single class. Name them after the scenario, not a class.
|
|
124
|
-
- Migration note: If a duplicate spec file exists, move all examples into the canonical file and delete the duplicate. Do not leave stubs or empty files behind.
|
|
125
114
|
|
|
126
115
|
## Lint It
|
|
127
116
|
|
|
@@ -144,7 +133,7 @@ For more detailed information about using RuboCop in this project, please see th
|
|
|
144
133
|
Never add `# rubocop:disable ...` / `# rubocop:enable ...` comments to code or specs (except when following the few existing `rubocop:disable` patterns for a rule already being disabled elsewhere in the code). Instead:
|
|
145
134
|
|
|
146
135
|
- Prefer configuration-based exclusions when a rule should not apply to certain paths or files (e.g., via `.rubocop.yml`).
|
|
147
|
-
- When a violation is temporary and you plan to fix it later, record it in `.rubocop_gradual.lock` using the gradual workflow:
|
|
136
|
+
- When a violation is temporary, and you plan to fix it later, record it in `.rubocop_gradual.lock` using the gradual workflow:
|
|
148
137
|
- `bundle exec rake rubocop_gradual:autocorrect` (preferred)
|
|
149
138
|
- `bundle exec rake rubocop_gradual:force_update` (only when you cannot fix the violations immediately)
|
|
150
139
|
|
|
@@ -167,7 +156,7 @@ Also see GitLab Contributors: [https://gitlab.com/ruby-oauth/oauth/-/graphs/main
|
|
|
167
156
|
**IMPORTANT**: To sign a build,
|
|
168
157
|
a public key for signing gems will need to be picked up by the line in the
|
|
169
158
|
`gemspec` defining the `spec.cert_chain` (check the relevant ENV variables there).
|
|
170
|
-
All releases
|
|
159
|
+
All releases are signed releases.
|
|
171
160
|
See: [RubyGems Security Guide][🔒️rubygems-security-guide]
|
|
172
161
|
|
|
173
162
|
NOTE: To build without signing the gem set `SKIP_GEM_SIGNING` to any value in the environment.
|
|
@@ -176,7 +165,7 @@ NOTE: To build without signing the gem set `SKIP_GEM_SIGNING` to any value in th
|
|
|
176
165
|
|
|
177
166
|
#### Automated process
|
|
178
167
|
|
|
179
|
-
1. Update version.rb to
|
|
168
|
+
1. Update version.rb to contain the correct version-to-be-released.
|
|
180
169
|
2. Run `bundle exec kettle-changelog`.
|
|
181
170
|
3. Run `bundle exec kettle-release`.
|
|
182
171
|
|
|
@@ -205,7 +194,7 @@ NOTE: To build without signing the gem set `SKIP_GEM_SIGNING` to any value in th
|
|
|
205
194
|
12. Sanity check the SHA256, comparing with the output from the `bin/gem_checksums` command:
|
|
206
195
|
- `sha256sum pkg/<gem name>-<version>.gem`
|
|
207
196
|
13. Run `bundle exec rake release` which will create a git tag for the version,
|
|
208
|
-
push git commits and tags, and push the `.gem` file to
|
|
197
|
+
push git commits and tags, and push the `.gem` file to the gem host configured in the gemspec.
|
|
209
198
|
|
|
210
199
|
[📜src-gl]: https://gitlab.com/ruby-oauth/oauth/
|
|
211
200
|
[📜src-cb]: https://codeberg.org/ruby-oauth/oauth
|
|
@@ -216,7 +205,7 @@ NOTE: To build without signing the gem set `SKIP_GEM_SIGNING` to any value in th
|
|
|
216
205
|
[🖐contributors]: https://github.com/ruby-oauth/oauth/graphs/contributors
|
|
217
206
|
[🚎contributors-gl]: https://gitlab.com/ruby-oauth/oauth/-/graphs/main
|
|
218
207
|
[🖐contributors-img]: https://contrib.rocks/image?repo=ruby-oauth/oauth
|
|
219
|
-
[💎
|
|
208
|
+
[💎gem-coop]: https://gem.coop
|
|
220
209
|
[🔒️rubygems-security-guide]: https://guides.rubygems.org/security/#building-gems
|
|
221
210
|
[🔒️rubygems-checksums-pr]: https://github.com/rubygems/rubygems/pull/6022
|
|
222
211
|
[🔒️rubygems-guides-pr]: https://github.com/rubygems/guides/pull/325
|
data/FUNDING.md
CHANGED
|
@@ -6,7 +6,7 @@ Many paths lead to being a sponsor or a backer of this project. Are you on such
|
|
|
6
6
|
|
|
7
7
|
[![OpenCollective Backers][🖇osc-backers-i]][🖇osc-backers] [![OpenCollective Sponsors][🖇osc-sponsors-i]][🖇osc-sponsors] [![Sponsor Me on Github][🖇sponsor-img]][🖇sponsor] [![Liberapay Goal Progress][⛳liberapay-img]][⛳liberapay] [![Donate on PayPal][🖇paypal-img]][🖇paypal]
|
|
8
8
|
|
|
9
|
-
[![Buy me a coffee][🖇buyme-small-img]][🖇buyme] [![Donate on Polar][🖇polar-img]][🖇polar] [![Donate to my FLOSS
|
|
9
|
+
[![Buy me a coffee][🖇buyme-small-img]][🖇buyme] [![Donate on Polar][🖇polar-img]][🖇polar] [![Donate to my FLOSS efforts at ko-fi.com][🖇kofi-img]][🖇kofi] [![Donate to my FLOSS efforts using Patreon][🖇patreon-img]][🖇patreon]
|
|
10
10
|
|
|
11
11
|
[⛳liberapay-img]: https://img.shields.io/liberapay/goal/pboling.svg?logo=liberapay&color=a51611&style=flat
|
|
12
12
|
[⛳liberapay]: https://liberapay.com/pboling/donate
|
|
@@ -46,7 +46,7 @@ To join the community or get help 👇️ Join the Discord.
|
|
|
46
46
|
|
|
47
47
|
To say "thanks for maintaining such a great tool" ☝️ Join the Discord or 👇️ send money.
|
|
48
48
|
|
|
49
|
-
[![Sponsor ruby-oauth/oauth on Open Source Collective][🖇osc-all-bottom-img]][🖇osc] 💌 [![Sponsor me on GitHub Sponsors][🖇sponsor-bottom-img]][🖇sponsor] 💌 [![Sponsor me on Liberapay][⛳liberapay-bottom-img]][⛳liberapay
|
|
49
|
+
[![Sponsor ruby-oauth/oauth on Open Source Collective][🖇osc-all-bottom-img]][🖇osc] 💌 [![Sponsor me on GitHub Sponsors][🖇sponsor-bottom-img]][🖇sponsor] 💌 [![Sponsor me on Liberapay][⛳liberapay-bottom-img]][⛳liberapay] 💌 [![Donate on PayPal][🖇paypal-bottom-img]][🖇paypal]
|
|
50
50
|
|
|
51
51
|
# Another Way to Support Open Source Software
|
|
52
52
|
|
data/LICENSE.txt
CHANGED
|
File without changes
|
data/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
# 🔑 Ruby OAuth 1.0 / 1.0a
|
|
11
11
|
|
|
12
|
-
[![Version][👽versioni]][👽version] [![GitHub tag (latest SemVer)][⛳️tag-img]][⛳️tag] [![License: MIT][📄license-img]][📄license-ref] [![Downloads Rank][👽dl-ranki]][👽dl-rank] [![
|
|
12
|
+
[![Version][👽versioni]][👽version] [![GitHub tag (latest SemVer)][⛳️tag-img]][⛳️tag] [![License: MIT][📄license-img]][📄license-ref] [![Downloads Rank][👽dl-ranki]][👽dl-rank] [![CodeCov Test Coverage][🏀codecovi]][🏀codecov] [![Coveralls Test Coverage][🏀coveralls-img]][🏀coveralls] [![QLTY Test Coverage][🏀qlty-covi]][🏀qlty-cov] [![QLTY Maintainability][🏀qlty-mnti]][🏀qlty-mnt] [![CI Heads][🚎3-hd-wfi]][🚎3-hd-wf] [![CI Runtime Dependencies @ HEAD][🚎12-crh-wfi]][🚎12-crh-wf] [![CI Current][🚎11-c-wfi]][🚎11-c-wf] [![CI Truffle Ruby][🚎9-t-wfi]][🚎9-t-wf] [![CI JRuby][🚎10-j-wfi]][🚎10-j-wf] [![Deps Locked][🚎13-🔒️-wfi]][🚎13-🔒️-wf] [![Deps Unlocked][🚎14-🔓️-wfi]][🚎14-🔓️-wf] [![CI Supported][🚎6-s-wfi]][🚎6-s-wf] [![CI Legacy][🚎4-lg-wfi]][🚎4-lg-wf] [![CI Unsupported][🚎7-us-wfi]][🚎7-us-wf] [![CI Ancient][🚎1-an-wfi]][🚎1-an-wf] [![CI Test Coverage][🚎2-cov-wfi]][🚎2-cov-wf] [![CI Style][🚎5-st-wfi]][🚎5-st-wf] [![CodeQL][🖐codeQL-img]][🖐codeQL] [![Apache SkyWalking Eyes License Compatibility Check][🚎15-🪪-wfi]][🚎15-🪪-wf]
|
|
13
13
|
|
|
14
14
|
`if ci_badges.map(&:color).detect { it != "green"}` ☝️ [let me know][🖼️galtzo-discord], as I may have missed the [discord notification][🖼️galtzo-discord].
|
|
15
15
|
|
|
@@ -19,6 +19,13 @@
|
|
|
19
19
|
|
|
20
20
|
[![OpenCollective Backers][🖇osc-backers-i]][🖇osc-backers] [![OpenCollective Sponsors][🖇osc-sponsors-i]][🖇osc-sponsors] [![Sponsor Me on Github][🖇sponsor-img]][🖇sponsor] [![Liberapay Goal Progress][⛳liberapay-img]][⛳liberapay] [![Donate on PayPal][🖇paypal-img]][🖇paypal] [![Buy me a coffee][🖇buyme-small-img]][🖇buyme] [![Donate on Polar][🖇polar-img]][🖇polar] [![Donate at ko-fi.com][🖇kofi-img]][🖇kofi]
|
|
21
21
|
|
|
22
|
+
<details>
|
|
23
|
+
<summary>👣 How will this project approach the September 2025 hostile takeover of RubyGems? 🚑️</summary>
|
|
24
|
+
|
|
25
|
+
I've summarized my thoughts in [this blog post](https://dev.to/galtzo/hostile-takeover-of-rubygems-my-thoughts-5hlo).
|
|
26
|
+
|
|
27
|
+
</details>
|
|
28
|
+
|
|
22
29
|
## 🌻 Synopsis
|
|
23
30
|
|
|
24
31
|
OAuth 1.0a is an industry-standard protocol for authorization.
|
|
@@ -37,7 +44,7 @@ All dependencies of this gem are signed, so it can be installed with a `HighSecu
|
|
|
37
44
|
[sibling-gem]: https://gitlab.com/ruby-oauth/oauth2
|
|
38
45
|
[sibling2-gem]: https://gitlab.com/ruby-oauth/oauth-tty
|
|
39
46
|
|
|
40
|
-
|
|
47
|
+
### OAuth 1.0 vs 1.0a: What this library implements
|
|
41
48
|
|
|
42
49
|
This gem targets the OAuth 1.0a behavior (the errata that became RFC 5849), while maintaining compatibility with providers that still behave like classic 1.0.
|
|
43
50
|
Here are the key differences between the two and how this gem handles them:
|
|
@@ -63,7 +70,7 @@ References: [RFC 5849 (OAuth 1.0)](https://datatracker.ietf.org/doc/html/rfc5849
|
|
|
63
70
|
|
|
64
71
|
Ruby OAuth has been maintained by a large number of talented
|
|
65
72
|
individuals over the years.
|
|
66
|
-
The primary maintainer since 2020 is Peter Boling (@pboling).
|
|
73
|
+
The primary maintainer since 2020 is Peter Boling ([@pboling](https://github.com/pboling)).
|
|
67
74
|
|
|
68
75
|
## 💡 Info you can shake a stick at
|
|
69
76
|
|
|
@@ -102,6 +109,8 @@ Compatible with MRI Ruby 2.3+, and concordant releases of JRuby, and TruffleRuby
|
|
|
102
109
|
| 🤼 [OAuth Ruby Google Group][⛳gg-discussions] | "Active" | ➖ | ➖ | ➖ | ➖ | [💚][⛳gg-discussions] |
|
|
103
110
|
| 🎮️ [Discord Server][✉️discord-invite] | [![Live Chat on Discord][✉️discord-invite-img-ftb]][✉️discord-invite] | [Let's][✉️discord-invite] | [talk][✉️discord-invite] | [about][✉️discord-invite] | [this][✉️discord-invite] | [library!][✉️discord-invite] |
|
|
104
111
|
|
|
112
|
+
[⛳gg-discussions]: https://groups.google.com/g/oauth-ruby
|
|
113
|
+
[⛳gg-discussions-img]: https://img.shields.io/badge/google-group-0093D0.svg?style=for-the-badge&logo=google&logoColor=orange
|
|
105
114
|
</details>
|
|
106
115
|
|
|
107
116
|
[gh-discussions]: https://github.com/ruby-oauth/oauth/discussions
|
|
@@ -251,10 +260,10 @@ hydra.run
|
|
|
251
260
|
|
|
252
261
|
### More Information
|
|
253
262
|
|
|
254
|
-
* RubyDoc Documentation: [![RubyDoc.info][🚎yard-img]][🚎yard]
|
|
255
|
-
* Mailing List/Google Group: [![
|
|
256
|
-
*
|
|
257
|
-
*
|
|
263
|
+
* RubyDoc Documentation: [![Current release on RubyDoc.info][📜docs-cr-rd-img]][🚎yard-current] [![YARD on Galtzo.com][📜docs-head-rd-img]][🚎yard-head]
|
|
264
|
+
* Mailing List/Google Group: [![OAuth Ruby Google Group][⛳gg-discussions-img]][⛳gg-discussions]
|
|
265
|
+
* Maintainer Blog: [![Maintainer Blog][🚂maint-blog-img]][🚂maint-blog]
|
|
266
|
+
* Live ruby-oauth Chat: [![Live Chat on Discord][✉️discord-invite-img-ftb]][✉️discord-invite]
|
|
258
267
|
|
|
259
268
|
## 🦷 FLOSS Funding
|
|
260
269
|
|
|
@@ -307,10 +316,7 @@ No sponsors yet. Be the first!
|
|
|
307
316
|
|
|
308
317
|
### Another way to support open-source
|
|
309
318
|
|
|
310
|
-
|
|
311
|
-
>—Anne Frank
|
|
312
|
-
|
|
313
|
-
I’m driven by a passion to foster a thriving open-source community – a space where people can tackle complex problems, no matter how small. Revitalizing libraries that have fallen into disrepair, and building new libraries focused on solving real-world challenges, are my passions — totaling 79 hours of FLOSS coding over just the past seven days, a pretty regular week for me. I was recently affected by layoffs, and the tech jobs market is unwelcoming. I’m reaching out here because your support would significantly aid my efforts to provide for my family, and my farm (11 🐔 chickens, 2 🐶 dogs, 3 🐰 rabbits, 8 🐈 cats).
|
|
319
|
+
I’m driven by a passion to foster a thriving open-source community – a space where people can tackle complex problems, no matter how small. Revitalizing libraries that have fallen into disrepair, and building new libraries focused on solving real-world challenges, are my passions. I was recently affected by layoffs, and the tech jobs market is unwelcoming. I’m reaching out here because your support would significantly aid my efforts to provide for my family, and my farm (11 🐔 chickens, 2 🐶 dogs, 3 🐰 rabbits, 8 🐈 cats).
|
|
314
320
|
|
|
315
321
|
If you work at a company that uses my work, please encourage them to support me as a corporate sponsor. My work on gems you use might show up in `bundle fund`.
|
|
316
322
|
|
|
@@ -318,7 +324,7 @@ I’m developing a new library, [floss_funding][🖇floss-funding-gem], designed
|
|
|
318
324
|
|
|
319
325
|
**[Floss-Funding.dev][🖇floss-funding.dev]: 👉️ No network calls. 👉️ No tracking. 👉️ No oversight. 👉️ Minimal crypto hashing. 💡 Easily disabled nags**
|
|
320
326
|
|
|
321
|
-
[![OpenCollective Backers][🖇osc-backers-i]][🖇osc-backers] [![OpenCollective Sponsors][🖇osc-sponsors-i]][🖇osc-sponsors] [![Sponsor Me on Github][🖇sponsor-img]][🖇sponsor] [![Liberapay Goal Progress][⛳liberapay-img]][⛳liberapay] [![Donate on PayPal][🖇paypal-img]][🖇paypal] [![Buy me a coffee][🖇buyme-small-img]][🖇buyme] [![Donate on Polar][🖇polar-img]][🖇polar] [![Donate to my FLOSS
|
|
327
|
+
[![OpenCollective Backers][🖇osc-backers-i]][🖇osc-backers] [![OpenCollective Sponsors][🖇osc-sponsors-i]][🖇osc-sponsors] [![Sponsor Me on Github][🖇sponsor-img]][🖇sponsor] [![Liberapay Goal Progress][⛳liberapay-img]][⛳liberapay] [![Donate on PayPal][🖇paypal-img]][🖇paypal] [![Buy me a coffee][🖇buyme-small-img]][🖇buyme] [![Donate on Polar][🖇polar-img]][🖇polar] [![Donate to my FLOSS efforts at ko-fi.com][🖇kofi-img]][🖇kofi] [![Donate to my FLOSS efforts using Patreon][🖇patreon-img]][🖇patreon]
|
|
322
328
|
|
|
323
329
|
## 🔐 Security
|
|
324
330
|
|
|
@@ -436,8 +442,8 @@ See [LICENSE.txt][📄license] for the official [Copyright Notice][📄copyright
|
|
|
436
442
|
## 🤑 A request for help
|
|
437
443
|
|
|
438
444
|
Maintainers have teeth and need to pay their dentists.
|
|
439
|
-
After getting laid off in an RIF in March and
|
|
440
|
-
I
|
|
445
|
+
After getting laid off in an RIF in March, and encountering difficulty finding a new one,
|
|
446
|
+
I began spending most of my time building open source tools.
|
|
441
447
|
I'm hoping to be able to pay for my kids' health insurance this month,
|
|
442
448
|
so if you value the work I am doing, I need your support.
|
|
443
449
|
Please consider sponsoring me or the project.
|
|
@@ -448,7 +454,7 @@ To join the community or get help 👇️ Join the Discord.
|
|
|
448
454
|
|
|
449
455
|
To say "thanks!" ☝️ Join the Discord or 👇️ send money.
|
|
450
456
|
|
|
451
|
-
[![Sponsor ruby-oauth/oauth on Open Source Collective][🖇osc-all-bottom-img]][🖇osc] 💌 [![Sponsor me on GitHub Sponsors][🖇sponsor-bottom-img]][🖇sponsor] 💌 [![Sponsor me on Liberapay][⛳liberapay-bottom-img]][⛳liberapay
|
|
457
|
+
[![Sponsor ruby-oauth/oauth on Open Source Collective][🖇osc-all-bottom-img]][🖇osc] 💌 [![Sponsor me on GitHub Sponsors][🖇sponsor-bottom-img]][🖇sponsor] 💌 [![Sponsor me on Liberapay][⛳liberapay-bottom-img]][⛳liberapay] 💌 [![Donate on PayPal][🖇paypal-bottom-img]][🖇paypal]
|
|
452
458
|
|
|
453
459
|
### Please give the project a star ⭐ ♥.
|
|
454
460
|
|
|
@@ -493,7 +499,7 @@ Thanks for RTFM. ☺️
|
|
|
493
499
|
[✇bundle-group-pattern]: https://gist.github.com/pboling/4564780
|
|
494
500
|
[⛳️gem-namespace]: https://github.com/ruby-oauth/oauth
|
|
495
501
|
[⛳️namespace-img]: https://img.shields.io/badge/namespace-Oauth-3C2D2D.svg?style=square&logo=ruby&logoColor=white
|
|
496
|
-
[⛳️gem-name]: https://
|
|
502
|
+
[⛳️gem-name]: https://bestgems.org/gems/oauth
|
|
497
503
|
[⛳️name-img]: https://img.shields.io/badge/name-oauth-3C2D2D.svg?style=square&logo=rubygems&logoColor=red
|
|
498
504
|
[⛳️tag-img]: https://img.shields.io/github/tag/ruby-oauth/oauth.svg
|
|
499
505
|
[⛳️tag]: http://github.com/ruby-oauth/oauth/releases
|
|
@@ -542,11 +548,9 @@ Thanks for RTFM. ☺️
|
|
|
542
548
|
[📜gh-wiki]: https://github.com/ruby-oauth/oauth/wiki
|
|
543
549
|
[📜gl-wiki-img]: https://img.shields.io/badge/wiki-examples-943CD2.svg?style=for-the-badge&logo=gitlab&logoColor=white
|
|
544
550
|
[📜gh-wiki-img]: https://img.shields.io/badge/wiki-examples-943CD2.svg?style=for-the-badge&logo=github&logoColor=white
|
|
545
|
-
[👽dl-rank]: https://
|
|
551
|
+
[👽dl-rank]: https://bestgems.org/gems/oauth
|
|
546
552
|
[👽dl-ranki]: https://img.shields.io/gem/rd/oauth.svg
|
|
547
|
-
[👽
|
|
548
|
-
[👽oss-helpi]: https://www.codetriage.com/ruby-oauth/oauth/badges/users.svg
|
|
549
|
-
[👽version]: https://rubygems.org/gems/oauth
|
|
553
|
+
[👽version]: https://bestgems.org/gems/oauth
|
|
550
554
|
[👽versioni]: https://img.shields.io/gem/v/oauth.svg
|
|
551
555
|
[🏀qlty-mnt]: https://qlty.sh/gh/ruby-oauth/projects/oauth
|
|
552
556
|
[🏀qlty-mnti]: https://qlty.sh/gh/ruby-oauth/projects/oauth/maintainability.svg
|
|
@@ -633,10 +637,10 @@ Thanks for RTFM. ☺️
|
|
|
633
637
|
[📌changelog]: CHANGELOG.md
|
|
634
638
|
[📗keep-changelog]: https://keepachangelog.com/en/1.0.0/
|
|
635
639
|
[📗keep-changelog-img]: https://img.shields.io/badge/keep--a--changelog-1.0.0-34495e.svg?style=flat
|
|
636
|
-
[📌gitmoji]:https://gitmoji.dev
|
|
637
|
-
[📌gitmoji-img]:https://img.shields.io/badge/gitmoji_commits-%20%F0%9F%98%9C%20%F0%9F%98%8D-34495e.svg?style=flat-square
|
|
640
|
+
[📌gitmoji]: https://gitmoji.dev
|
|
641
|
+
[📌gitmoji-img]: https://img.shields.io/badge/gitmoji_commits-%20%F0%9F%98%9C%20%F0%9F%98%8D-34495e.svg?style=flat-square
|
|
638
642
|
[🧮kloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
|
|
639
|
-
[🧮kloc-img]: https://img.shields.io/badge/KLOC-
|
|
643
|
+
[🧮kloc-img]: https://img.shields.io/badge/KLOC-1.009-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
|
|
640
644
|
[🔐security]: SECURITY.md
|
|
641
645
|
[🔐security-img]: https://img.shields.io/badge/security-policy-259D6C.svg?style=flat
|
|
642
646
|
[📄copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year
|
data/RUBOCOP.md
CHANGED
|
File without changes
|
data/SECURITY.md
CHANGED
|
@@ -2,22 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
## Supported Versions
|
|
4
4
|
|
|
5
|
-
| Version
|
|
6
|
-
|
|
7
|
-
| 1.
|
|
8
|
-
| 1.0.x | ✅ | [Tidelift Subscription][tidelift-ref] |
|
|
9
|
-
| 0.6.x | 🚨 | [Tidelift Subscription][tidelift-ref] |
|
|
10
|
-
| 0.5.x | 🚨 | [Tidelift Subscription][tidelift-ref] |
|
|
11
|
-
| <= 0.5 | ⛔ | ⛔ |
|
|
12
|
-
|
|
13
|
-
LEGEND:
|
|
14
|
-
✅ - Supported
|
|
15
|
-
🚨 - Will only receive critical bug and security updates.
|
|
16
|
-
⛔ - No Support
|
|
17
|
-
|
|
18
|
-
### EOL Policy
|
|
19
|
-
|
|
20
|
-
Non-commercial support for the oldest version of Ruby (which itself is going EOL) may be dropped each year in April.
|
|
5
|
+
| Version | Supported |
|
|
6
|
+
|----------|-----------|
|
|
7
|
+
| 1.latest | ✅ |
|
|
21
8
|
|
|
22
9
|
## Security contact information
|
|
23
10
|
|
|
@@ -25,13 +12,7 @@ To report a security vulnerability, please use the
|
|
|
25
12
|
[Tidelift security contact](https://tidelift.com/security).
|
|
26
13
|
Tidelift will coordinate the fix and disclosure.
|
|
27
14
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
Available as part of the Tidelift Subscription.
|
|
31
|
-
|
|
32
|
-
The maintainers of oauth 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.][tidelift-ref]
|
|
33
|
-
|
|
34
|
-
[tidelift-ref]: https://tidelift.com/subscription/pkg/rubygems-oauth?utm_source=rubygems-oauth&utm_medium=referral&utm_campaign=enterprise&utm_term=repo
|
|
15
|
+
More detailed explanation of the process is in [IRP.md][IRP].
|
|
35
16
|
|
|
36
17
|
## Additional Support
|
|
37
18
|
|
|
@@ -40,3 +21,4 @@ please consider sponsoring the project / maintainer @ https://liberapay.com/pbol
|
|
|
40
21
|
or find other sponsorship links in the [README].
|
|
41
22
|
|
|
42
23
|
[README]: README.md
|
|
24
|
+
[IRP]: IRP.md
|
|
@@ -26,12 +26,16 @@ module ActionController
|
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
class TestRequest
|
|
29
|
+
OAUTH_ENABLED_KEY = :oauth_action_controller_test_request_use_oauth
|
|
30
|
+
|
|
29
31
|
class << self
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
def use_oauth=(value)
|
|
33
|
+
Thread.current[OAUTH_ENABLED_KEY] = value
|
|
34
|
+
end
|
|
32
35
|
|
|
33
|
-
|
|
34
|
-
|
|
36
|
+
def use_oauth?
|
|
37
|
+
Thread.current[OAUTH_ENABLED_KEY]
|
|
38
|
+
end
|
|
35
39
|
end
|
|
36
40
|
|
|
37
41
|
def configure_oauth(consumer = nil, token = nil, options = {})
|
data/lib/oauth/client/em_http.rb
CHANGED
|
File without changes
|
data/lib/oauth/client/helper.rb
CHANGED
|
File without changes
|
|
File without changes
|
data/lib/oauth/client.rb
CHANGED
|
File without changes
|
data/lib/oauth/consumer.rb
CHANGED
|
@@ -8,7 +8,22 @@ require "oauth/errors"
|
|
|
8
8
|
require "cgi"
|
|
9
9
|
|
|
10
10
|
module OAuth
|
|
11
|
+
# Consumer credentials and request configuration for OAuth 1.0 / 1.0a flows.
|
|
12
|
+
#
|
|
13
|
+
# Includes {Auth::Sanitizer::FilteredAttributes} so inspect output redacts the
|
|
14
|
+
# consumer secret while leaving non-sensitive configuration visible.
|
|
11
15
|
class Consumer
|
|
16
|
+
include Auth::Sanitizer::FilteredAttributes
|
|
17
|
+
|
|
18
|
+
# Instance attributes exposed by the consumer.
|
|
19
|
+
#
|
|
20
|
+
# @!attribute [rw] options
|
|
21
|
+
# @return [Hash] Consumer configuration options
|
|
22
|
+
# @!attribute [rw] key
|
|
23
|
+
# @return [String] OAuth consumer key
|
|
24
|
+
# @!attribute [rw] secret
|
|
25
|
+
# @return [String] OAuth consumer secret (redacted in `#inspect`)
|
|
26
|
+
|
|
12
27
|
# determine the certificate authority path to verify SSL certs
|
|
13
28
|
if ENV["SSL_CERT_FILE"]
|
|
14
29
|
if File.exist?(ENV["SSL_CERT_FILE"])
|
|
@@ -78,6 +93,7 @@ module OAuth
|
|
|
78
93
|
)
|
|
79
94
|
|
|
80
95
|
attr_accessor :options, :key, :secret
|
|
96
|
+
filtered_attributes :secret
|
|
81
97
|
attr_writer :site, :http
|
|
82
98
|
|
|
83
99
|
# Create a new consumer instance by passing it a configuration hash:
|
|
@@ -238,8 +254,8 @@ module OAuth
|
|
|
238
254
|
def request(http_method, path, token = nil, request_options = {}, *arguments)
|
|
239
255
|
unless %r{^/} =~ path
|
|
240
256
|
@http = create_http(path)
|
|
241
|
-
|
|
242
|
-
path = "#{
|
|
257
|
+
uri = URI.parse(path)
|
|
258
|
+
path = "#{uri.path}#{"?#{uri.query}" if uri.query}"
|
|
243
259
|
end
|
|
244
260
|
|
|
245
261
|
# override the request with your own, this is useful for file uploads which Net::HTTP does not do
|
|
@@ -396,13 +412,13 @@ module OAuth
|
|
|
396
412
|
protected
|
|
397
413
|
|
|
398
414
|
# Instantiates the http object
|
|
399
|
-
def create_http(
|
|
400
|
-
|
|
415
|
+
def create_http(url = nil)
|
|
416
|
+
url = request_endpoint unless request_endpoint.nil?
|
|
401
417
|
|
|
402
|
-
our_uri = if
|
|
418
|
+
our_uri = if url.nil? || url[0] =~ %r{^/}
|
|
403
419
|
URI.parse(site)
|
|
404
420
|
else
|
|
405
|
-
your_uri = URI.parse(
|
|
421
|
+
your_uri = URI.parse(url)
|
|
406
422
|
if your_uri.host.nil?
|
|
407
423
|
# If the _url is a path, missing the leading slash, then it won't have a host,
|
|
408
424
|
# and our_uri *must* have a host, so we parse site instead.
|
data/lib/oauth/errors/error.rb
CHANGED
|
File without changes
|
data/lib/oauth/errors/problem.rb
CHANGED
|
File without changes
|
|
File without changes
|
data/lib/oauth/errors.rb
CHANGED
|
File without changes
|
data/lib/oauth/helper.rb
CHANGED
|
File without changes
|
data/lib/oauth/oauth.rb
CHANGED
|
File without changes
|
|
File without changes
|
data/lib/oauth/optional.rb
CHANGED
|
File without changes
|
|
File without changes
|
|
@@ -8,8 +8,10 @@ module OAuth
|
|
|
8
8
|
class Base
|
|
9
9
|
include OAuth::Helper
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
class << self
|
|
12
|
+
def proxies(klass)
|
|
13
|
+
OAuth::RequestProxy.available_proxies[klass] = self
|
|
14
|
+
end
|
|
13
15
|
end
|
|
14
16
|
|
|
15
17
|
attr_accessor :request, :options, :unsigned_parameters
|
|
@@ -23,15 +25,15 @@ module OAuth
|
|
|
23
25
|
## OAuth parameters
|
|
24
26
|
|
|
25
27
|
def oauth_callback
|
|
26
|
-
parameters["oauth_callback"]
|
|
28
|
+
[parameters["oauth_callback"]].flatten.first
|
|
27
29
|
end
|
|
28
30
|
|
|
29
31
|
def oauth_consumer_key
|
|
30
|
-
parameters["oauth_consumer_key"]
|
|
32
|
+
[parameters["oauth_consumer_key"]].flatten.first
|
|
31
33
|
end
|
|
32
34
|
|
|
33
35
|
def oauth_nonce
|
|
34
|
-
parameters["oauth_nonce"]
|
|
36
|
+
[parameters["oauth_nonce"]].flatten.first
|
|
35
37
|
end
|
|
36
38
|
|
|
37
39
|
def oauth_signature
|
|
@@ -40,31 +42,26 @@ module OAuth
|
|
|
40
42
|
end
|
|
41
43
|
|
|
42
44
|
def oauth_signature_method
|
|
43
|
-
|
|
44
|
-
when Array
|
|
45
|
-
parameters["oauth_signature_method"].first
|
|
46
|
-
else
|
|
47
|
-
parameters["oauth_signature_method"]
|
|
48
|
-
end
|
|
45
|
+
[parameters["oauth_signature_method"]].flatten.first
|
|
49
46
|
end
|
|
50
47
|
|
|
51
48
|
def oauth_timestamp
|
|
52
|
-
parameters["oauth_timestamp"]
|
|
49
|
+
[parameters["oauth_timestamp"]].flatten.first
|
|
53
50
|
end
|
|
54
51
|
|
|
55
52
|
def oauth_token
|
|
56
|
-
parameters["oauth_token"]
|
|
53
|
+
[parameters["oauth_token"]].flatten.first
|
|
57
54
|
end
|
|
58
55
|
|
|
59
56
|
# OAuth 1.0a only: value returned to the Consumer after user authorization
|
|
60
57
|
# and required when exchanging a Request Token for an Access Token.
|
|
61
58
|
# Not present in OAuth 1.0 flows.
|
|
62
59
|
def oauth_verifier
|
|
63
|
-
parameters["oauth_verifier"]
|
|
60
|
+
[parameters["oauth_verifier"]].flatten.first
|
|
64
61
|
end
|
|
65
62
|
|
|
66
63
|
def oauth_version
|
|
67
|
-
parameters["oauth_version"]
|
|
64
|
+
[parameters["oauth_version"]].flatten.first
|
|
68
65
|
end
|
|
69
66
|
|
|
70
67
|
# TODO: deprecate these
|
|
@@ -180,6 +177,17 @@ module OAuth
|
|
|
180
177
|
|
|
181
178
|
{}
|
|
182
179
|
end
|
|
180
|
+
|
|
181
|
+
# Utility to make parameter values array-style (or keep nil) so that
|
|
182
|
+
# subclasses can rely on array values for parameter merging/signing.
|
|
183
|
+
# Mirrors the implementation previously present in
|
|
184
|
+
# ActionDispatchRequest#wrap_values.
|
|
185
|
+
def wrap_values(hash)
|
|
186
|
+
return {} unless hash
|
|
187
|
+
hash.each_with_object({}) do |(k, v), acc|
|
|
188
|
+
acc[k] = (v.is_a?(Array) || v.nil?) ? v : [v]
|
|
189
|
+
end
|
|
190
|
+
end
|
|
183
191
|
end
|
|
184
192
|
end
|
|
185
193
|
end
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/lib/oauth/request_proxy.rb
CHANGED
|
@@ -2,24 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
module OAuth
|
|
4
4
|
module RequestProxy
|
|
5
|
-
|
|
6
|
-
@available_proxies ||= {}
|
|
7
|
-
end
|
|
5
|
+
AVAILABLE_PROXIES = {}
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
class << self
|
|
8
|
+
def available_proxies # :nodoc:
|
|
9
|
+
AVAILABLE_PROXIES
|
|
10
|
+
end
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
def proxy(request, options = {})
|
|
13
|
+
return request if request.is_a?(OAuth::RequestProxy::Base)
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
if klass.nil?
|
|
16
|
-
request_parent = available_proxies.keys.find { |rc| request.is_a?(rc) }
|
|
17
|
-
klass = available_proxies[request_parent]
|
|
18
|
-
end
|
|
15
|
+
klass = available_proxies[request.class]
|
|
19
16
|
|
|
20
|
-
|
|
17
|
+
# Search for possible superclass matches.
|
|
18
|
+
if klass.nil?
|
|
19
|
+
request_parent = available_proxies.keys.find { |rc| request.is_a?(rc) }
|
|
20
|
+
klass = available_proxies[request_parent]
|
|
21
|
+
end
|
|
21
22
|
|
|
22
|
-
|
|
23
|
+
raise UnknownRequestType, request.class.to_s unless klass
|
|
24
|
+
|
|
25
|
+
klass.new(request, options)
|
|
26
|
+
end
|
|
23
27
|
end
|
|
24
28
|
|
|
25
29
|
class UnknownRequestType < RuntimeError; end
|
data/lib/oauth/server.rb
CHANGED
|
File without changes
|
data/lib/oauth/signature/base.rb
CHANGED
|
@@ -7,17 +7,27 @@ require "base64"
|
|
|
7
7
|
|
|
8
8
|
module OAuth
|
|
9
9
|
module Signature
|
|
10
|
+
# Base class for OAuth signature implementations.
|
|
11
|
+
#
|
|
12
|
+
# Includes {Auth::Sanitizer::FilteredAttributes} so inspect output redacts
|
|
13
|
+
# secret-bearing fields captured during signature construction.
|
|
10
14
|
class Base
|
|
11
15
|
include OAuth::Helper
|
|
16
|
+
include Auth::Sanitizer::FilteredAttributes
|
|
12
17
|
|
|
18
|
+
# Signature construction options.
|
|
19
|
+
#
|
|
20
|
+
# @return [Hash]
|
|
13
21
|
attr_accessor :options
|
|
14
22
|
attr_reader :token_secret, :consumer_secret, :request
|
|
23
|
+
filtered_attributes :options, :consumer_secret, :token_secret
|
|
15
24
|
|
|
16
|
-
|
|
17
|
-
|
|
25
|
+
class << self
|
|
26
|
+
def implements(signature_method = nil)
|
|
27
|
+
return OAuth::Signature.available_methods.key(self) if signature_method.nil?
|
|
18
28
|
|
|
19
|
-
|
|
20
|
-
|
|
29
|
+
OAuth::Signature.available_methods[signature_method] = self
|
|
30
|
+
end
|
|
21
31
|
end
|
|
22
32
|
|
|
23
33
|
def initialize(request, options = {}, &block)
|
|
File without changes
|