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.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/CHANGELOG.md +263 -225
  4. data/CITATION.cff +0 -0
  5. data/CODE_OF_CONDUCT.md +0 -0
  6. data/CONTRIBUTING.md +12 -23
  7. data/FUNDING.md +2 -2
  8. data/LICENSE.txt +0 -0
  9. data/README.md +27 -23
  10. data/REEK +2 -0
  11. data/RUBOCOP.md +0 -0
  12. data/SECURITY.md +5 -23
  13. data/lib/oauth/client/action_controller_request.rb +8 -4
  14. data/lib/oauth/client/em_http.rb +0 -0
  15. data/lib/oauth/client/helper.rb +0 -0
  16. data/lib/oauth/client/net_http.rb +0 -0
  17. data/lib/oauth/client.rb +0 -0
  18. data/lib/oauth/consumer.rb +22 -6
  19. data/lib/oauth/errors/error.rb +0 -0
  20. data/lib/oauth/errors/problem.rb +0 -0
  21. data/lib/oauth/errors/unauthorized.rb +0 -0
  22. data/lib/oauth/errors.rb +0 -0
  23. data/lib/oauth/helper.rb +0 -0
  24. data/lib/oauth/oauth.rb +0 -0
  25. data/lib/oauth/oauth_test_helper.rb +0 -0
  26. data/lib/oauth/optional.rb +0 -0
  27. data/lib/oauth/request_proxy/action_controller_request.rb +0 -0
  28. data/lib/oauth/request_proxy/action_dispatch_request.rb +0 -7
  29. data/lib/oauth/request_proxy/base.rb +23 -15
  30. data/lib/oauth/request_proxy/curb_request.rb +0 -0
  31. data/lib/oauth/request_proxy/em_http_request.rb +0 -0
  32. data/lib/oauth/request_proxy/jabber_request.rb +0 -0
  33. data/lib/oauth/request_proxy/mock_request.rb +0 -0
  34. data/lib/oauth/request_proxy/net_http.rb +0 -0
  35. data/lib/oauth/request_proxy/rack_request.rb +0 -4
  36. data/lib/oauth/request_proxy/rest_client_request.rb +0 -0
  37. data/lib/oauth/request_proxy/typhoeus_request.rb +0 -0
  38. data/lib/oauth/request_proxy.rb +17 -13
  39. data/lib/oauth/server.rb +0 -0
  40. data/lib/oauth/signature/base.rb +14 -4
  41. data/lib/oauth/signature/hmac/sha1.rb +0 -0
  42. data/lib/oauth/signature/hmac/sha256.rb +0 -0
  43. data/lib/oauth/signature/plaintext.rb +0 -0
  44. data/lib/oauth/signature/rsa/sha1.rb +0 -0
  45. data/lib/oauth/signature.rb +43 -39
  46. data/lib/oauth/token.rb +0 -0
  47. data/lib/oauth/tokens/access_token.rb +0 -0
  48. data/lib/oauth/tokens/consumer_token.rb +6 -4
  49. data/lib/oauth/tokens/request_token.rb +0 -0
  50. data/lib/oauth/tokens/server_token.rb +0 -0
  51. data/lib/oauth/tokens/token.rb +13 -1
  52. data/lib/oauth/version.rb +2 -1
  53. data/lib/oauth.rb +1 -0
  54. data/sig/oauth/consumer.rbs +9 -0
  55. data/sig/oauth/signature/base.rbs +12 -0
  56. data/sig/oauth/tokens/token.rbs +8 -0
  57. data.tar.gz.sig +0 -0
  58. metadata +72 -32
  59. metadata.gz.sig +0 -0
File without changes
File without changes
File without changes
@@ -2,45 +2,49 @@
2
2
 
3
3
  module OAuth
4
4
  module Signature
