oauth 0.6.2 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 41420311334e3c3f5bf3c7c0523c10dae50d84ff4788e87c28765a72665a169a
4
- data.tar.gz: 58f1558f5d6c31c42405772c3ead07bfcc51754ceeff7c6b000f72b868833359
3
+ metadata.gz: a742c9fad7615c19f25dc2b780f8811029314827b05f91bf803b2a4b92805e10
4
+ data.tar.gz: dda3f9afdca321d3613bc6344d71a4cfffa43e19c380f3d86325aeaed09cc388
5
5
  SHA512:
6
- metadata.gz: 478782009426a1dab385f9ea8702fed19b7795b3116a5a49b9e9a527374e1fa1b62657f4413aeac7e439f7f2f339e2623d6e2bd9dcf42daefbce43caa4078144
7
- data.tar.gz: 96195f350fba5187766484f3606016cd245f8cc26c9b1e7083ec11e00b4589cf57ee07d5c8a8097dd56e41c8476a3eaf52ecaa9bf67b5ad333e7a48a268e2992
6
+ metadata.gz: 4abeba00e6da594572d2e74c974ac8658c947aa43fd9ea06f6e600df9a0b7b73d31bd8051cddab35749b8ed37346482c00653f29b9882d3b88a10d0716108403
7
+ data.tar.gz: cdd3b2015294fef30bd722804486c50dc1b19f566b6ae5ddc65e4ceb83e284439ff7059d9a6d5c098bb945122663223b0e383a3732f298b46a5bef1946aa9a39
data/CHANGELOG.md CHANGED
@@ -13,10 +13,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
13
13
 
14
14
  ### Removed
15
15
 
16
- ## [0.6.2] 2022-08-29
16
+ ## [1.0.0] 2022-08-23
17
17
  ### Changed
18
- * `OAuth::Comsumer#options` hash is now handled by `snaky_hash`, which was extracted from `oauth2`
19
- * symbolized keys, dot-access and snake-case are now normalized
18
+ * Dropped support for Ruby < 2.7
19
+
20
+ ### Added
21
+ * New EOL Policy
22
+ * Non-commercial support for the oldest version of Ruby (which itself is going EOL) will be dropped each year in April
20
23
 
21
24
  ## [0.6.1] 2022-08-23
22
25
  ### Changed
@@ -40,12 +43,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
40
43
  ### Removed
41
44
  * Ruby 2.0, 2.1, 2.2, and 2.3 are no longer valid install targets
42
45
 
43
- ## [0.5.14] 2022-08-29
44
- The "hopeful last 0.5.x" Release
45
-
46
- ### Fixed
47
- * More typos fixed
48
-
49
46
  ## [0.5.13] 2022-08-23
50
47
  The "I think I caught 'em all!" Release
51
48
 
@@ -442,11 +439,10 @@ but please have a look at the unit tests.
442
439
  * Moved all non-Rails functionality from the Rails plugin:
443
440
  http://code.google.com/p/oauth-plugin/
444
441
 
445
- [Unreleased]: https://github.com/oauth-xx/oauth-ruby/compare/v0.6.2...v0.6-maintenance
446
- [0.6.2]: https://github.com/oauth-xx/oauth-ruby/releases/tag/v0.6.2
442
+ [Unreleased]: https://github.com/oauth-xx/oauth-ruby/compare/v1.0.0...main
443
+ [1.0.0]: https://github.com/oauth-xx/oauth-ruby/releases/tag/v1.0.0
447
444
  [0.6.1]: https://github.com/oauth-xx/oauth-ruby/releases/tag/v0.6.1
448
445
  [0.6.0]: https://github.com/oauth-xx/oauth-ruby/releases/tag/v0.6.0
449
- [0.5.14]: https://github.com/oauth-xx/oauth-ruby/releases/tag/v0.5.14
450
446
  [0.5.13]: https://github.com/oauth-xx/oauth-ruby/releases/tag/v0.5.13
