oauth 0.5.6 → 0.6.2

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.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +478 -0
  3. data/CODE_OF_CONDUCT.md +84 -0
  4. data/CONTRIBUTING.md +23 -0
  5. data/LICENSE +18 -17
  6. data/README.md +383 -0
  7. data/SECURITY.md +20 -0
  8. data/bin/oauth +10 -6
  9. data/lib/oauth/cli/authorize_command.rb +57 -55
  10. data/lib/oauth/cli/base_command.rb +163 -157
  11. data/lib/oauth/cli/help_command.rb +9 -5
  12. data/lib/oauth/cli/query_command.rb +26 -17
  13. data/lib/oauth/cli/sign_command.rb +58 -55
  14. data/lib/oauth/cli/version_command.rb +8 -4
  15. data/lib/oauth/cli.rb +21 -19
  16. data/lib/oauth/client/action_controller_request.rb +23 -21
  17. data/lib/oauth/client/em_http.rb +101 -99
  18. data/lib/oauth/client/helper.rb +83 -82
  19. data/lib/oauth/client/net_http.rb +112 -105
  20. data/lib/oauth/client.rb +2 -0
  21. data/lib/oauth/consumer.rb +157 -135
  22. data/lib/oauth/errors/error.rb +2 -0
  23. data/lib/oauth/errors/problem.rb +3 -0
  24. data/lib/oauth/errors/unauthorized.rb +7 -1
  25. data/lib/oauth/errors.rb +5 -3
  26. data/lib/oauth/helper.rb +26 -18
  27. data/lib/oauth/oauth.rb +6 -4
  28. data/lib/oauth/oauth_test_helper.rb +6 -4
  29. data/lib/oauth/request_proxy/action_controller_request.rb +56 -57
  30. data/lib/oauth/request_proxy/action_dispatch_request.rb +8 -4
  31. data/lib/oauth/request_proxy/base.rb +136 -132
  32. data/lib/oauth/request_proxy/curb_request.rb +49 -43
  33. data/lib/oauth/request_proxy/em_http_request.rb +59 -49
  34. data/lib/oauth/request_proxy/jabber_request.rb +12 -9
  35. data/lib/oauth/request_proxy/mock_request.rb +5 -3
  36. data/lib/oauth/request_proxy/net_http.rb +63 -54
  37. data/lib/oauth/request_proxy/rack_request.rb +35 -31
  38. data/lib/oauth/request_proxy/rest_client_request.rb +54 -50
  39. data/lib/oauth/request_proxy/typhoeus_request.rb +51 -45
  40. data/lib/oauth/request_proxy.rb +7 -4
  41. data/lib/oauth/server.rb +14 -12
  42. data/lib/oauth/signature/base.rb +80 -71
  43. data/lib/oauth/signature/hmac/sha1.rb +16 -10
  44. data/lib/oauth/signature/hmac/sha256.rb +16 -10
  45. data/lib/oauth/signature/plaintext.rb +18 -20
  46. data/lib/oauth/signature/rsa/sha1.rb +46 -38
  47. data/lib/oauth/signature.rb +8 -5
  48. data/lib/oauth/token.rb +7 -5
  49. data/lib/oauth/tokens/access_token.rb +5 -3
  50. data/lib/oauth/tokens/consumer_token.rb +4 -2
  51. data/lib/oauth/tokens/request_token.rb +12 -10
  52. data/lib/oauth/tokens/server_token.rb +2 -1
  53. data/lib/oauth/tokens/token.rb +2 -0
  54. data/lib/oauth/version.rb +5 -1
  55. data/lib/oauth.rb +17 -9
  56. metadata +94 -98
  57. data/README.rdoc +0 -88
data/lib/oauth.rb CHANGED
@@ -1,12 +1,20 @@
1
- root = File.dirname(__FILE__)
2
- $LOAD_PATH << root unless $LOAD_PATH.include?(root)
1
+ # frozen_string_literal: true
3
2
 
4
- require 'oauth/version'
3
+ # third party gems
4
+ require "snaky_hash"
5
+ require "version_gem"
5
6
 
6
- require 'oauth/oauth'
7
+ require "oauth/version"
7
8
 