5
- # Returns a list of available signature methods
6
- def self.available_methods
7
- @available_methods ||= {}
8
- end
9
-
10
- # Build a signature from a +request+.
11
- #
12
- # Raises UnknownSignatureMethod exception if the signature method is unknown.
13
- def self.build(request, options = {}, &block)
14
- request = OAuth::RequestProxy.proxy(request, options)
15
- klass = available_methods[
16
- (request.signature_method ||
17
- ((c = request.options[:consumer]) && c.options[:signature_method]) ||
18
- "").downcase]
19
- raise UnknownSignatureMethod, request.signature_method unless klass
20
-
21
- klass.new(request, options, &block)
22
- end
23
-
24
- # Sign a +request+
25
- def self.sign(request, options = {}, &block)
26
- build(request, options, &block).signature
27
- end
28
-
29
- # Verify the signature of +request+
30
- def self.verify(request, options = {}, &block)
31
- build(request, options, &block).verify
32
- end
33
-
34
- # Create the signature base string for +request+. This string is the normalized parameter information.
35
- #
36
- # See Also: {OAuth core spec version 1.0, section 9.1.1}[http://oauth.net/core/1.0#rfc.section.9.1.1]
37
- def self.signature_base_string(request, options = {}, &block)
38
- build(request, options, &block).signature_base_string
39
- end
40
-
41
- # Create the body hash for a request
42
- def self.body_hash(request, options = {}, &block)
43
- build(request, options, &block).body_hash
5
+ AVAILABLE_METHODS = {}
6
+
7
+ class << self
8
+ # Returns a list of available signature methods
9
+ def available_methods
10
+ AVAILABLE_METHODS
11
+ end
12
+
13
+ # Build a signature from a +request+.
14
+ #
15
+ # Raises UnknownSignatureMethod exception if the signature method is unknown.
16
+ def build(request, options = {}, &block)
17
+ request = OAuth::RequestProxy.proxy(request, options)
18
+ klass = available_methods[
19
+ (request.signature_method ||
20
+ ((c = request.options[:consumer]) && c.options[:signature_method]) ||
21
+ "").downcase]
22
+ raise UnknownSignatureMethod, request.signature_method unless klass
23
+
24
+ klass.new(request, options, &block)
25
+ end
26
+
27
+ # Sign a +request+
28
+ def sign(request, options = {}, &block)
29
+ build(request, options, &block).signature
30
+ end
31
+
32
+ # Verify the signature of +request+
33
+ def verify(request, options = {}, &block)
34
+ build(request, options, &block).verify
35
+ end
36
+
37
+ # Create the signature base string for +request+. This string is the normalized parameter information.
38
+ #
39
+ # See Also: {OAuth core spec version 1.0, section 9.1.1}[http://oauth.net/core/1.0#rfc.section.9.1.1]
40
+ def signature_base_string(request, options = {}, &block)
41
+ build(request, options, &block).signature_base_string
42
+ end
43
+
44
+ # Create the body hash for a request
45
+ def body_hash(request, options = {}, &block)
46
+ build(request, options, &block).body_hash
47
+ end
44
48
  end
45
49
 
46
50
  class UnknownSignatureMethod < RuntimeError; end
data/lib/oauth/token.rb CHANGED
File without changes
File without changes
@@ -6,10 +6,12 @@ module OAuth
6
6
  attr_accessor :consumer, :params
7
7
  attr_reader :response
8
8
 
9
- def self.from_hash(consumer, hash)
10
- token = new(consumer, hash[:oauth_token], hash[:oauth_token_secret])
11
- token.params = hash
12
- token
9
+ class << self
10
+ def from_hash(consumer, hash)
11
+ token = new(consumer, hash[:oauth_token], hash[:oauth_token_secret])
12
+ token.params = hash
13
+ token
14
+ end
13
15
  end
14
16
 
15
17
  def initialize(consumer, token = "", secret = "")
File without changes
File without changes
@@ -1,11 +1,23 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OAuth
4
- # Superclass for the various tokens used by OAuth
4
+ # Superclass for the various tokens used by OAuth.
5
+ #
6
+ # Includes {Auth::Sanitizer::FilteredAttributes} so inspect output redacts the
7
+ # token value and token secret while leaving object identity and non-sensitive
8
+ # fields visible.
5
9
  class Token
6
10
  include OAuth::Helper
11
+ include Auth::Sanitizer::FilteredAttributes
7
12
 
13
+ # Token attributes.
14
+ #
15
+ # @!attribute [rw] token
16
+ # @return [String] OAuth token value (redacted in `#inspect`)
17
+ # @!attribute [rw] secret
18
+ # @return [String] OAuth token secret (redacted in `#inspect`)
8
19
  attr_accessor :token, :secret
20
+ filtered_attributes :token, :secret
9
21
 
10
22
  def initialize(token, secret)
11
23
  @token = token
data/lib/oauth/version.rb CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  module OAuth
4
4
  module Version
5
- VERSION = "1.1.2"
5
+ VERSION = "1.1.4"
6
6
  end
7
+ VERSION = Version::VERSION # Traditional Constant Location
7
8
  end
data/lib/oauth.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # third party gems
4
+ require "auth/sanitizer"
4
5
  require "snaky_hash"
5
6
  require "version_gem"
6
7
 
