oauth 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of oauth might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5b45dc41aae4a7483d4dc3f37231ed79084a7c8e
4
- data.tar.gz: c82a432eb7f1a7ab2cb704eedd1ae9da15daed2c
3
+ metadata.gz: 4e52bba31bed6b4a6bb18b934ce067a3e5a5f9c0
4
+ data.tar.gz: 0c64d7eec3f2ff1e1d257b9762b93fe30512032b
5
5
  SHA512:
6
- metadata.gz: 6b3a8ebb69c99d98762a66ddaec9074ee6161824405f04dab2d057e8059fa6cb298985c951479980c41800508a11edbc439a38602e39384add3c2a9424be8975
7
- data.tar.gz: 65f7255a19a1def380575faa1a97d95ec78821fcf687ff8f914a10d367dcc6e05d1681e4a7b9106973e5a50618457e35d8c1b07adbf21919e668345ca18143ab
6
+ metadata.gz: ab1329b4b6a666b9eb80b46337727beeb1b2825f3358fc9647e5dda57c3a1c3fe2f6e9a427f8672dca7ae36d11b6aabb6278891f56b6a13ff4fa2f26aee3d023
7
+ data.tar.gz: 2c871f1404d9c02457ac3a08becf5a6e8e56c9e68f3a15b3bfbd9841a23a9f7d6ce2d808a921f68ffb51454861e990305998c430c3c197b2233e5fd17cc4d65d
@@ -67,7 +67,7 @@ module OAuth::RequestProxy
67
67
 
68
68
  params.
69
69
  join('&').split('&').
70
- reject(&:blank?).
70
+ reject { |s| s.match(/\A\s*\z/) }.
71
71
  map { |p| p.split('=').map{|esc| CGI.unescape(esc)} }.
72
72
  reject { |kv| kv[0] == 'oauth_signature'}
73
73
  end
@@ -146,7 +146,7 @@ module OAuth::RequestProxy
146
146
  if uri = request.env['REQUEST_URI']
147
147
  uri.split('?', 2)[1].nil?
148
148
  else
149
- request.query_string.blank?
149
+ request.query_string.match(/\A\s*\z/)
150
150
  end
151
151
  end
152
152
 
@@ -26,11 +26,11 @@ module OAuth
26
26
  # construct an authorization url
27
27
  def build_authorize_url(base_url, params)
28
28
  uri = URI.parse(base_url.to_s)
29
- if(!uri.query.blank? && !params.empty?)
30
- uri.query += "&"
31
- end
29
+ queries = {}
30
+ queries = Hash[URI.decode_www_form(uri.query)] if uri.query
32
31
  # TODO doesn't handle array values correctly
33
- uri.query = params.map { |k,v| [k, CGI.escape(v)] * "=" } * "&"
32
+ queries.merge!(params) if params
33
+ uri.query = URI.encode_www_form(queries) if !queries.empty?
34
34
  uri.to_s
35
35
  end
36
36
  end
@@ -1,3 +1,3 @@
1
1
  module OAuth
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.1"
3
3
  end
@@ -27,13 +27,13 @@ require File.expand_path('../../../oauth_case', __FILE__)
27
27
  class NormalizeRequestParametersTest < OAuthCase
28
28
 
29
29
  def test_parameters_for_signature
30
- params={'a'=>1, 'c'=>'hi there', 'f'=>'25', 'f'=>'50', 'f'=>'a', 'z'=>'p', 'z'=>'t'}
30
+ params={"a"=>1, "c"=>"hi there", "f"=>"a", "z"=>"t"}
31
31
  assert_equal params,request(params).parameters_for_signature
32
32
  end
33
33
 
34
34
 
35
35
  def test_parameters_for_signature_removes_oauth_signature
36
- params={'a'=>1, 'c'=>'hi there', 'f'=>'25', 'f'=>'50', 'f'=>'a', 'z'=>'p', 'z'=>'t'}
36
+ params={"a"=>1, "c"=>"hi there", "f"=>"a", "z"=>"t"}
37
37
  assert_equal params,request(params.merge({'oauth_signature'=>'blalbla'})).parameters_for_signature
38
38
  end
39
39
 
@@ -291,6 +291,10 @@ class NetHTTPClientTest < Minitest::Test
291
291
 
292
292
  protected
293
293
 
294
+ def assert_no_match exp, act, msg = "Expected #{act.inspect} to not match #{exp.inspect}"
295
+ assert act !~ exp, msg
296
+ end
297
+
294
298
  def request_parameters_to_s
295
299
  @request_parameters.map { |k,v| "#{k}=#{v}" }.join("&")
296
300
  end
@@ -3,9 +3,9 @@ require File.expand_path('../test_helper', __FILE__)
3
3
  begin
4
4
  require 'oauth/request_proxy/rest_client_request'
5
5
  require 'rest-client'
6
-
7
- class RestlClientRequestProxyTest < Test::Unit::TestCase
8
-
6
+
7
+ class RestlClientRequestProxyTest < Minitest::Test
8
+
9
9
  def test_that_proxy_simple_get_request_works
10
10
  request = ::RestClient::Request.new(method: :get, url: "http://example.com/test?key=value")
11
11
  request_proxy = OAuth::RequestProxy.proxy(request, {:uri => 'http://example.com/test?key=value'})
@@ -15,7 +15,7 @@ begin
15
15
  assert_equal 'http://example.com/test', request_proxy.normalized_uri
16
16
  assert_equal 'GET', request_proxy.method
17
17
  end
18
-
18
+
19
19
  def test_that_proxy_simple_post_request_works_with_arguments
20
20
  request = ::RestClient::Request.new(method: :post, url: "http://example.com/test")
21
21
  params = {'key' => 'value'}