451
447
  [0.5.12]: https://github.com/oauth-xx/oauth-ruby/releases/tag/v0.5.12
452
448
  [0.5.11]: https://github.com/oauth-xx/oauth-ruby/releases/tag/v0.5.11
data/CONTRIBUTING.md CHANGED
@@ -17,7 +17,7 @@ Made with [contributors-img][contrib-rocks].
17
17
  [comment]: <> (Following links are used by README, CONTRIBUTING, Homepage)
18
18
 
19
19
  [conduct]: https://github.com/oauth-xx/oauth-ruby/blob/main/CODE_OF_CONDUCT.md
20
- [contributing]: https://github.com/oauth-xx/oauth-ruby/blob/main/CONTRIBUTING.md
21
20
  [contributors]: https://github.com/oauth-xx/oauth-ruby/graphs/contributors
22
21
  [mailinglist]: http://groups.google.com/group/oauth-ruby
23
22
  [source]: https://github.com/oauth-xx/oauth-ruby/
23
+ [contrib-rocks]: https://contrib.rocks
data/LICENSE CHANGED
@@ -1,6 +1,7 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2007-2012, 2016-2017, 2020-2021 Blaine Cook, Larry Halff, Pelle Braendgaard, Peter Boling
3
+ Copyright (c) 2007-2012, 2016-2017 Blaine Cook, Larry Halff, Pelle Braendgaard
4
+ Copyright (c) 2020-2022 Peter Boling
4
5
 
5
6
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
7
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -20,11 +20,17 @@ See the sibling `oauth2` gem for OAuth 2.0 implementations in Ruby.
20
20
  [oauth1-spec]: http://oauth.net/core/1.0/
21
21
  [sibling-gem]: https://github.com/oauth-xx/oauth-ruby
22
22
 
23
- **NOTE**
23
+ **New EOL Policy**
24
24
 
25
- This README, on branch `v0.6-maintenance`, targets 0.6.x series releases.
26
- The v0.6.x series of releases will be EOL no later than April, 2024.
27
- For later releases please see the `main` branch README.
25
+ Versions 1.0.x will be EOL no later than April, 2025.
26
+ Versions 0.6.x will be EOL no later than April, 2024.
27
+ Versions 0.5.x will be EOL no later than April, 2023.
28
+
29
+ This will facilitate dropping support for old, dead, and crusty versions of Ruby.
30
+
31
+ Non-commercial support for the oldest version of Ruby (which itself is going EOL) will be dropped each year in April.
32
+
33
+ Please upgrade to version 1.0. The only breaking change in 1.0 is dropping old Rubies.
28
34
 
29
35
  ## Status
30
36
 
@@ -57,10 +63,10 @@ appended indicators:
57
63
 
58
64
  | | Project | bundle add oauth |
59
65
  |:----|-----------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
60
- | 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] |
66
+ | 1️⃣ | name, license, docs | [![RubyGems.org][⛳️name-img]][⛳️gem] [![License: MIT][🖇src-license-img]][🖇src-license] [![RubyDoc.info][🚎yard-img]][🚎yard] |
61
67
  | 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]--> |
62
68
  | 3️⃣ | maintenance & 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] |
63
- | 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] |
69
+ | 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] [![MacOS][🧮mac-wf-img]][🧮mac-wf] [![Windows][📗win-wf-img]][📗win-wf] |
64
70
  | 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] |
65
71
  | 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] |
66
72
  | 7️⃣ | spread 💖 | [![Liberapay Patrons][⛳liberapay-img]][⛳liberapay] [![Sponsor Me][🖇sponsor-img]][🖇sponsor] [![Tweet @ Peter][🏘tweet-img]][🏘tweet] [🌏][aboutme] [👼][angelme] [💻][coderme] |
@@ -74,11 +80,8 @@ The link tokens in the following sections should be kept ordered by the row and
74
80
  [⛳️name-img]: https://img.shields.io/badge/name-oauth-brightgreen.svg?style=flat
