oauth 0.5.10 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +17 -2
  3. data/README.md +60 -55
  4. data/SECURITY.md +7 -9
  5. data/bin/oauth +8 -4
  6. data/lib/oauth/cli/authorize_command.rb +58 -54
  7. data/lib/oauth/cli/base_command.rb +163 -159
  8. data/lib/oauth/cli/help_command.rb +9 -5
  9. data/lib/oauth/cli/query_command.rb +26 -17
  10. data/lib/oauth/cli/sign_command.rb +58 -52
  11. data/lib/oauth/cli/version_command.rb +8 -4
  12. data/lib/oauth/cli.rb +2 -0
  13. data/lib/oauth/client/action_controller_request.rb +4 -1
  14. data/lib/oauth/client/em_http.rb +3 -1
  15. data/lib/oauth/client/helper.rb +76 -72
  16. data/lib/oauth/client/net_http.rb +111 -104
  17. data/lib/oauth/client.rb +2 -0
  18. data/lib/oauth/consumer.rb +50 -32
  19. data/lib/oauth/errors/error.rb +2 -0
  20. data/lib/oauth/errors/problem.rb +3 -0
  21. data/lib/oauth/errors/unauthorized.rb +4 -0
  22. data/lib/oauth/errors.rb +2 -0
  23. data/lib/oauth/helper.rb +9 -5
  24. data/lib/oauth/oauth.rb +4 -2
  25. data/lib/oauth/oauth_test_helper.rb +2 -0
  26. data/lib/oauth/request_proxy/base.rb +4 -4
  27. data/lib/oauth/request_proxy/mock_request.rb +1 -1
  28. data/lib/oauth/request_proxy/net_http.rb +8 -8
  29. data/lib/oauth/request_proxy/rest_client_request.rb +4 -3
  30. data/lib/oauth/request_proxy.rb +4 -1
  31. data/lib/oauth/server.rb +8 -4
  32. data/lib/oauth/signature/base.rb +73 -65
  33. data/lib/oauth/signature/hmac/sha1.rb +15 -9
  34. data/lib/oauth/signature/hmac/sha256.rb +15 -9
  35. data/lib/oauth/signature/plaintext.rb +18 -20
  36. data/lib/oauth/signature/rsa/sha1.rb +46 -38
  37. data/lib/oauth/signature.rb +3 -0
  38. data/lib/oauth/token.rb +2 -0
  39. data/lib/oauth/tokens/access_token.rb +2 -0
  40. data/lib/oauth/tokens/consumer_token.rb +2 -0
  41. data/lib/oauth/tokens/request_token.rb +5 -2
  42. data/lib/oauth/tokens/server_token.rb +2 -0
  43. data/lib/oauth/tokens/token.rb +2 -0
  44. data/lib/oauth/version.rb +5 -1
  45. data/lib/oauth.rb +8 -2
  46. metadata +45 -30
@@ -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.10".freeze
4
+ module Version
5
+ VERSION = "0.6.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.10
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pelle Braendgaard
@@ -13,25 +13,25 @@ authors:
13
13
  - Matt Sanford
14
14
  - Aaron Quint
15
15
  - Peter Boling
16
- autorequire:
16
+ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
- date: 2022-05-04 00:00:00.000000000 Z
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: '0'
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: '0'
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
@@ -144,6 +144,20 @@ dependencies:
144
144
  - - ">="
145
145
  - !ruby/object:Gem::Version
146
146
  version: '0'
147
+ - !ruby/object:Gem::Dependency
148
+ name: rubocop-lts
149
+ requirement: !ruby/object:Gem::Requirement
150
+ requirements:
151
+ - - "~>"
152
+ - !ruby/object:Gem::Version
153
+ version: '12.0'
154
+ type: :development
155
+ prerelease: false
156
+ version_requirements: !ruby/object:Gem::Requirement
157
+ requirements:
158
+ - - "~>"
159
+ - !ruby/object:Gem::Version
160
+ version: '12.0'
147
161
  - !ruby/object:Gem::Dependency
148
162
  name: typhoeus
149
163
  requirement: !ruby/object:Gem::Requirement
@@ -172,7 +186,7 @@ dependencies:
172
186
  - - "<="
173
187
  - !ruby/object:Gem::Version
174
188
  version: 3.14.0
175
- description:
189
+ description:
176
190
  email: oauth-ruby@googlegroups.com
177
191
  executables:
178
192
  - oauth
@@ -239,13 +253,14 @@ homepage: https://github.com/oauth-xx/oauth-ruby
239
253
  licenses:
240
254
  - MIT
241
255
  metadata:
242
- bug_tracker_uri: https://github.com/oauth-xx/oauth-ruby/issues
243
- changelog_uri: https://github.com/oauth-xx/oauth-ruby/blob/master/CHANGELOG.md
244
- documentation_uri: https://rubydoc.info/github/oauth-xx/oauth-ruby/master
245
256
  homepage_uri: https://github.com/oauth-xx/oauth-ruby
246
- source_code_uri: https://github.com/oauth-xx/oauth-ruby
257
+ source_code_uri: https://github.com/oauth-xx/oauth-ruby/tree/v0.6.0
258
+ changelog_uri: https://github.com/oauth-xx/oauth-ruby/blob/v0.6.0/CHANGELOG.md
259
+ bug_tracker_uri: https://github.com/oauth-xx/oauth-ruby/issues
260
+ documentation_uri: https://www.rubydoc.info/gems/oauth/0.6.0
261
+ wiki_uri: https://github.com/oauth-xx/oauth-ruby/wiki
247
262
  rubygems_mfa_required: 'true'
248
- post_install_message:
263
+ post_install_message:
249
264
  rdoc_options: []
250
265
  require_paths:
251
266
  - lib
@@ -253,15 +268,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
253
268
  requirements:
254
269
  - - ">="
255
270
  - !ruby/object:Gem::Version
256
- version: '2.0'
271
+ version: '2.4'
257
272
  required_rubygems_version: !ruby/object:Gem::Requirement
258
273
  requirements:
259
274
  - - ">="
260
275
  - !ruby/object:Gem::Version
261
276
  version: '0'
262
277
  requirements: []
263
- rubygems_version: 3.0.3.1
264
- signing_key:
278
+ rubygems_version: 3.3.20
279
+ signing_key:
265
280
  specification_version: 4
266
281
  summary: OAuth Core Ruby implementation
267
282
  test_files: []