@@ -26,7 +26,7 @@ begin
26
26
  assert_equal 'http://example.com/test', request_proxy.normalized_uri
27
27
  assert_equal 'POST', request_proxy.method
28
28
  end
29
-
29
+
30
30
  def test_that_proxy_simple_post_request_works_with_form_data
31
31
  request = ::RestClient::Request.new(method: :post, url: "http://example.com/test",
32
32
  payload: {'key' => 'value'},
@@ -38,7 +38,7 @@ begin
38
38
  assert_equal 'http://example.com/test', request_proxy.normalized_uri
39
39
  assert_equal 'POST', request_proxy.method
40
40
  end
41
-
41
+
42
42
  def test_that_proxy_simple_put_request_works_with_arguments
43
43
  request = ::RestClient::Request.new(method: :put, url: "http://example.com/test")
44
44
  params = {'key' => 'value'}
@@ -49,7 +49,7 @@ begin
49
49
  assert_equal 'http://example.com/test', request_proxy.normalized_uri
50
50
  assert_equal 'PUT', request_proxy.method
51
51
  end
52
-
52
+
53
53
  def test_that_proxy_simple_put_request_works_with_form_data
54
54
  request = ::RestClient::Request.new(method: :put, url: "http://example.com/test",
55
55
  payload: {'key' => 'value'},
@@ -61,7 +61,7 @@ begin
61
61
  assert_equal 'http://example.com/test', request_proxy.normalized_uri
62
62
  assert_equal 'PUT', request_proxy.method
63
63
  end
64
-
64
+
65
65
  def test_that_proxy_post_request_works_with_mixed_parameter_sources
66
66
  request = ::RestClient::Request.new(url: 'http://example.com/test?key=value',
67
67
  method: :post,
@@ -74,8 +74,8 @@ begin
74
74
  assert_equal 'http://example.com/test', request_proxy.normalized_uri
75
75
  assert_equal 'POST', request_proxy.method
76
76
  end
77
-
77
+
78
78
  end
79
79
  rescue LoadError => e
80
80
  warn "! problem loading rest-client, skipping these tests: #{e}"
81
- end
81
+ end
@@ -1,7 +1,7 @@
1
1
  require File.expand_path('../test_helper', __FILE__)
2
2
  require 'oauth/signature/hmac/sha1'
3
3
 
4
- class SignatureHMACSHA1Test < Test::Unit::TestCase
4
+ class SignatureHMACSHA1Test < Minitest::Test
5
5
  def test_that_verify_returns_true_when_the_request_signature_is_right
6
6
  request = OAuth::RequestProxy::MockRequest.new(
7
7
  'method' => 'POST',
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.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pelle Braendgaard
@@ -15,7 +15,7 @@ authors:
15
15
  autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
- date: 2016-02-20 00:00:00.000000000 Z
18
+ date: 2016-02-29 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: rake
@@ -59,20 +59,6 @@ dependencies:
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
- - !ruby/object:Gem::Dependency
63
- name: jeweler
64
- requirement: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
- type: :development
70
- prerelease: false
71
- version_requirements: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: '0'
76
62
  - !ruby/object:Gem::Dependency
77
63
  name: actionpack
78
64
  requirement: !ruby/object:Gem::Requirement
@@ -91,30 +77,30 @@ dependencies:
91
77
  name: iconv
92
78
  requirement: !ruby/object:Gem::Requirement
93
79
  requirements:
94
- - - "~>"
80
+ - - ">="
95
81
  - !ruby/object:Gem::Version
96
- version: 1.0.3
82
+ version: '0'
97
83
  type: :development
98
84
  prerelease: false
99
85
  version_requirements: !ruby/object:Gem::Requirement
100
86
  requirements:
101
- - - "~>"
87
+ - - ">="
102
88
  - !ruby/object:Gem::Version
103
- version: 1.0.3
89
+ version: '0'
104
90
  - !ruby/object:Gem::Dependency
105
91
  name: rack
106
92
  requirement: !ruby/object:Gem::Requirement
107
93
  requirements:
108
- - - "~>"
94
+ - - ">="
109
95
  - !ruby/object:Gem::Version
110
- version: 1.6.1
96
+ version: '0'
111
97
  type: :development
112
98
  prerelease: false
113
99
  version_requirements: !ruby/object:Gem::Requirement
114
100
  requirements:
115
- - - "~>"
101
+ - - ">="
116
102
  - !ruby/object:Gem::Version
117
- version: 1.6.1
103
+ version: '0'
118
104
  - !ruby/object:Gem::Dependency
119
105
  name: rack-test
120
106
  requirement: !ruby/object:Gem::Requirement
@@ -175,16 +161,16 @@ dependencies:
175
161
  name: curb
176
162
  requirement: !ruby/object:Gem::Requirement
177
163
  requirements:
178
- - - '='
164
+ - - ">="
179
165
  - !ruby/object:Gem::Version
180
- version: 0.7.16
166
+ version: '0'
181
167
  type: :development
182
168
  prerelease: false
183
169
  version_requirements: !ruby/object:Gem::Requirement
184
170
  requirements:
185
- - - '='
171
+ - - ">="
186
172
  - !ruby/object:Gem::Version
187
- version: 0.7.16
173
+ version: '0'
188
174
  description:
189
175
  email: oauth-ruby@googlegroupspec.com
190
176
  executables:
@@ -268,7 +254,8 @@ files:
268
254
  - test/test_token.rb
269
255
  - test/test_typhoeus_request_proxy.rb
270
256
  homepage:
271
- licenses: []
257
+ licenses:
258
+ - MIT
272
259
  metadata: {}
273
260
  post_install_message:
274
261
  rdoc_options: []