api-auth 1.2.1 → 1.2.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e56cb7a8470464f1c066a02ad4caeb9864c612cb
4
- data.tar.gz: b343e1646d443bed40bb7513efd85f76cb806297
3
+ metadata.gz: 46a8e26918b0e79a441205362589683de7e8b648
4
+ data.tar.gz: 273497e7c4ffe54f0f70247c0b01131c36ca7de2
5
5
  SHA512:
6
- metadata.gz: b04802be5d905287f2948f8a3b1b712faf77ac722e479f3e20088279797e0f70589b822883c36749d54c590ff1a3f936d96c7dbed880f21e07063440ed8d9b1d
7
- data.tar.gz: 27709d13a88f750aecd9495a4d617d1608d1c751ef41fbe69d2c9f950d54a4f7041920d7c6724d1b3698b172fd2d2852541e886a07732be965426aec7b0cc664
6
+ metadata.gz: c80b16a379589513181f528f3230befe06ab394652c93544011ffa878d6cbd2ea3de4b958f9c8a1e8288fbce20a6ce56c860a9833a878b6206d7d3b873f24367
7
+ data.tar.gz: 52ce2431199e623f7e00822efaded66d3626afadf3a917427f759207d23c97a4a99e86c7158d7f990dc101c825b703c2e9414691188a84612740f3139f55bfc6
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ # 1.2.2 (2014-07-08)
2
+ - Fix Rest Client driver to account for the generated date when signing (cjeeky)
3
+
1
4
  # 1.2.1 (2014-07-03)
2
5
 
3
6
  - Fix Rest Client driver to account for the generated md5 when signing (#45 cjeeky)
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- api-auth (1.2.1)
4
+ api-auth (1.2.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.1
1
+ 1.2.2
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- api-auth (1.2.1)
4
+ api-auth (1.2.2)
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.1)
4
+ api-auth (1.2.2)
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.1)
4
+ api-auth (1.2.2)
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.1)
4
+ api-auth (1.2.2)
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.1)
4
+ api-auth (1.2.2)
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.1)
4
+ api-auth (1.2.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -66,6 +66,7 @@ module ApiAuth
66
66
 
67
67
  def set_date
68
68
  @request.headers.merge!({ "DATE" => Time.now.utc.httpdate })
69
+ save_headers
69
70
  end
70
71
 
71
72
  def timestamp
@@ -175,6 +175,25 @@ describe "ApiAuth" do
175
175
  request2.headers['Authorization'].should == request1.headers['Authorization']
176
176
  end
177
177
 
178
+ it "should sign the request using the generated Date header" do
179
+ headers1 = { 'Content-MD5' => "1B2M2Y8AsgTpgAmY7PhCfg==",
180
+ 'Content-Type' => "text/plain"}
181
+ request1 = RestClient::Request.new(:url => "/resource.xml?foo=bar&bar=foo",
182
+ :headers => headers1,
183
+ :method => :put)
184
+ ApiAuth.sign!(request1, @access_id, @secret_key)
185
+ headers2 = { 'Content-MD5' => "1B2M2Y8AsgTpgAmY7PhCfg==",
186
+ 'Content-Type' => "text/plain",
187
+ 'Date' => request1.headers['DATE'] }
188
+ request2 = RestClient::Request.new(:url => "/resource.xml?foo=bar&bar=foo",
189
+ :headers => headers2,
190
+ :method => :put)
191
+
192
+ ApiAuth.sign!(request2, @access_id, @secret_key)
193
+
194
+ request2.headers['Authorization'].should == request1.headers['Authorization']
195
+ end
196
+
178
197
  it "should authenticate a valid request" do
179
198
  ApiAuth.authentic?(@signed_request, @secret_key).should be_true
180
199
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: api-auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mauricio Gomes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-03 00:00:00.000000000 Z
11
+ date: 2014-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: appraisal