oauth 0.5.5 → 0.5.6

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: 56561f5f687d933f2683b93c5d7a426c3202da9b6659cc69d8ef43c36766bb9b
4
- data.tar.gz: 71d7d2890d9b2261b85752ba2844eb96d7538a5121b9b72bcef3d00347e91bcf
3
+ metadata.gz: 9bd785e08f2a318da373f07b79fe6583ed3e8c26bcc92c5e1513ee615ea0f037
4
+ data.tar.gz: 3e9f81feb37166f4fec398d20e8b4de882b6e1e2304f893c033b920ab737616a
5
5
  SHA512:
6
- metadata.gz: 4bbb7ec6242a2fdeadcae61c5279d42e00d9b29318511b80ea5a0215b8cdfba15c10be2ef0abb74bb21038acff22e27ef59125a8148ab28817f79d89b792707d
7
- data.tar.gz: 3ad73ee2f52bf3507b274e923fe2352f7e5cda860e8765a9b062f33abfbc61909e5ff15ced0ce7d5aa66489f002f056f2fbb720f70b179c6eb729c52b7ce76e1
6
+ metadata.gz: 6bc060045ecb7ca1c47263f4bab7fde62c3a173ccf7ea6e1dacc5ac4e814ecea88e4b2f594f6bd2a7d80f9393e1295b1a5cbc85f3eb74c35cbb348da6f32cfe6
7
+ data.tar.gz: c96c9abd68f71cca8d33db21e3d68f1c7fe98898dba924fd440bf882280d99d39beb7a0751be913bb0f18872875ca8098792733f1717ff8d127156a99a69f039
data/README.rdoc CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  == Status
4
4
 
5
- {<img src="https://travis-ci.org/oauth-xx/oauth-ruby.svg?branch=master" alt="Build Status" />}[https://travis-ci.org/oauth-xx/oauth-ruby]
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
6
 
7
7
 
8
8
 
@@ -48,7 +48,7 @@ When user returns create an access_token
48
48
  request_token = OAuth::RequestToken.from_hash(oauth_consumer, hash)
49
49
  access_token = request_token.get_access_token
50
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])
51
+ # access_token = request_token.get_access_token(oauth_verifier: params[:oauth_verifier])
52
52
  @photos = access_token.get('/photos.xml')
53
53
 
54
54
  Now that you have an access token, you can use Typhoeus to interact with the OAuth provider if you choose.
data/lib/oauth.rb CHANGED
@@ -7,5 +7,6 @@ require 'oauth/oauth'
7
7
 
8
8
  require 'oauth/client/helper'
9
9
  require 'oauth/signature/hmac/sha1'
10
+ require 'oauth/signature/hmac/sha256'
10
11
  require 'oauth/signature/rsa/sha1'
11
12
  require 'oauth/request_proxy/mock_request'
@@ -371,7 +371,7 @@ module OAuth
371
371
  http_object.verify_depth = 5
372
372
  end
373
373
 
374
- http_object.read_timeout = http_object.open_timeout = @options[:timeout] || 30
374
+ http_object.read_timeout = http_object.open_timeout = @options[:timeout] || 60
375
375
  http_object.open_timeout = @options[:open_timeout] if @options[:open_timeout]
376
376
  http_object.ssl_version = @options[:ssl_version] if @options[:ssl_version]
377
377
  http_object.set_debug_output(debug_output) if debug_output
@@ -60,7 +60,7 @@ module OAuth::RequestProxy
60
60
  params << header_params.to_query
61
61
  params << request.query_string unless query_string_blank?
62
62
 
63
- if request.post? && request.content_type.to_s.downcase.start_with?("application/x-www-form-urlencoded")
63
+ if raw_post_signature?
64
64
  params << request.raw_post
65
65
  end
66
66
  end
@@ -72,6 +72,10 @@ module OAuth::RequestProxy
72
72
  reject { |kv| kv[0] == 'oauth_signature'}
73
73
  end
74
74
 
75
+ def raw_post_signature?
76
+ (request.post? || request.put?) && request.content_type.to_s.downcase.start_with?("application/x-www-form-urlencoded")
77
+ end
78
+
75
79
  protected
76
80
 
77
81
  def query_params
@@ -0,0 +1,17 @@
1
+ require 'oauth/signature/base'
2
+
3
+ module OAuth::Signature::HMAC
4
+ class SHA256 < OAuth::Signature::Base
5
+ implements 'hmac-sha256'
6
+
7
+ def body_hash
8
+ Base64.encode64(OpenSSL::Digest::SHA256.digest(request.body || '')).chomp.gsub(/\n/,'')
9
+ end
10
+
11
+ private
12
+
13
+ def digest
14
+ OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha256'), secret, signature_base_string)
15
+ end
16
+ end
17
+ end
data/lib/oauth/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module OAuth
2
- VERSION = "0.5.5"
2
+ VERSION = "0.5.6"
3
3
  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.5
4
+ version: 0.5.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pelle Braendgaard
@@ -12,10 +12,10 @@ authors:
12
12
  - Seth Fitzsimmons
13
13
  - Matt Sanford
14
14
  - Aaron Quint
15
- autorequire:
15
+ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
- date: 2021-01-20 00:00:00.000000000 Z
18
+ date: 2021-04-02 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: rake
@@ -233,7 +233,7 @@ dependencies:
233
233
  - - ">="
234
234
  - !ruby/object:Gem::Version
235
235
  version: '0'
236
- description:
236
+ description:
237
237
  email: oauth-ruby@googlegroupspec.com
238
238
  executables:
239
239
  - oauth
@@ -284,6 +284,7 @@ files:
284
284
  - lib/oauth/signature.rb
285
285
  - lib/oauth/signature/base.rb
286
286
  - lib/oauth/signature/hmac/sha1.rb
287
+ - lib/oauth/signature/hmac/sha256.rb
287
288
  - lib/oauth/signature/plaintext.rb
288
289
  - lib/oauth/signature/rsa/sha1.rb
289
290
  - lib/oauth/token.rb
@@ -293,11 +294,16 @@ files:
293
294
  - lib/oauth/tokens/server_token.rb
294
295
  - lib/oauth/tokens/token.rb
295
296
  - lib/oauth/version.rb
296
- homepage:
297
+ homepage: https://github.com/oauth-xx/oauth-ruby
297
298
  licenses:
298
299
  - MIT
299
- metadata: {}
300
- post_install_message:
300
+ 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
+ homepage_uri: https://github.com/oauth-xx/oauth-ruby
305
+ source_code_uri: https://github.com/oauth-xx/oauth-ruby
306
+ post_install_message:
301
307
  rdoc_options: []
302
308
  require_paths:
303
309
  - lib
@@ -312,8 +318,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
312
318
  - !ruby/object:Gem::Version
313
319
  version: '0'
314
320
  requirements: []
315
- rubygems_version: 3.0.8
316
- signing_key:
321
+ rubygems_version: 3.0.3
322
+ signing_key:
317
323
  specification_version: 4
318
324
  summary: OAuth Core Ruby implementation
319
325
  test_files: []