oauth 0.4.6 → 0.4.7

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.

data/HISTORY CHANGED
@@ -1,3 +1,9 @@
1
+ === 0.4.7 2012-09-03
2
+
3
+ * Fix merging paths if the path is not empty
4
+ * Set a configurable timeout for all requests (Rick Olson)
5
+ * Fix nested hash params in Consumer#request (Ernie Miller)
6
+
1
7
  === 0.4.6 2012-04-21
2
8
 
3
9
  * Fixed nested attributes in #normalize (Shaliko Usubov)
@@ -1,7 +1,7 @@
1
1
  $LOAD_PATH << File.dirname(__FILE__) unless $LOAD_PATH.include?(File.dirname(__FILE__))
2
2
 
3
3
  module OAuth
4
- VERSION = "0.4.6"
4
+ VERSION = "0.4.7"
5
5
  end
6
6
 
7
7
  require 'oauth/oauth'
@@ -317,6 +317,10 @@ module OAuth
317
317
  else
318
318
  http_object.verify_mode = OpenSSL::SSL::VERIFY_NONE
319
319
  end
320
+
321
+ http_object.read_timeout = http_object.open_timeout = @options[:timeout] || 30
322
+ http_object.open_timeout = @options[:open_timeout] if @options[:open_timeout]
323
+
320
324
  http_object
321
325
  end
322
326
 
@@ -330,7 +334,7 @@ module OAuth
330
334
 
331
335
  # if the base site contains a path, add it now
332
336
  uri = URI.parse(site)
333
- path = uri.path + path if uri.path
337
+ path = uri.path + path if uri.path && uri.path != '/'
334
338
 
335
339
  headers = arguments.first.is_a?(Hash) ? arguments.shift : {}
336
340
 
@@ -352,9 +356,8 @@ module OAuth
352
356
  end
353
357
 
354
358
  if data.is_a?(Hash)
355
- form_data = {}
356
- data.each {|k,v| form_data[k.to_s] = v if !v.nil?}
357
- request.set_form_data(form_data)
359
+ request.body = OAuth::Helper.normalize(data)
360
+ request.content_type = 'application/x-www-form-urlencoded'
358
361
  elsif data
359
362
  if data.respond_to?(:read)
360
363
  request.body_stream = data
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "oauth"
8
- s.version = "0.4.6"
8
+ s.version = "0.4.7"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Pelle Braendgaard", "Blaine Cook", "Larry Halff", "Jesse Clark", "Jon Crosby", "Seth Fitzsimmons", "Matt Sanford", "Aaron Quint"]
12
- s.date = "2012-04-21"
12
+ s.date = "2012-09-04"
13
13
  s.description = "OAuth Core Ruby implementation"
14
14
  s.email = "oauth-ruby@googlegroups.com"
15
15
  s.executables = ["oauth"]
@@ -109,7 +109,7 @@ Gem::Specification.new do |s|
109
109
  ]
110
110
  s.require_paths = ["lib"]
111
111
  s.rubyforge_project = "oauth"
112
- s.rubygems_version = "1.8.16"
112
+ s.rubygems_version = "1.8.23"
113
113
  s.summary = "OAuth Core Ruby implementation"
114
114
 
115
115
  if s.respond_to? :specification_version then
@@ -89,6 +89,27 @@ class ConsumerTest < Test::Unit::TestCase
89
89
  @consumer.request(:get, '/people', nil, {})
90
90
  end
91
91
 
92
+ def test_post_of_nested_params_maintains_nesting
93
+ @consumer=OAuth::Consumer.new(
94
+ "key",
95
+ "secret",
96
+ {
97
+ :site=>"http://twitter.com"
98
+ })
99
+ request = @consumer.create_signed_request(
100
+ :post,
101
+ '/people',
102
+ nil,
103
+ {},
104
+ {
105
+ :key => {
106
+ :subkey => 'value'
107
+ }
108
+ })
109
+ assert_equal 'key%5Bsubkey%5D=value', request.body
110
+ assert_equal request.content_type, 'application/x-www-form-urlencoded'
111
+ end
112
+
92
113
  def test_override_paths