@@ -0,0 +1,9 @@
1
+ module OAuth
2
+ class Consumer
3
+ include Auth::Sanitizer::FilteredAttributes
4
+
5
+ attr_accessor options: untyped
6
+ attr_accessor key: untyped
7
+ attr_accessor secret: untyped
8
+ end
9
+ end
@@ -0,0 +1,12 @@
1
+ module OAuth
2
+ module Signature
3
+ class Base
4
+ include Auth::Sanitizer::FilteredAttributes
5
+
6
+ attr_accessor options: untyped
7
+ attr_reader token_secret: untyped
8
+ attr_reader consumer_secret: untyped
9
+ attr_reader request: untyped
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,8 @@
1
+ module OAuth
2
+ class Token
3
+ include Auth::Sanitizer::FilteredAttributes
4
+
5
+ attr_accessor token: untyped
6
+ attr_accessor secret: untyped
7
+ end
8
+ end
data.tar.gz.sig CHANGED
Binary file
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: 1.1.2
4
+ version: 1.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pelle Braendgaard
@@ -13,7 +13,6 @@ authors:
13
13
  - Matt Sanford
14
14
  - Aaron Quint
15
15
  - Peter Boling
16
- autorequire:
17
16
  bindir: bin
18
17
  cert_chain:
19
18
  - |
@@ -44,8 +43,28 @@ cert_chain:
44
43
  DVjBtqT23eugOqQ73umLcYDZkc36vnqGxUBSsXrzY9pzV5gGr2I8YUxMqf6ATrZt
45
44
  L9nRqA==
46
45
  -----END CERTIFICATE-----
47
- date: 2025-09-22 00:00:00.000000000 Z
46
+ date: 1980-01-02 00:00:00.000000000 Z
48
47
  dependencies:
48
+ - !ruby/object:Gem::Dependency
49
+ name: auth-sanitizer
50
+ requirement: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '0.1'
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: 0.1.2
58
+ type: :runtime
59
+ prerelease: false
60
+ version_requirements: !ruby/object:Gem::Requirement
61
+ requirements:
62
+ - - "~>"
63
+ - !ruby/object:Gem::Version
64
+ version: '0.1'
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: 0.1.2
49
68
  - !ruby/object:Gem::Dependency
50
69
  name: oauth-tty
51
70
  requirement: !ruby/object:Gem::Requirement
@@ -55,7 +74,7 @@ dependencies:
55
74
  version: '1.0'
56
75
  - - ">="
57
76
  - !ruby/object:Gem::Version
58
- version: 1.0.6
77
+ version: 1.0.7
59
78
  type: :runtime
60
79
  prerelease: false
61
80
  version_requirements: !ruby/object:Gem::Requirement
@@ -65,7 +84,7 @@ dependencies:
65
84
  version: '1.0'
66
85
  - - ">="
67
86
  - !ruby/object:Gem::Version
68
- version: 1.0.6
87
+ version: 1.0.7
69
88
  - !ruby/object:Gem::Dependency
70
89
  name: snaky_hash
71
90
  requirement: !ruby/object:Gem::Requirement
@@ -73,6 +92,9 @@ dependencies:
73
92
  - - "~>"
74
93
  - !ruby/object:Gem::Version
75
94
  version: '2.0'
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ version: 2.0.4
76
98
  type: :runtime
77
99
  prerelease: false
78
100
  version_requirements: !ruby/object:Gem::Requirement
@@ -80,6 +102,37 @@ dependencies:
80
102
  - - "~>"
81
103
  - !ruby/object:Gem::Version
82
104
  version: '2.0'
105
+ - - ">="
106
+ - !ruby/object:Gem::Version
107
+ version: 2.0.4
108
+ - !ruby/object:Gem::Dependency
109
+ name: base64
110
+ requirement: !ruby/object:Gem::Requirement
111
+ requirements:
112
+ - - "~>"
113
+ - !ruby/object:Gem::Version
114
+ version: '0.1'
115
+ type: :runtime
116
+ prerelease: false
117
+ version_requirements: !ruby/object:Gem::Requirement
118
+ requirements:
119
+ - - "~>"
120
+ - !ruby/object:Gem::Version
121
+ version: '0.1'
122
+ - !ruby/object:Gem::Dependency
123
+ name: cgi
124
+ requirement: !ruby/object:Gem::Requirement
125
+ requirements:
126
+ - - ">="
127
+ - !ruby/object:Gem::Version
128
+ version: '0'
129
+ type: :runtime
130
+ prerelease: false
131
+ version_requirements: !ruby/object:Gem::Requirement
132
+ requirements:
133
+ - - ">="
134
+ - !ruby/object:Gem::Version
135
+ version: '0'
83
136
  - !ruby/object:Gem::Dependency
84
137
  name: version_gem
85
138
  requirement: !ruby/object:Gem::Requirement
@@ -176,28 +229,28 @@ dependencies:
176
229
  requirements:
177
230
  - - "~>"
178
231
  - !ruby/object:Gem::Version
179
- version: '1.1'
232
+ version: '2.0'
180
233
  type: :development
181
234
  prerelease: false
