api-auth 1.3.0 → 1.3.1
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 +4 -4
- data/CHANGELOG.md +4 -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/faraday.rb +3 -1
- data/spec/api_auth_spec.rb +22 -1
- 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: 8df4c4b6537d3646e5159fb10b1ff7839455cd96
|
4
|
+
data.tar.gz: c50289d2bca57c241f41bbdbf5c9a268505c18ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d11fd71f2ec739b442c1e87c350cc4ec09dd5f1c5acff642abed86a5162654da541eb73d6a3f2146cea3dd07b265741e778e5cdf48da472e00b5404fa1ef07e
|
7
|
+
data.tar.gz: 27cc78257708f8f96f95cf4ef1ceb3070c37b30330a1ba8c22278c0891601166345d3a803add2762f9b8bb6dee2d46aa7bdf87f923c4a59943fba3ddb9c95694
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.3.
|
1
|
+
1.3.1
|
@@ -56,7 +56,9 @@ module ApiAuth
|
|
56
56
|
end
|
57
57
|
|
58
58
|
def request_uri
|
59
|
-
|
59
|
+
query_string = @request.params.to_query
|
60
|
+
query_string = nil if query_string.empty?
|
61
|
+
uri = URI::HTTP.new(nil, nil, nil, nil, nil, @request.path, nil, query_string, nil)
|
60
62
|
uri.to_s
|
61
63
|
end
|
62
64
|
|
data/spec/api_auth_spec.rb
CHANGED
@@ -570,6 +570,7 @@ describe "ApiAuth" do
|
|
570
570
|
before(:each) do
|
571
571
|
stubs = Faraday::Adapter::Test::Stubs.new do |stub|
|
572
572
|
stub.put('/resource.xml?foo=bar&bar=foo') { [200, {}, ''] }
|
573
|
+
stub.put('/resource.xml') { [200, {}, ''] }
|
573
574
|
end
|
574
575
|
|
575
576
|
@faraday_conn = Faraday.new do |builder|
|
@@ -625,7 +626,7 @@ describe "ApiAuth" do
|
|
625
626
|
@signed_request.headers['Authorization'].should == "APIAuth 1044:#{hmac(@secret_key, @request)}"
|
626
627
|
end
|
627
628
|
|
628
|
-
it "should authenticate a valid request" do
|
629
|
+
it "should authenticate a valid request with parameters" do
|
629
630
|
ApiAuth.authentic?(@signed_request, @secret_key).should be_true
|
630
631
|
end
|
631
632
|
|
@@ -660,6 +661,26 @@ describe "ApiAuth" do
|
|
660
661
|
it "should retrieve the access_id" do
|
661
662
|
ApiAuth.access_id(@signed_request).should == "1044"
|
662
663
|
end
|
664
|
+
|
665
|
+
describe 'request_uri' do
|
666
|
+
context 'with parameters' do
|
667
|
+
it "should return urls with a query string" do
|
668
|
+
req = ::ApiAuth::RequestDrivers::FaradayRequest.new(@request)
|
669
|
+
req.request_uri.should == '/resource.xml?bar=foo&foo=bar'
|
670
|
+
end
|
671
|
+
end
|
672
|
+
|
673
|
+
context 'without parameters' do
|
674
|
+
it "should return urls with no query string" do
|
675
|
+
@faraday_conn.put '/resource.xml' do |request|
|
676
|
+
request.headers.merge!({'content-type' => 'text/plain',
|
677
|
+
'DATE' => Time.now.utc.httpdate})
|
678
|
+
req = ::ApiAuth::RequestDrivers::FaradayRequest.new(request)
|
679
|
+
req.request_uri.should == '/resource.xml'
|
680
|
+
end
|
681
|
+
end
|
682
|
+
end
|
683
|
+
end
|
663
684
|
end
|
664
685
|
end
|
665
686
|
|
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.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mauricio Gomes
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: appraisal
|