93
114
  @consumer=OAuth::Consumer.new(
94
115
  "key",
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.4.6
4
+ version: 0.4.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -16,11 +16,11 @@ authors:
16
16
  autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
- date: 2012-04-21 00:00:00.000000000 Z
19
+ date: 2012-09-04 00:00:00.000000000 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: rake
23
- requirement: &70205509498980 !ruby/object:Gem::Requirement
23
+ requirement: !ruby/object:Gem::Requirement
24
24
  none: false
25
25
  requirements:
26
26
  - - ! '>='
@@ -28,10 +28,15 @@ dependencies:
28
28
  version: '0'
29
29
  type: :development
30
30
  prerelease: false
31
- version_requirements: *70205509498980
31
+ version_requirements: !ruby/object:Gem::Requirement
32
+ none: false
33
+ requirements:
34
+ - - ! '>='
35
+ - !ruby/object:Gem::Version
36
+ version: '0'
32
37
  - !ruby/object:Gem::Dependency
33
38
  name: jeweler
34
- requirement: &70205509498480 !ruby/object:Gem::Requirement
39
+ requirement: !ruby/object:Gem::Requirement
35
40
  none: false
36
41
  requirements:
37
42
  - - ! '>='
@@ -39,10 +44,15 @@ dependencies:
39
44
  version: '0'
40
45
  type: :development
41
46
  prerelease: false
42
- version_requirements: *70205509498480
47
+ version_requirements: !ruby/object:Gem::Requirement
48
+ none: false
49
+ requirements:
50
+ - - ! '>='
51
+ - !ruby/object:Gem::Version
52
+ version: '0'
43
53
  - !ruby/object:Gem::Dependency
44
54
  name: actionpack
45
- requirement: &70205509497980 !ruby/object:Gem::Requirement
55
+ requirement: !ruby/object:Gem::Requirement
46
56
  none: false
47
57
  requirements:
48
58
  - - ! '>='
@@ -50,10 +60,15 @@ dependencies:
50
60
  version: 2.3.5
51
61
  type: :development
52
62
  prerelease: false
53
- version_requirements: *70205509497980
63
+ version_requirements: !ruby/object:Gem::Requirement
64
+ none: false
65
+ requirements:
66
+ - - ! '>='
67
+ - !ruby/object:Gem::Version
68
+ version: 2.3.5
54
69
  - !ruby/object:Gem::Dependency
55
70
  name: rack
56
- requirement: &70205509497480 !ruby/object:Gem::Requirement
71
+ requirement: !ruby/object:Gem::Requirement
57
72
  none: false
58
73
  requirements:
59
74
  - - ! '>='
@@ -61,10 +76,15 @@ dependencies:
61
76
  version: 1.0.0
62
77
  type: :development
63
78
  prerelease: false
64
- version_requirements: *70205509497480
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ none: false
81
+ requirements:
82
+ - - ! '>='
83
+ - !ruby/object:Gem::Version
84
+ version: 1.0.0
65
85
  - !ruby/object:Gem::Dependency
66
86
  name: mocha
67
- requirement: &70205509496960 !ruby/object:Gem::Requirement
87
+ requirement: !ruby/object:Gem::Requirement
68
88
  none: false
69
89
  requirements:
70
90
  - - ! '>='
@@ -72,10 +92,15 @@ dependencies:
72
92
  version: 0.9.8
73
93
  type: :development
74
94
  prerelease: false
75
- version_requirements: *70205509496960
95
+ version_requirements: !ruby/object:Gem::Requirement
96
+ none: false
97
+ requirements:
98
+ - - ! '>='
99
+ - !ruby/object:Gem::Version
100
+ version: 0.9.8
76
101
  - !ruby/object:Gem::Dependency
77
102
  name: typhoeus
78
- requirement: &70205509496480 !ruby/object:Gem::Requirement
103
+ requirement: !ruby/object:Gem::Requirement
79
104
  none: false
80
105
  requirements:
81
106
  - - ! '>='
@@ -83,10 +108,15 @@ dependencies:
83
108
  version: 0.1.13
84
109
  type: :development
85
110
  prerelease: false
86
- version_requirements: *70205509496480
111
+ version_requirements: !ruby/object:Gem::Requirement
112
+ none: false
113
+ requirements:
114
+ - - ! '>='
115
+ - !ruby/object:Gem::Version
116
+ version: 0.1.13
87
117
  - !ruby/object:Gem::Dependency
88
118
  name: em-http-request
89
- requirement: &70205509496000 !ruby/object:Gem::Requirement
119
+ requirement: !ruby/object:Gem::Requirement
90
120
  none: false
91
121
  requirements:
92
122
  - - ! '>='
@@ -94,10 +124,15 @@ dependencies:
94
124
  version: 0.2.10
95
125
  type: :development
96
126
  prerelease: false
97
- version_requirements: *70205509496000
127
+ version_requirements: !ruby/object:Gem::Requirement
128
+ none: false
129
+ requirements:
130
+ - - ! '>='
131
+ - !ruby/object:Gem::Version
132
+ version: 0.2.10
98
133
  - !ruby/object:Gem::Dependency
99
134
  name: curb
100
- requirement: &70205509495520 !ruby/object:Gem::Requirement
135
+ requirement: !ruby/object:Gem::Requirement
101
136
  none: false
102
137
  requirements:
103
138
  - - ! '>='
@@ -105,7 +140,12 @@ dependencies:
105
140
  version: 0.6.6.0
106
141
  type: :development
107
142
  prerelease: false
108
- version_requirements: *70205509495520
143
+ version_requirements: !ruby/object:Gem::Requirement
144
+ none: false
145
+ requirements:
146
+ - - ! '>='
147
+ - !ruby/object:Gem::Version
148
+ version: 0.6.6.0
109
149
  description: OAuth Core Ruby implementation
110
150
  email: oauth-ruby@googlegroups.com
111
151
  executables:
@@ -223,7 +263,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
223
263
  version: '0'
224
264
  requirements: []
225
265
  rubyforge_project: oauth
226
- rubygems_version: 1.8.16
266
+ rubygems_version: 1.8.23
227
267
  signing_key:
228
268
  specification_version: 3
229
269
  summary: OAuth Core Ruby implementation