oauth 0.5.13 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +36 -3
  3. data/CONTRIBUTING.md +1 -1
  4. data/LICENSE +2 -1
  5. data/README.md +66 -53
  6. data/SECURITY.md +9 -6
  7. data/bin/oauth +8 -4
  8. data/lib/oauth/cli/authorize_command.rb +58 -54
  9. data/lib/oauth/cli/base_command.rb +163 -159
  10. data/lib/oauth/cli/help_command.rb +9 -5
  11. data/lib/oauth/cli/query_command.rb +26 -17
  12. data/lib/oauth/cli/sign_command.rb +56 -52
  13. data/lib/oauth/cli/version_command.rb +8 -4
  14. data/lib/oauth/cli.rb +2 -0
  15. data/lib/oauth/client/action_controller_request.rb +4 -1
  16. data/lib/oauth/client/em_http.rb +4 -4
  17. data/lib/oauth/client/helper.rb +76 -72
  18. data/lib/oauth/client/net_http.rb +111 -104
  19. data/lib/oauth/client.rb +2 -0
  20. data/lib/oauth/consumer.rb +38 -28
  21. data/lib/oauth/errors/error.rb +2 -0
  22. data/lib/oauth/errors/problem.rb +3 -0
  23. data/lib/oauth/errors/unauthorized.rb +4 -0
  24. data/lib/oauth/errors.rb +2 -0
  25. data/lib/oauth/helper.rb +9 -5
  26. data/lib/oauth/oauth.rb +4 -2
  27. data/lib/oauth/oauth_test_helper.rb +2 -0
  28. data/lib/oauth/request_proxy/action_controller_request.rb +3 -24
  29. data/lib/oauth/request_proxy/base.rb +3 -3
  30. data/lib/oauth/request_proxy/mock_request.rb +1 -1
  31. data/lib/oauth/request_proxy/net_http.rb +5 -7
  32. data/lib/oauth/request_proxy/rest_client_request.rb +4 -3
  33. data/lib/oauth/request_proxy.rb +4 -1
  34. data/lib/oauth/server.rb +8 -4
  35. data/lib/oauth/signature/base.rb +71 -65
  36. data/lib/oauth/signature/hmac/sha1.rb +15 -9
  37. data/lib/oauth/signature/hmac/sha256.rb +15 -9
  38. data/lib/oauth/signature/plaintext.rb +18 -20
  39. data/lib/oauth/signature/rsa/sha1.rb +46 -38
  40. data/lib/oauth/signature.rb +3 -0
  41. data/lib/oauth/token.rb +2 -0
  42. data/lib/oauth/tokens/access_token.rb +2 -0
  43. data/lib/oauth/tokens/consumer_token.rb +2 -0
  44. data/lib/oauth/tokens/request_token.rb +5 -2
  45. data/lib/oauth/tokens/server_token.rb +2 -0
  46. data/lib/oauth/tokens/token.rb +2 -0
  47. data/lib/oauth/version.rb +5 -1
  48. data/lib/oauth.rb +8 -2
  49. metadata +32 -34
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module OAuth
2
4
  # The RequestToken is used for the initial Request.
3
5
  # This is normally created by the Consumer object.
@@ -23,7 +25,8 @@ module OAuth
23
25
 
24
26
  # exchange for AccessToken on server
25
27
  def get_access_token(options = {}, *arguments)
26
- response = consumer.token_request(consumer.http_method, (consumer.access_token_url? ? consumer.access_token_url : consumer.access_token_path), self, options, *arguments)
28
+ response = consumer.token_request(consumer.http_method,
29
+ (consumer.access_token_url? ? consumer.access_token_url : consumer.access_token_path), self, options, *arguments)
27
30
  OAuth::AccessToken.from_hash(consumer, response)
28
31
  end
29
32
 
@@ -33,7 +36,7 @@ module OAuth
33
36
  def build_url(base_url, params)
34
37
  uri = URI.parse(base_url.to_s)
35
38
  queries = {}