75
81
  [🖇src-license]: https://opensource.org/licenses/MIT
76
82
  [🖇src-license-img]: https://img.shields.io/badge/License-MIT-green.svg
77
- [🏘fossa]: https://app.fossa.io/projects/git%2Bgithub.com%2Foauth-xx%2Foauth-ruby?ref=badge_shield
78
- [🏘fossa-img]: https://app.fossa.io/api/projects/git%2Bgithub.com%2Foauth-xx%2Foauth-ruby.svg?type=shield
79
83
  [🚎yard]: https://www.rubydoc.info/github/oauth-xx/oauth-ruby
80
84
  [🚎yard-img]: https://img.shields.io/badge/documentation-rubydoc-brightgreen.svg?style=flat
81
- [🖐inch-ci-img]: http://inch-ci.org/github/oauth-xx/oauth-ruby.png
82
85
 
83
86
  <!-- 2️⃣ version & activity -->
84
87
  [⛳️version-img]: http://img.shields.io/gem/v/oauth.svg
@@ -116,8 +119,6 @@ The link tokens in the following sections should be kept ordered by the row and
116
119
  [🏘sup-wf-img]: https://github.com/oauth-xx/oauth-ruby/actions/workflows/supported.yml/badge.svg
117
120
  [🚎heads-wf]: https://github.com/oauth-xx/oauth-ruby/actions/workflows/heads.yml
118
121
  [🚎heads-wf-img]: https://github.com/oauth-xx/oauth-ruby/actions/workflows/heads.yml/badge.svg
119
- [🖐uns-wf]: https://github.com/oauth-xx/oauth-ruby/actions/workflows/unsupported.yml
120
- [🖐uns-wf-img]: https://github.com/oauth-xx/oauth-ruby/actions/workflows/unsupported.yml/badge.svg
121
122
  [🧮mac-wf]: https://github.com/oauth-xx/oauth-ruby/actions/workflows/macos.yml
122
123
  [🧮mac-wf-img]: https://github.com/oauth-xx/oauth-ruby/actions/workflows/macos.yml/badge.svg
123
124
  [📗win-wf]: https://github.com/oauth-xx/oauth-ruby/actions/workflows/windows.yml
@@ -187,12 +188,12 @@ For more see [SECURITY.md][🚎sec-pol].
187
188
  ## Compatibility
188
189
 
189
190
  Targeted ruby compatibility is non-EOL versions of Ruby, currently 2.7, 3.0, and
190
- 3.1. Ruby is limited to 2.4+ in the gemspec, and this will change with minor version bumps,
191
+ 3.1. Ruby is limited to 2.7+ in the gemspec, and this will change with minor version bumps,
191
192
  while the gem is still in 0.x, in accordance with the SemVer spec.
192
193
 
193
- The `main` branch now targets 1.0.x releases.
194
- See `v0.6-maintenance` branch for Ruby >= 2.4.
195
- See `v0.5-maintenance` branch for Ruby >= 2.0.
194
+ The `main` branch now targets 1.0.x releases, for Ruby >= 2.7.
195
+ See `v0.6-maintenance` (EOL April, 2024) branch for Ruby >= 2.4.
196
+ See `v0.5-maintenance` (EOL April, 2023) branch for Ruby >= 2.0.
196
197
 
197
198
  NOTE: No further releases of version < 1.0.x are anticipated.
198
199
 
@@ -224,12 +225,12 @@ fashion. If critical issues for a particular implementation exist at the time
224
225
  of a major release, support for that Ruby version may be dropped.
225
226
  </details>
226
227
 