8
- require 'oauth/client/helper'
9
- require 'oauth/signature/hmac/sha1'
10
- require 'oauth/signature/hmac/sha256'
11
- require 'oauth/signature/rsa/sha1'
12
- require 'oauth/request_proxy/mock_request'
9
+ require "oauth/oauth"
10
+
11
+ require "oauth/client/helper"
12
+ require "oauth/signature/plaintext"
13
+ require "oauth/signature/hmac/sha1"
14
+ require "oauth/signature/hmac/sha256"
15
+ require "oauth/signature/rsa/sha1"
16
+ require "oauth/request_proxy/mock_request"
17
+
18
+ OAuth::Version.class_eval do
19
+ extend VersionGem::Basic
20
+ 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.6
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pelle Braendgaard
@@ -12,67 +12,54 @@ authors:
12
12
  - Seth Fitzsimmons
13
13
  - Matt Sanford
14
14
  - Aaron Quint
15
- autorequire:
15
+ - Peter Boling
16
+ autorequire:
16
17
  bindir: bin
17
18
  cert_chain: []
18
- date: 2021-04-02 00:00:00.000000000 Z
19
+ date: 2022-08-29 00:00:00.000000000 Z
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
- name: rake
22
+ name: snaky_hash
22
23
  requirement: !ruby/object:Gem::Requirement
23
24
  requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '0'
27
- type: :development
28
- prerelease: false
29
- version_requirements: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- - !ruby/object:Gem::Dependency
35
- name: minitest
36
- requirement: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
25
+ - - "~>"
39
26
  - !ruby/object:Gem::Version
40
- version: '0'
41
- type: :development
27
+ version: '2.0'
28
+ type: :runtime
42
29
  prerelease: false
43
30
  version_requirements: !ruby/object:Gem::Requirement
44
31
  requirements:
45
- - - ">="
32
+ - - "~>"
46
33
  - !ruby/object:Gem::Version
47
- version: '0'
34
+ version: '2.0'
48
35
  - !ruby/object:Gem::Dependency
49
- name: byebug
36
+ name: version_gem
50
37
  requirement: !ruby/object:Gem::Requirement
51
38
  requirements:
52
- - - ">="
39
+ - - "~>"
53
40
  - !ruby/object:Gem::Version
54
- version: '0'
55
- type: :development
41
+ version: '1.1'
42
+ type: :runtime
56
43
  prerelease: false
57
44
  version_requirements: !ruby/object:Gem::Requirement
58
45
  requirements:
59
- - - ">="
46
+ - - "~>"
60
47
  - !ruby/object:Gem::Version
61
- version: '0'
48
+ version: '1.1'
62
49
  - !ruby/object:Gem::Dependency
63
- name: actionpack
50
+ name: em-http-request
64
51
  requirement: !ruby/object:Gem::Requirement
65
52
  requirements:
66
- - - ">="
53
+ - - "~>"
67
54
  - !ruby/object:Gem::Version
68
- version: '5.0'
55
+ version: 1.1.7
69
56
  type: :development
70
57
  prerelease: false
71
58
  version_requirements: !ruby/object:Gem::Requirement
72
59
  requirements:
73
- - - ">="
60
+ - - "~>"
74
61
  - !ruby/object:Gem::Version
75
- version: '5.0'
62
+ version: 1.1.7
76
63
  - !ruby/object:Gem::Dependency
77
64
  name: iconv
78
65
  requirement: !ruby/object:Gem::Requirement
@@ -88,21 +75,21 @@ dependencies:
88
75
  - !ruby/object:Gem::Version
89
76
  version: '0'
90
77
  - !ruby/object:Gem::Dependency
91
- name: rack
78
+ name: minitest
92
79
  requirement: !ruby/object:Gem::Requirement
93
80
  requirements:
94
81
  - - "~>"
95
82
  - !ruby/object:Gem::Version
96
- version: '2.0'
83
+ version: 5.15.0
97
84
  type: :development
98
85
  prerelease: false
99
86
  version_requirements: !ruby/object:Gem::Requirement
100
87
  requirements:
101
88
  - - "~>"
102
89
  - !ruby/object:Gem::Version
103
- version: '2.0'
90
+ version: 5.15.0
104
91
  - !ruby/object:Gem::Dependency
105
- name: rack-test
92
+ name: mocha
106
93
  requirement: !ruby/object:Gem::Requirement