36
- queries = Hash[URI.decode_www_form(uri.query)] if uri.query
39
+ queries = URI.decode_www_form(uri.query).to_h if uri.query
37
40
  # TODO: doesn't handle array values correctly
38
41
  queries.merge!(params) if params
39
42
  uri.query = URI.encode_www_form(queries) unless queries.empty?
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module OAuth
2
4
  # Used on the server for generating tokens
3
5
  class ServerToken < Token
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module OAuth
2
4
  # Superclass for the various tokens used by OAuth
3
5
  class Token
data/lib/oauth/version.rb CHANGED
@@ -1,3 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module OAuth
2
- VERSION = "0.5.13".freeze
4
+ module Version
5
+ VERSION = "1.0.0"
6
+ end
3
7
  end
data/lib/oauth.rb CHANGED
@@ -1,5 +1,7 @@
1
- root = File.dirname(__FILE__)
2
- $LOAD_PATH << root unless $LOAD_PATH.include?(root)
1
+ # frozen_string_literal: true
2
+
3
+ # third party gems
4
+ require "version_gem"
3
5
 
4
6
  require "oauth/version"
5
7
 
@@ -11,3 +13,7 @@ require "oauth/signature/hmac/sha1"
11
13
  require "oauth/signature/hmac/sha256"
12
14
  require "oauth/signature/rsa/sha1"
13
15
  require "oauth/request_proxy/mock_request"
16
+
17
+ OAuth::Version.class_eval do
18
+ extend VersionGem::Basic
19
+ end
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.5.13
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pelle Braendgaard
@@ -19,19 +19,19 @@ cert_chain: []
19
19
  date: 2022-08-23 00:00:00.000000000 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
- name: curb
22
+ name: version_gem
23
23
  requirement: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - ">="
25
+ - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: '0'
28
- type: :development
27
+ version: '1.1'
28
+ type: :runtime
29
29
  prerelease: false
30
30
  version_requirements: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - ">="
32
+ - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: '0'
34
+ version: '1.1'
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: em-http-request
37
37
  requirement: !ruby/object:Gem::Requirement
@@ -64,16 +64,16 @@ dependencies:
64
64
  name: minitest
65
65
  requirement: !ruby/object:Gem::Requirement
66
66
  requirements:
67
- - - "<"
67
+ - - "~>"
68
68
  - !ruby/object:Gem::Version
69
- version: '5.16'
69
+ version: 5.15.0
70
70
  type: :development
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
73
73
  requirements:
74
- - - "<"
74
+ - - "~>"
75
75
  - !ruby/object:Gem::Version
76
- version: '5.16'
76
+ version: 5.15.0
77
77
  - !ruby/object:Gem::Dependency
78
78
  name: mocha
79
79
  requirement: !ruby/object:Gem::Requirement
@@ -92,16 +92,16 @@ dependencies:
92
92
  name: rack
93
93
  requirement: !ruby/object:Gem::Requirement
94
94
  requirements:
95
- - - ">="
95
+ - - "~>"
96
96
  - !ruby/object:Gem::Version
97
- version: '0'
97
+ version: '2.0'
98
98
  type: :development
99
99
  prerelease: false
100
100
  version_requirements: !ruby/object:Gem::Requirement
101
101
  requirements:
102
- - - ">="
102
+ - - "~>"
103
103
  - !ruby/object:Gem::Version
104
- version: '0'
104
+ version: '2.0'
105
105
  - !ruby/object:Gem::Dependency
106
106
  name: rack-test
107
107
  requirement: !ruby/object:Gem::Requirement
@@ -120,16 +120,16 @@ dependencies:
120
120
  name: rake
121
121
  requirement: !ruby/object:Gem::Requirement
122
122
  requirements:
123
- - - ">="
123
+ - - "~>"
124
124
  - !ruby/object:Gem::Version
125
- version: '0'
125
+ version: '13.0'
126
126
  type: :development
127
127
  prerelease: false
128
128
  version_requirements: !ruby/object:Gem::Requirement