227
- | | Ruby OAuth Version | Maintenance Branch | 🚂 Compatibility | Official 💎 | Unofficial 💎 | Incidental 💎 |
228
- |:----|--------------------|--------------------|------------------------|----------------------|------------------------------|---------------|
229
- | 1️⃣ | 1.0.x | `main` | Rails 6, 7 | 2.7, 3.0, 3.1 | sorry, not sorry | nope |
230
- | 2️⃣ | 0.6.x | `v0.6-maintenance` | Rails 5, 6, 7 | 2.7, 3.0, 3.1 | 2.5, 2.6 | 2.4 |
231
- | 3️⃣ | 0.5.x | `v0.5-maintenance` | Rails 2, 3, 4, 5, 6, 7 | 2.7, 3.0, 3.1 | 2.1, 2.2, 2.3, 2.4, 2.5, 2.6 | 2.0 |
232
- | 4️⃣ | older | N/A | | Best of luck to you! | Please upgrade! | noop |
228
+ | | Ruby OAuth Version | Maintenance Branch | EOL | 🚂 Compatibility | Official 💎 | Unofficial 💎 | Incidental 💎 |
229
+ |:----|--------------------|--------------------|-----------|------------------------|----------------------|------------------------------|---------------|
230
+ | 1️⃣ | 1.0.x | `main` | | Rails 6, 7 | 2.7, 3.0, 3.1 | sorry, not sorry | nope |
231
+ | 2️⃣ | 0.6.x | `v0.6-maintenance` | 04/2024 | Rails 5, 6, 7 | 2.7, 3.0, 3.1 | 2.5, 2.6 | 2.4 |
232
+ | 3️⃣ | 0.5.x | `v0.5-maintenance` | 04/2023 | Rails 2, 3, 4, 5, 6, 7 | 2.7, 3.0, 3.1 | 2.1, 2.2, 2.3, 2.4, 2.5, 2.6 | 2.0 |
233
+ | 4️⃣ | older | N/A | yesterday | | Best of luck to you! | Please upgrade! | noop |
233
234
 
234
235
  NOTE: Once 1.0 is released, the 0.x series will only receive critical bug and security updates.
235
236
  See [SECURITY.md][🚎sec-pol]
@@ -319,6 +320,8 @@ See [CONTRIBUTING.md][contributing]
319
320
 
320
321
  Made with [contributors-img][contrib-rocks].
321
322
 
323
+ [contrib-rocks]: https://contrib.rocks
324
+
322
325
  ## Versioning
323
326
 
324
327
  This library aims to adhere to [Semantic Versioning 2.0.0][semver]. Violations of this scheme should be reported as
@@ -332,7 +335,7 @@ the [Pessimistic Version Constraint][pvc] with two digits of precision.
332
335
  For example:
333
336
 
334
337
  ```ruby
335
- spec.add_dependency "oauth", "~> 0.6.2"
338
+ spec.add_dependency "oauth", "~> 1.0"
336
339
  ```
337
340
 
338
341
  ## License
data/SECURITY.md CHANGED
@@ -2,11 +2,16 @@
2
2
 
3
3
  ## Supported Versions
4
4
 
5
- | Version | Supported |
6
- |---------|--------------------|
7
- | 0.6.x | :white_check_mark: |
8
- | 0.5.x | :white_check_mark: |
9
- | <= 0.5 | :x: |
5
+ | Version | Supported | EOL |
6
+ |---------|--------------------|---------|
7
+ | 1.0.x | :white_check_mark: | 04/2025 |
8
+ | 0.6.x | :white_check_mark: | 04/2024 |
9
+ | 0.5.x | :white_check_mark: | 04/2023 |
10
+ | <= 0.5 | :x: | :x: |
11
+
12
+ ### EOL Policy
13
+
14
+ Non-commercial support for the oldest version of Ruby (which itself is going EOL) will be dropped each year in April.
10
15
 
11
16
  ## Reporting a Vulnerability
12
17
 
@@ -45,9 +45,7 @@ module OAuth
45
45
  def puts_verbose_request(request)
46
46
  puts "Method: #{request.method}"
47
47
  puts "URI: #{request.uri}"
