api-auth 1.2.5 → 1.2.6

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 1.2.6 (2014-10-01)
2
+ - Fix a bug in the ActionController request driver where calculated_md5 was
3
+ incorrect in certain scenarios. (#53 karl-petter)
4
+
1
5
  # 1.2.5 (2014-09-09)
2
6
  - Fix a bug where ApiAuth.authentic? would cause an ArgumentError when given a
3
7
  request with an invalid date in the date header. It will now return false
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- api-auth (1.2.5)
4
+ api-auth (1.2.6)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.5
1
+ 1.2.6
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- api-auth (1.2.5)
4
+ api-auth (1.2.6)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- api-auth (1.2.5)
4
+ api-auth (1.2.6)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- api-auth (1.2.5)
4
+ api-auth (1.2.6)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- api-auth (1.2.5)
4
+ api-auth (1.2.6)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- api-auth (1.2.5)
4
+ api-auth (1.2.6)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- api-auth (1.2.5)
4
+ api-auth (1.2.6)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -19,11 +19,7 @@ module ApiAuth
19
19
  end
20
20
 
21
21
  def calculated_md5
22
- if @request.env.has_key?('RAW_POST_DATA')
23
- body = @request.raw_post
24
- else
25
- body = ''
26
- end
22
+ body = @request.raw_post
27
23
  md5_base64digest(body)
28
24
  end
29
25
 
@@ -321,7 +321,8 @@ describe "ApiAuth" do
321
321
  'REQUEST_METHOD' => 'PUT',
322
322
  'CONTENT_MD5' => '1B2M2Y8AsgTpgAmY7PhCfg==',
323
323
  'CONTENT_TYPE' => 'text/plain',
324
- 'HTTP_DATE' => Time.now.utc.httpdate)
324
+ 'HTTP_DATE' => Time.now.utc.httpdate,
325
+ 'rack.input' => StringIO.new)
325
326
  @signed_request = ApiAuth.sign!(@request, @access_id, @secret_key)
326
327
  end
327
328
 
@@ -337,7 +338,8 @@ describe "ApiAuth" do
337
338
  'QUERY_STRING' => 'foo=bar&bar=foo',
338
339
  'REQUEST_METHOD' => 'PUT',
339
340
  'CONTENT_TYPE' => 'text/plain',
340
- 'HTTP_DATE' => 'Mon, 23 Jan 1984 03:29:56 GMT')
341
+ 'HTTP_DATE' => 'Mon, 23 Jan 1984 03:29:56 GMT',
342
+ 'rack.input' => StringIO.new)
341
343
  signed_request = ApiAuth.sign!(request, @access_id, @secret_key)
342
344
  signed_request.env['Content-MD5'].should == "1B2M2Y8AsgTpgAmY7PhCfg=="
343
345
  end
@@ -349,7 +351,8 @@ describe "ApiAuth" do
349
351
  'REQUEST_METHOD' => 'PUT',
350
352
  'CONTENT_TYPE' => 'text/plain',
351
353
  'HTTP_DATE' => 'Mon, 23 Jan 1984 03:29:56 GMT',
352
- 'RAW_POST_DATA' => "hello\nworld")
354
+ 'rack.input' => StringIO.new("hello\nworld"),
355
+ 'CONTENT_LENGTH' => '11')
353
356
  signed_request = ApiAuth.sign!(request, @access_id, @secret_key)
354
357
  signed_request.env['Content-MD5'].should == "kZXQvrKoieG+Be1rsZVINw=="
355
358
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: api-auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.5
4
+ version: 1.2.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-09-09 00:00:00.000000000 Z
12
+ date: 2014-10-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: appraisal
@@ -254,7 +254,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
254
254
  version: '0'
255
255
  segments:
256
256
  - 0
257
- hash: -2923652677947194929
257
+ hash: -882451281331760104
258
258
  required_rubygems_version: !ruby/object:Gem::Requirement
259
259
  none: false
260
260
  requirements:
@@ -263,7 +263,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
263
263
  version: '0'
264
264
  segments:
265
265
  - 0
266
- hash: -2923652677947194929
266
+ hash: -882451281331760104
267
267
  requirements: []
268
268
  rubyforge_project:
269
269
  rubygems_version: 1.8.23.2