182
235
  version_requirements: !ruby/object:Gem::Requirement
183
236
  requirements:
184
237
  - - "~>"
185
238
  - !ruby/object:Gem::Version
186
- version: '1.1'
239
+ version: '2.0'
187
240
  - !ruby/object:Gem::Dependency
188
241
  name: bundler-audit
189
242
  requirement: !ruby/object:Gem::Requirement
190
243
  requirements:
191
244
  - - "~>"
192
245
  - !ruby/object:Gem::Version
193
- version: 0.9.2
246
+ version: 0.9.3
194
247
  type: :development
195
248
  prerelease: false
196
249
  version_requirements: !ruby/object:Gem::Requirement
197
250
  requirements:
198
251
  - - "~>"
199
252
  - !ruby/object:Gem::Version
200
- version: 0.9.2
253
+ version: 0.9.3
201
254
  - !ruby/object:Gem::Dependency
202
255
  name: rake
203
256
  requirement: !ruby/object:Gem::Requirement
@@ -253,33 +306,19 @@ dependencies:
253
306
  - - "~>"
254
307
  - !ruby/object:Gem::Version
255
308
  version: '1.0'
256
- type: :development
257
- prerelease: false
258
- version_requirements: !ruby/object:Gem::Requirement
259
- requirements:
260
- - - "~>"
261
- - !ruby/object:Gem::Version
262
- version: '1.0'
263
- - !ruby/object:Gem::Dependency
264
- name: rspec-pending_for
265
- requirement: !ruby/object:Gem::Requirement
266
- requirements:
267
- - - "~>"
268
- - !ruby/object:Gem::Version
269
- version: '0.0'
270
309
  - - ">="
271
310
  - !ruby/object:Gem::Version
272
- version: 0.0.17
311
+ version: 1.0.6
273
312
  type: :development
274
313
  prerelease: false
275
314
  version_requirements: !ruby/object:Gem::Requirement
276
315
  requirements:
277
316
  - - "~>"
278
317
  - !ruby/object:Gem::Version
279
- version: '0.0'
318
+ version: '1.0'
280
319
  - - ">="
281
320
  - !ruby/object:Gem::Version
282
- version: 0.0.17
321
+ version: 1.0.6
283
322
  - !ruby/object:Gem::Dependency
284
323
  name: ruby-progressbar
285
324
  requirement: !ruby/object:Gem::Requirement
@@ -451,22 +490,24 @@ files:
451
490
  - lib/oauth/tokens/server_token.rb
452
491
  - lib/oauth/tokens/token.rb
453
492
  - lib/oauth/version.rb
493
+ - sig/oauth/consumer.rbs
494
+ - sig/oauth/signature/base.rbs
495
+ - sig/oauth/tokens/token.rbs
454
496
  homepage: https://github.com/ruby-oauth/oauth
455
497
  licenses:
456
498
  - MIT
457
499
  metadata:
458
500
  homepage_uri: https://oauth.galtzo.com/
459
- source_code_uri: https://github.com/ruby-oauth/oauth/tree/v1.1.2
460
- changelog_uri: https://github.com/ruby-oauth/oauth/blob/v1.1.2/CHANGELOG.md
501
+ source_code_uri: https://github.com/ruby-oauth/oauth/tree/v1.1.4
502
+ changelog_uri: https://github.com/ruby-oauth/oauth/blob/v1.1.4/CHANGELOG.md
461
503
  bug_tracker_uri: https://github.com/ruby-oauth/oauth/issues
462
- documentation_uri: https://www.rubydoc.info/gems/oauth/1.1.2
504
+ documentation_uri: https://www.rubydoc.info/gems/oauth/1.1.4
463
505
  mailing_list_uri: https://groups.google.com/g/oauth-ruby
464
506
  funding_uri: https://github.com/sponsors/pboling
465
507
  wiki_uri: https://gitlab.com/ruby-oauth/oauth/-/wiki
466
508
  news_uri: https://www.railsbling.com/tags/oauth
467
509
  discord_uri: https://discord.gg/3qme4XHNKN
468
510
  rubygems_mfa_required: 'true'
469
- post_install_message:
470
511
  rdoc_options:
471
512
  - "--title"
472
513
  - "oauth - \U0001F511 OAuth 1.0 / 1.0a Core Ruby implementation"
@@ -490,8 +531,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
490
531
  - !ruby/object:Gem::Version
491
532
  version: '0'
492
533
  requirements: []
493
- rubygems_version: 3.5.22
494
- signing_key:
534
+ rubygems_version: 4.0.11
495
535
  specification_version: 4
496
536
  summary: "\U0001F511 OAuth 1.0 / 1.0a Core Ruby implementation"
497
537
  test_files: []
metadata.gz.sig CHANGED
Binary file