48
- unless options[:xmpp]
49
- puts "Normalized params: #{request.normalized_parameters}"
50
- end
48
+ puts "Normalized params: #{request.normalized_parameters}" unless options[:xmpp]
51
49
  puts "Signature base string: #{request.signature_base_string}"
52
50
 
53
51
  if xmpp?
@@ -84,9 +84,7 @@ module EventMachine
84
84
  else
85
85
  query.to_s
86
86
  end
87
- unless uri_query.to_s.empty?
88
- combined_query = [combined_query, uri_query].reject(&:empty?).join("&")
89
- end
87
+ combined_query = [combined_query, uri_query].reject(&:empty?).join("&") unless uri_query.to_s.empty?
90
88
  combined_query.to_s.empty? ? path : "#{path}?#{combined_query}"
91
89
  end
92
90
 
@@ -30,49 +30,47 @@ module OAuth
30
30
  end
31
31
  CA_FILE = nil unless defined?(CA_FILE)
32
32
 
33
- @@default_options = SnakyHash::SymbolKeyed.new(
34
- {
35
- # Signature method used by server. Defaults to HMAC-SHA1
36
- signature_method: "HMAC-SHA1",
37
-
38
- # default paths on site. These are the same as the defaults set up by the generators
39
- request_token_path: "/oauth/request_token",
40
- authenticate_path: "/oauth/authenticate",
41
- authorize_path: "/oauth/authorize",
42
- access_token_path: "/oauth/access_token",
43
-
44
- proxy: nil,
45
- # How do we send the oauth values to the server see
46
- # https://oauth.net/core/1.0/#consumer_req_param for more info
47
- #
48
- # Possible values:
49
- #
50
- # :header - via the Authorize header (Default) ( option 1. in spec)
51
- # :body - url form encoded in body of POST request ( option 2. in spec)
52
- # :query_string - via the query part of the url ( option 3. in spec)
53
- scheme: :header,
54
-
55
- # Default http method used for OAuth Token Requests (defaults to :post)
56
- http_method: :post,
57
-
58
- # Add a custom ca_file for consumer
59
- # :ca_file => '/etc/certs.pem'
60
-
61
- # Possible values:
62
- #
63
- # nil, false - no debug output
64
- # true - uses $stdout
65
- # some_value - uses some_value
66
- debug_output: nil,
67
-
68
- # Defaults to producing a body_hash as part of the signature but
69
- # can be disabled since it's not officially part of the OAuth 1.0
70
- # spec. Possible values are true and false
71
- body_hash_enabled: true,
72
-
73
- oauth_version: "1.0"
74
- }
75
- )
33
+ @@default_options = {
34
+ # Signature method used by server. Defaults to HMAC-SHA1
35
+ signature_method: "HMAC-SHA1",
36
+
37
+ # default paths on site. These are the same as the defaults set up by the generators
38
+ request_token_path: "/oauth/request_token",
39
+ authenticate_path: "/oauth/authenticate",
40
+ authorize_path: "/oauth/authorize",
41
+ access_token_path: "/oauth/access_token",
42
+
43
+ proxy: nil,
44
+ # How do we send the oauth values to the server see
45
+ # https://oauth.net/core/1.0/#consumer_req_param for more info
46
+ #
47
+ # Possible values:
48
+ #
49
+ # :header - via the Authorize header (Default) ( option 1. in spec)
50
+ # :body - url form encoded in body of POST request ( option 2. in spec)
51
+ # :query_string - via the query part of the url ( option 3. in spec)
52
+ scheme: :header,
53
+
54
+ # Default http method used for OAuth Token Requests (defaults to :post)
55
+ http_method: :post,
56
+
57
+ # Add a custom ca_file for consumer
58
+ # :ca_file => '/etc/certs.pem'
59
+
60
+ # Possible values:
61
+ #
62
+ # nil, false - no debug output
63
+ # true - uses $stdout
64
+ # some_value - uses some_value
65
+ debug_output: nil,
66
+
67
+ # Defaults to producing a body_hash as part of the signature but
68
+ # can be disabled since it's not officially part of the OAuth 1.0
69
+ # spec. Possible values are true and false
70
+ body_hash_enabled: true,
71
+
72
+ oauth_version: "1.0"
73
+ }
76
74
 