129
129
  requirements:
130
- - - ">="
130
+ - - "~>"
131
131
  - !ruby/object:Gem::Version
132
- version: '0'
132
+ version: '13.0'
133
133
  - !ruby/object:Gem::Dependency
134
134
  name: rest-client
135
135
  requirement: !ruby/object:Gem::Requirement
@@ -150,14 +150,14 @@ dependencies:
150
150
  requirements:
151
151
  - - "~>"
152
152
  - !ruby/object:Gem::Version
153
- version: '4.0'
153
+ version: '18.0'
154
154
  type: :development
155
155
  prerelease: false
156
156
  version_requirements: !ruby/object:Gem::Requirement
157
157
  requirements:
158
158
  - - "~>"
159
159
  - !ruby/object:Gem::Version
160
- version: '4.0'
160
+ version: '18.0'
161
161
  - !ruby/object:Gem::Dependency
162
162
  name: typhoeus
163
163
  requirement: !ruby/object:Gem::Requirement
@@ -178,14 +178,14 @@ dependencies:
178
178
  requirements:
179
179
  - - "<="
180
180
  - !ruby/object:Gem::Version
181
- version: 3.14.0
181
+ version: 3.19.0
182
182
  type: :development
183
183
  prerelease: false
184
184
  version_requirements: !ruby/object:Gem::Requirement
185
185
  requirements:
186
186
  - - "<="
187
187
  - !ruby/object:Gem::Version
188
- version: 3.14.0
188
+ version: 3.19.0
189
189
  description:
190
190
  email: oauth-ruby@googlegroups.com
191
191
  executables:
@@ -254,18 +254,18 @@ licenses:
254
254
  - MIT
255
255
  metadata:
256
256
  homepage_uri: https://github.com/oauth-xx/oauth-ruby
257
- source_code_uri: https://github.com/oauth-xx/oauth-ruby/tree/v0.5.13
258
- changelog_uri: https://github.com/oauth-xx/oauth-ruby/blob/v0.5.13/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
259
259
  bug_tracker_uri: https://github.com/oauth-xx/oauth-ruby/issues
260
- documentation_uri: https://www.rubydoc.info/gems/oauth/0.5.13
260
+ documentation_uri: https://www.rubydoc.info/gems/oauth/1.0.0
261
261
  wiki_uri: https://github.com/oauth-xx/oauth-ruby/wiki
262
262
  rubygems_mfa_required: 'true'
263
- post_install_message: |2+
263
+ post_install_message: |2
264
264
 
265
- You have installed oauth version 0.5.13, congratulations!
265
+ You have installed oauth version 1.0.0, congratulations!
266
266
 
267
- Support for the 0.5.x series will end in April, 2023. Please upgrade to 0.6.x as soon as possible!
268
- The only breaking change will be dropped support for Ruby 2.0, 2.1, 2.2, and 2.3.
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.
269
269
 
270
270
  Please see:
271
271
  • https://github.com/oauth-xx/oauth/blob/main/SECURITY.md
@@ -286,7 +286,6 @@ post_install_message: |2+
286
286
  Please report issues, and support the project!
287
287
 
288
288
  Thanks, |7eter l-|. l3oling
289
-
290
289
  rdoc_options: []
291
290
  require_paths:
292
291
  - lib
@@ -294,16 +293,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
294
293
  requirements:
295
294
  - - ">="
296
295
  - !ruby/object:Gem::Version
297
- version: '2.0'
296
+ version: '2.7'
298
297
  required_rubygems_version: !ruby/object:Gem::Requirement
299
298
  requirements:
300
299
  - - ">="
301
300
  - !ruby/object:Gem::Version
302
301
  version: '0'
303
302
  requirements: []
304
- rubygems_version: 3.3.20
303
+ rubygems_version: 3.1.6
305
304
  signing_key:
306
305
  specification_version: 4
307
306
  summary: OAuth Core Ruby implementation
308
307
  test_files: []
309
- ...