107
94
  requirements:
108
95
  - - ">="
@@ -116,55 +103,49 @@ dependencies:
116
103
  - !ruby/object:Gem::Version
117
104
  version: '0'
118
105
  - !ruby/object:Gem::Dependency
119
- name: mocha
106
+ name: rack
120
107
  requirement: !ruby/object:Gem::Requirement
121
108
  requirements:
122
- - - ">="
123
- - !ruby/object:Gem::Version
124
- version: 0.9.12
125
- - - "<="
109
+ - - "~>"
126
110
  - !ruby/object:Gem::Version
127
- version: 1.1.0
111
+ version: '2.0'
128
112
  type: :development
129
113
  prerelease: false
130
114
  version_requirements: !ruby/object:Gem::Requirement
131
115
  requirements:
132
- - - ">="
133
- - !ruby/object:Gem::Version
134
- version: 0.9.12
135
- - - "<="
116
+ - - "~>"
136
117
  - !ruby/object:Gem::Version
137
- version: 1.1.0
118
+ version: '2.0'
138
119
  - !ruby/object:Gem::Dependency
139
- name: typhoeus
120
+ name: rack-test
140
121
  requirement: !ruby/object:Gem::Requirement
141
122
  requirements:
142
123
  - - ">="
143
124
  - !ruby/object:Gem::Version
144
- version: 0.1.13
125
+ version: '0'
145
126
  type: :development
146
127
  prerelease: false
147
128
  version_requirements: !ruby/object:Gem::Requirement
148
129
  requirements:
149
130
  - - ">="
150
131
  - !ruby/object:Gem::Version
151
- version: 0.1.13
132
+ version: '0'
152
133
  - !ruby/object:Gem::Dependency
153
- name: em-http-request
134
+ name: rake
154
135
  requirement: !ruby/object:Gem::Requirement
155
136
  requirements:
156
- - - '='
137
+ - - "~>"
157
138
  - !ruby/object:Gem::Version
158
- version: 0.2.11
139
+ version: '13.0'
159
140
  type: :development
160
141
  prerelease: false
161
142
  version_requirements: !ruby/object:Gem::Requirement
162
143
  requirements:
163
- - - '='
144
+ - - "~>"
164
145
  - !ruby/object:Gem::Version
165
- version: 0.2.11
146
+ version: '13.0'
166
147
  - !ruby/object:Gem::Dependency
167
- name: curb
148
+ name: rest-client
168
149
  requirement: !ruby/object:Gem::Requirement
169
150
  requirements:
170
151
  - - ">="
@@ -178,73 +159,61 @@ dependencies:
178
159
  - !ruby/object:Gem::Version
179
160
  version: '0'
180
161
  - !ruby/object:Gem::Dependency
181
- name: webmock
162
+ name: rubocop-lts
182
163
  requirement: !ruby/object:Gem::Requirement
183
164
  requirements:
184
- - - "<"
185
- - !ruby/object:Gem::Version
186
- version: '2.0'
187
- type: :development
188
- prerelease: false
189
- version_requirements: !ruby/object:Gem::Requirement
190
- requirements:
191
- - - "<"
192
- - !ruby/object:Gem::Version
193
- version: '2.0'
194
- - !ruby/object:Gem::Dependency
195
- name: codeclimate-test-reporter
196
- requirement: !ruby/object:Gem::Requirement
197
- requirements:
198
- - - ">="
165
+ - - "~>"
199
166
  - !ruby/object:Gem::Version
200
- version: '0'
167
+ version: '12.0'
201
168
  type: :development
202
169
  prerelease: false
203
170
  version_requirements: !ruby/object:Gem::Requirement
204
171
  requirements:
205
- - - ">="
172
+ - - "~>"
206
173
  - !ruby/object:Gem::Version
207
- version: '0'
174
+ version: '12.0'
208
175
  - !ruby/object:Gem::Dependency
209
- name: simplecov
176
+ name: typhoeus
210
177
  requirement: !ruby/object:Gem::Requirement
211
178
  requirements:
212
179
  - - ">="
213
180
  - !ruby/object:Gem::Version
214
- version: '0'
181
+ version: 0.1.13
215
182
  type: :development
216
183
  prerelease: false