77
75
  attr_accessor :options, :key, :secret
78
76
  attr_writer :site, :http
@@ -105,8 +103,7 @@ module OAuth
105
103
  @secret = consumer_secret
106
104
 
107
105
  # ensure that keys are symbols
108
- snaky_options = SnakyHash::SymbolKeyed.new(options)
109
- @options = @@default_options.merge(snaky_options)
106
+ @options = @@default_options.merge(options.transform_keys(&:to_sym))
110
107
  end
111
108
 
112
109
  # The default http method
@@ -162,9 +159,7 @@ module OAuth
162
159
  def get_request_token(request_options = {}, *arguments, &block)
163
160
  # if oauth_callback wasn't provided, it is assumed that oauth_verifiers
164
161
  # will be exchanged out of band
165
- unless request_options[:exclude_callback]
166
- request_options[:oauth_callback] ||= OAuth::OUT_OF_BAND
167
- end
162
+ request_options[:oauth_callback] ||= OAuth::OUT_OF_BAND unless request_options[:exclude_callback]
168
163
 
169
164
  response = if block
170
165
  token_request(
@@ -389,13 +384,9 @@ module OAuth
389
384
  end
390
385
 
391
386
  http_object.read_timeout = http_object.open_timeout = @options[:timeout] || 60
392
- if @options[:open_timeout]
393
- http_object.open_timeout = @options[:open_timeout]
394
- end
387
+ http_object.open_timeout = @options[:open_timeout] if @options[:open_timeout]
395
388
  http_object.ssl_version = @options[:ssl_version] if @options[:ssl_version]
396
- if @options[:ssl_client_cert]
397
- http_object.cert = @options[:ssl_client_cert]
398
- end
389
+ http_object.cert = @options[:ssl_client_cert] if @options[:ssl_client_cert]
399
390
  http_object.key = @options[:ssl_client_key] if @options[:ssl_client_key]
400
391
  http_object.set_debug_output(debug_output) if debug_output
401
392
 
@@ -412,9 +403,7 @@ module OAuth
412
403
  # only add if the site host matches the current http object's host
413
404
  # (in case we've specified a full url for token requests)
414
405
  uri = URI.parse(site)
415
- if uri.path && uri.path != "/" && uri.host == http.address
416
- path = uri.path + path
417
- end
406
+ path = uri.path + path if uri.path && uri.path != "/" && uri.host == http.address
418
407
 
419
408
  headers = arguments.first.is_a?(Hash) ? arguments.shift : {}
420
409
 
@@ -1,36 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "active_support"
4
- require "active_support/version"
5
4
  require "action_controller"
6
5
  require "uri"
7
6
 
8
- if Gem::Version.new(ActiveSupport::VERSION::STRING) < Gem::Version.new("3")
9
- # rails 2.x
10
- require "action_controller/request"
11
- unless ActionController::Request::HTTP_METHODS.include?("patch")
12
- ActionController::Request::HTTP_METHODS << "patch"
13
- ActionController::Request::HTTP_METHOD_LOOKUP["PATCH"] = :patch
14
- ActionController::Request::HTTP_METHOD_LOOKUP["patch"] = :patch
15
- end
16
-
17
- elsif Gem::Version.new(ActiveSupport::VERSION::STRING) < Gem::Version.new("4")
18
- # rails 3.x
19
- require "action_dispatch/http/request"
20
- unless ActionDispatch::Request::HTTP_METHODS.include?("patch")
21
- ActionDispatch::Request::HTTP_METHODS << "patch"
22
- ActionDispatch::Request::HTTP_METHOD_LOOKUP["PATCH"] = :patch
23
- ActionDispatch::Request::HTTP_METHOD_LOOKUP["patch"] = :patch
24
- end
25
-
26
- else # rails 4.x and later - already has patch
27
- require "action_dispatch/http/request"
28
- end
7
+ require "action_dispatch/http/request"
29
8
 
30
9
  module OAuth
31
10
  module RequestProxy
32
11
  class ActionControllerRequest < OAuth::RequestProxy::Base
33
- proxies(defined?(::ActionDispatch::AbstractRequest) ? ::ActionDispatch::AbstractRequest : ::ActionDispatch::Request)
12
+ proxies(::ActionDispatch::Request)
34
13
 
35
14
  def method
36
15
  request.method.to_s.upcase
@@ -50,7 +29,7 @@ module OAuth
50
29
  end
51
30
  end
52
31
 
53
- # Override from OAuth::RequestProxy::Base to avoid roundtrip
32
+ # Override from OAuth::RequestProxy::Base to avoid round-trip
54
33
  # conversion to Hash or Array and thus preserve the original
55
34
  # parameter names
56
35
  def parameters_for_signature
@@ -79,7 +79,7 @@ module OAuth
79
79
  end
80
80
 
81
81
  def parameters_for_signature
82
- parameters.select { |k, _v| !signature_and_unsigned_parameters.include?(k) }
82
+ parameters.reject { |k, _v| signature_and_unsigned_parameters.include?(k) }
83
83
  end
84
84
 
85
85
  def oauth_parameters
@@ -69,9 +69,7 @@ module OAuth
69
69
  end
70
70
 
71
71
  def auth_header_params
72
- unless request["Authorization"] && request["Authorization"][0, 5] == "OAuth"
73
- return nil
74
- end
72
+ return nil unless request["Authorization"] && request["Authorization"][0, 5] == "OAuth"
75
73
 
76
74
  request["Authorization"]
77
75
  end
@@ -31,9 +31,7 @@ module OAuth
31
31
  @consumer_secret = options[:consumer].secret if options[:consumer]
32
32
 
33
33
  # presence of :consumer_secret option will override any Consumer that's provided
34
- if options[:consumer_secret]
35
- @consumer_secret = options[:consumer_secret]
36
- end
34
+ @consumer_secret = options[:consumer_secret] if options[:consumer_secret]
37
35
 
38
36
  ## token secret was determined beforehand
39
37
 
data/lib/oauth/version.rb CHANGED
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OAuth
4
4
  module Version
5
- VERSION = "0.6.2"
5
+ VERSION = "1.0.0"
6
6
  end
7
7
  end
data/lib/oauth.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # third party gems
4
- require "snaky_hash"
5
4
  require "version_gem"
6
5
 
7
6
  require "oauth/version"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oauth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pelle Braendgaard
@@ -16,22 +16,8 @@ authors:
16
16
  autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
- date: 2022-08-29 00:00:00.000000000 Z
19
+ date: 2022-08-23 00:00:00.000000000 Z
20
20
  dependencies:
21
- - !ruby/object:Gem::Dependency
22
- name: snaky_hash
23
- requirement: !ruby/object:Gem::Requirement
24
- requirements:
25
- - - "~>"
26
- - !ruby/object:Gem::Version
27
- version: '2.0'
28
- type: :runtime
29
- prerelease: false
30
- version_requirements: !ruby/object:Gem::Requirement
31
- requirements:
32
- - - "~>"
33
- - !ruby/object:Gem::Version
34
- version: '2.0'
35
21
  - !ruby/object:Gem::Dependency
36
22
  name: version_gem
37
23
  requirement: !ruby/object:Gem::Requirement
@@ -164,14 +150,14 @@ dependencies:
164
150
  requirements:
165
151
  - - "~>"
166
152
  - !ruby/object:Gem::Version
167
- version: '12.0'
153
+ version: '18.0'
168
154
  type: :development
169
155
  prerelease: false
170
156
  version_requirements: !ruby/object:Gem::Requirement
171
157
  requirements:
172
158
  - - "~>"
173
159
  - !ruby/object:Gem::Version
174
- version: '12.0'
160
+ version: '18.0'
175
161
  - !ruby/object:Gem::Dependency
176
162
  name: typhoeus
177
163
  requirement: !ruby/object:Gem::Requirement
@@ -192,14 +178,14 @@ dependencies:
192
178
  requirements:
193
179
  - - "<="
194
180
  - !ruby/object:Gem::Version
195
- version: 3.14.0
181
+ version: 3.19.0
196
182
  type: :development
197
183
  prerelease: false
198
184
  version_requirements: !ruby/object:Gem::Requirement
199
185
  requirements:
200
186
  - - "<="
201
187
  - !ruby/object:Gem::Version
202
- version: 3.14.0
188
+ version: 3.19.0
203
189
  description:
204
190
  email: oauth-ruby@googlegroups.com
205
191
  executables:
@@ -268,23 +254,23 @@ licenses:
268
254
  - MIT
269
255
  metadata:
270
256
  homepage_uri: https://github.com/oauth-xx/oauth-ruby
271
- source_code_uri: https://github.com/oauth-xx/oauth-ruby/tree/v0.6.2
272
- changelog_uri: https://github.com/oauth-xx/oauth-ruby/blob/v0.6.2/CHANGELOG.md
257
+ source_code_uri: https://github.com/oauth-xx/oauth-ruby/tree/v1.0.0
258
+ changelog_uri: https://github.com/oauth-xx/oauth-ruby/blob/v1.0.0/CHANGELOG.md
273
259
  bug_tracker_uri: https://github.com/oauth-xx/oauth-ruby/issues
274
- documentation_uri: https://www.rubydoc.info/gems/oauth/0.6.2
260
+ documentation_uri: https://www.rubydoc.info/gems/oauth/1.0.0
275
261
  wiki_uri: https://github.com/oauth-xx/oauth-ruby/wiki
276
262
  rubygems_mfa_required: 'true'
277
263
  post_install_message: |2
278
264
 
279
- You have installed oauth version 0.6.2, congratulations!
265
+ You have installed oauth version 1.0.0, congratulations!
280
266
 
281
- Non-commercial support for the 0.6.x series will end by April, 2024. Please upgrade to 1.0.x as soon as possible!
282
- The only breaking change will be dropped support for Ruby 2.4, 2.5, and 2.6.
267
+ Non-commercial support for the 1.0.x series will end in April, 2025. Please make a plan to upgrade to the next version prior to that date.
268
+ The only breaking change will be dropped support for Ruby 2.7.
283
269
 
284
270
  Please see:
285
- • https://github.com/oauth-xx/oauth-ruby/blob/main/SECURITY.md
271
+ • https://github.com/oauth-xx/oauth/blob/main/SECURITY.md
286
272
 
287
- Note also that I am, and this project is, in the process of leaving Github.
273
+ Note also that I, and this project, am in the process of leaving Github.
288
274
  I wrote about some of the reasons here:
289
275
  • https://dev.to/galtzo/im-leaving-github-50ba
290
276
 
@@ -307,14 +293,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
307
293
  requirements:
308
294
  - - ">="
309
295
  - !ruby/object:Gem::Version
310
- version: '2.4'
296
+ version: '2.7'
311
297
  required_rubygems_version: !ruby/object:Gem::Requirement
312
298
  requirements:
313
299
  - - ">="
314
300
  - !ruby/object:Gem::Version
315
301
  version: '0'
316
302
  requirements: []
317
- rubygems_version: 3.3.21
303
+ rubygems_version: 3.1.6
318
304
  signing_key:
319
305
  specification_version: 4
320
306
  summary: OAuth Core Ruby implementation