api-auth 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/Gemfile.lock +1 -1
- data/VERSION +1 -1
- data/gemfiles/rails_23.gemfile.lock +1 -1
- data/gemfiles/rails_30.gemfile.lock +1 -1
- data/gemfiles/rails_31.gemfile.lock +1 -1
- data/gemfiles/rails_32.gemfile.lock +1 -1
- data/gemfiles/rails_4.gemfile.lock +1 -1
- data/gemfiles/rails_41.gemfile.lock +1 -1
- data/lib/api_auth/request_drivers/rest_client.rb +1 -0
- data/spec/api_auth_spec.rb +19 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46a8e26918b0e79a441205362589683de7e8b648
|
4
|
+
data.tar.gz: 273497e7c4ffe54f0f70247c0b01131c36ca7de2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c80b16a379589513181f528f3230befe06ab394652c93544011ffa878d6cbd2ea3de4b958f9c8a1e8288fbce20a6ce56c860a9833a878b6206d7d3b873f24367
|
7
|
+
data.tar.gz: 52ce2431199e623f7e00822efaded66d3626afadf3a917427f759207d23c97a4a99e86c7158d7f990dc101c825b703c2e9414691188a84612740f3139f55bfc6
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.2.
|
1
|
+
1.2.2
|
data/spec/api_auth_spec.rb
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2014-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: appraisal
|