217
184
  version_requirements: !ruby/object:Gem::Requirement
218
185
  requirements:
219
186
  - - ">="
220
187
  - !ruby/object:Gem::Version
221
- version: '0'
188
+ version: 0.1.13
222
189
  - !ruby/object:Gem::Dependency
223
- name: rest-client
190
+ name: webmock
224
191
  requirement: !ruby/object:Gem::Requirement
225
192
  requirements:
226
- - - ">="
193
+ - - "<="
227
194
  - !ruby/object:Gem::Version
228
- version: '0'
195
+ version: 3.14.0
229
196
  type: :development
230
197
  prerelease: false
231
198
  version_requirements: !ruby/object:Gem::Requirement
232
199
  requirements:
233
- - - ">="
200
+ - - "<="
234
201
  - !ruby/object:Gem::Version
235
- version: '0'
236
- description:
237
- email: oauth-ruby@googlegroupspec.com
202
+ version: 3.14.0
203
+ description:
204
+ email: oauth-ruby@googlegroups.com
238
205
  executables:
239
206
  - oauth
240
207
  extensions: []
241
208
  extra_rdoc_files:
242
- - LICENSE
243
- - README.rdoc
244
209
  - TODO
245
210
  files:
211
+ - CHANGELOG.md
212
+ - CODE_OF_CONDUCT.md
213
+ - CONTRIBUTING.md
246
214
  - LICENSE
247
- - README.rdoc
215
+ - README.md
216
+ - SECURITY.md
248
217
  - TODO
249
218
  - bin/oauth
250
219
  - lib/oauth.rb
@@ -298,12 +267,39 @@ homepage: https://github.com/oauth-xx/oauth-ruby
298
267
  licenses:
299
268
  - MIT
300
269
  metadata:
301
- bug_tracker_uri: https://github.com/oauth-xx/oauth-ruby/issues
302
- changelog_uri: https://github.com/oauth-xx/oauth-ruby/blob/master/HISTORY
303
- documentation_uri: https://rdoc.info/github/oauth-xx/oauth-ruby/master/frames
304
270
  homepage_uri: https://github.com/oauth-xx/oauth-ruby
305
- source_code_uri: https://github.com/oauth-xx/oauth-ruby
306
- post_install_message:
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
273
+ bug_tracker_uri: https://github.com/oauth-xx/oauth-ruby/issues
274
+ documentation_uri: https://www.rubydoc.info/gems/oauth/0.6.2
275
+ wiki_uri: https://github.com/oauth-xx/oauth-ruby/wiki
276
+ rubygems_mfa_required: 'true'
277
+ post_install_message: |2
278
+
279
+ You have installed oauth version 0.6.2, congratulations!
280
+
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.
283
+
284
+ Please see:
285
+ • https://github.com/oauth-xx/oauth-ruby/blob/main/SECURITY.md
286
+
287
+ Note also that I am, and this project is, in the process of leaving Github.
288
+ I wrote about some of the reasons here:
289
+ • https://dev.to/galtzo/im-leaving-github-50ba
290
+
291
+ If you are a human, please consider a donation as I move toward supporting myself with Open Source work:
292
+ • https://liberapay.com/pboling
293
+ • https://ko-fi.com/pboling
294
+ • https://patreon.com/galtzo
295
+
296
+ If you are a corporation, please consider supporting this project, and open source work generally, with a TideLift subscription.
297
+ • https://tidelift.com/funding/github/rubygems/oauth
298
+ • Or hire me. I am looking for a job!
299
+
300
+ Please report issues, and support the project!
301
+
302
+ Thanks, |7eter l-|. l3oling
307
303
  rdoc_options: []
308
304
  require_paths:
309
305
  - lib
@@ -311,15 +307,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
311
307
  requirements:
312
308
  - - ">="
313
309
  - !ruby/object:Gem::Version
314
- version: '2.0'
310
+ version: '2.4'
315
311
  required_rubygems_version: !ruby/object:Gem::Requirement
316
312
  requirements:
317
313
  - - ">="
318
314
  - !ruby/object:Gem::Version
319
315
  version: '0'
320
316
  requirements: []
321
- rubygems_version: 3.0.3
322
- signing_key:
317
+ rubygems_version: 3.3.21
318
+ signing_key:
323
319
  specification_version: 4
324
320
  summary: OAuth Core Ruby implementation
325
321
  test_files: []
data/README.rdoc DELETED
@@ -1,88 +0,0 @@
1
- = Ruby OAuth
2
-
3
- == Status
4
-
5
- {<img src="https://travis-ci.org/oauth-xx/oauth-ruby.svg?branch=master" alt="Build Status" />}[https://travis-ci.com/github/oauth-xx/oauth-ruby]
6
-
7
-
8
-
9
- == What
10
-
11
- This is a RubyGem for implementing both OAuth clients and servers in Ruby applications.
12
-
13
- See the OAuth specs http://oauth.net/core/1.0/
14
-
15
- == Installing
16
-
17
- sudo gem install oauth
18
-
19
- The source code is now hosted on the OAuth GitHub Project http://github.com/oauth-xx/oauth-ruby
20
-
21
- == The basics
22
-
23
- This is a ruby library which is intended to be used in creating Ruby Consumer and Service Provider applications. It is NOT a Rails plugin, but could easily be used for the foundation for such a Rails plugin.
24
-
25
- As a matter of fact it has been pulled out from an OAuth Rails GEM (https://rubygems.org/gems/oauth-plugin https://github.com/pelle/oauth-plugin) which now uses this gem as a dependency.
26
-
27
- == Demonstration of usage
28
-
29
- We need to specify the oauth_callback url explicitly, otherwise it defaults to "oob" (Out of Band)
30
-
31
- callback_url = "http://127.0.0.1:3000/oauth/callback"
32
-
33
- Create a new `OAuth::Consumer` instance by passing it a configuration hash:
34
-
35
- oauth_consumer = OAuth::Consumer.new("key", "secret", :site => "https://agree2")
36
-
37
- Start the process by requesting a token
38
-
39
- request_token = oauth_consumer.get_request_token(:oauth_callback => callback_url)
40
-
41
- session[:token] = request_token.token
42
- session[:token_secret] = request_token.secret
43
- redirect_to request_token.authorize_url(:oauth_callback => callback_url)
44
-
45
- When user returns create an access_token
46
-
47
- hash = { oauth_token: session[:token], oauth_token_secret: session[:token_secret]}
48
- request_token = OAuth::RequestToken.from_hash(oauth_consumer, hash)
49
- access_token = request_token.get_access_token
50
- # For 3-legged authorization, flow oauth_verifier is passed as param in callback
51
- # access_token = request_token.get_access_token(oauth_verifier: params[:oauth_verifier])
52
- @photos = access_token.get('/photos.xml')
53
-
54
- Now that you have an access token, you can use Typhoeus to interact with the OAuth provider if you choose.
55
-
56
- require 'typhoeus'
57
- require 'oauth/request_proxy/typhoeus_request'
58
- oauth_params = {:consumer => oauth_consumer, :token => access_token}
59
- hydra = Typhoeus::Hydra.new
60
- req = Typhoeus::Request.new(uri, options) # :method needs to be specified in options
61
- oauth_helper = OAuth::Client::Helper.new(req, oauth_params.merge(:request_uri => uri))
62
- req.options[:headers].merge!({"Authorization" => oauth_helper.header}) # Signs the request
63
- hydra.queue(req)
64
- hydra.run
65
- @response = req.response
66
-
67
-
68
- == More Information
69
-
70
- * RDoc: http://rdoc.info/github/oauth-xx/oauth-ruby/master/frames
71
- * Mailing List/Google Group: http://groups.google.com/group/oauth-ruby
72
-
73
- == How to submit patches
74
-
75
- The source code is now hosted on the OAuth GitHub Project http://github.com/oauth-xx/oauth-ruby
76
-
77
- To submit a patch, please fork the oauth project and create a patch with tests. Once you're happy with it send a pull request and post a message to the google group.
78
-
79
- == License
80
-
81
- This code is free to use under the terms of the MIT license.
82
-
83
- == Contact
84
-
85
- OAuth Ruby has been created and maintained by a large number of talented individuals.
86
- The current maintainer is Aaron Quint (quirkey).
87
-
88
- Comments are welcome. Send an email to via the OAuth Ruby mailing list http://groups.google.com/group/oauth-ruby