fog-aws 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CONTRIBUTING.md +18 -0
- data/CONTRIBUTORS.md +5 -0
- data/LICENSE.md +20 -0
- data/lib/fog/aws/signaturev4.rb +2 -2
- data/lib/fog/aws/storage.rb +4 -1
- data/lib/fog/aws/version.rb +1 -1
- data/tests/signaturev4_tests.rb +6 -0
- metadata +5 -3
- data/LICENSE.txt +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 125c645ebeed2b422d66404b2fcf3e23730fe5ba
|
4
|
+
data.tar.gz: 7fb02263e371b88b51e57127c8b4bda7cdfb124f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7a3177a84c1f09c5ef485dd049fe0fba1e00c24860474f8739ba43d9c5d84023d52eee9449c03115d6eaea516cab9fea692e2c800d652b16d034f118c86cd4e
|
7
|
+
data.tar.gz: 477129fcdaa3a34f10c5a394ef007c723ffb245e3b94d5e50a9ed8132d744141bdba62e680c47cbaf5033df46f9cce1a82b59b500376b1084d0a8b8b6655d413
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
## Getting Involved
|
2
|
+
|
3
|
+
New contributors are always welcome, when it doubt please ask questions. We strive to be an open and welcoming community. Please be nice to one another.
|
4
|
+
|
5
|
+
### Coding
|
6
|
+
|
7
|
+
* Pick a task:
|
8
|
+
* Offer feedback on open [pull requests](https://github.com/fog/fog/pulls).
|
9
|
+
* Review open [issues](https://github.com/fog/fog/issues) for things to help on.
|
10
|
+
* [Create an issue](https://github.com/fog/fog/issues/new) to start a discussion on additions or features.
|
11
|
+
* Fork the project, add your changes and tests to cover them in a topic branch.
|
12
|
+
* Commit your changes and rebase against `fog/fog` to ensure everything is up to date.
|
13
|
+
* [Submit a pull request](https://github.com/fog/fog/compare/).
|
14
|
+
|
15
|
+
### Non-Coding
|
16
|
+
|
17
|
+
* Offer feedback on open [issues](https://github.com/fog/fog/issues).
|
18
|
+
* Organize or volunteer at events.
|
data/CONTRIBUTORS.md
ADDED
data/LICENSE.md
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2014-2015 [CONTRIBUTORS.md](https://github.com/fog/fog/blob/master/CONTRIBUTORS.md)
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
6
|
+
this software and associated documentation files (the "Software"), to deal in
|
7
|
+
the Software without restriction, including without limitation the rights to
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
9
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
10
|
+
subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
17
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
18
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
19
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
20
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/lib/fog/aws/signaturev4.rb
CHANGED
@@ -104,14 +104,14 @@ DATA
|
|
104
104
|
def canonical_headers(headers)
|
105
105
|
canonical_headers = ''
|
106
106
|
|
107
|
-
for key in headers.keys.sort_by {|k| k.to_s}
|
107
|
+
for key in headers.keys.sort_by {|k| k.to_s.downcase}
|
108
108
|
canonical_headers << "#{key.to_s.downcase}:#{headers[key].to_s.strip}\n"
|
109
109
|
end
|
110
110
|
canonical_headers
|
111
111
|
end
|
112
112
|
|
113
113
|
def signed_headers(headers)
|
114
|
-
headers.keys.map {|key| key.to_s}.sort.
|
114
|
+
headers.keys.map {|key| key.to_s.downcase}.sort.join(';')
|
115
115
|
end
|
116
116
|
|
117
117
|
end
|
data/lib/fog/aws/storage.rb
CHANGED
@@ -550,12 +550,15 @@ module Fog
|
|
550
550
|
new_params[:host] = URI.parse(headers['Location']).host
|
551
551
|
else
|
552
552
|
body = error.response.is_a?(Hash) ? error.response[:body] : error.response.body
|
553
|
+
# some errors provide info indirectly
|
553
554
|
new_params[:bucket_name] = %r{<Bucket>([^<]*)</Bucket>}.match(body).captures.first
|
554
555
|
new_params[:host] = %r{<Endpoint>([^<]*)</Endpoint>}.match(body).captures.first
|
556
|
+
# some errors provide it directly
|
557
|
+
@new_region = %r{<Region>([^<]*)</Region>}.match(body).captures.first
|
555
558
|
end
|
556
559
|
Fog::Logger.warning("fog: followed redirect to #{host}, connecting to the matching region will be more performant")
|
557
560
|
original_region, original_signer = @region, @signer
|
558
|
-
@region = case new_params[:host]
|
561
|
+
@region = @new_region || case new_params[:host]
|
559
562
|
when 's3.amazonaws.com', 's3-external-1.amazonaws.com'
|
560
563
|
DEFAULT_REGION
|
561
564
|
else
|
data/lib/fog/aws/version.rb
CHANGED
data/tests/signaturev4_tests.rb
CHANGED
@@ -13,6 +13,12 @@ Shindo.tests('AWS | signaturev4', ['aws']) do
|
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
+
tests('get-headers-mixed-case-headers') do
|
17
|
+
returns(@signer.sign({:headers => {'HOST' => 'host.foo.com', 'date' => 'Mon, 09 Sep 2011 23:36:00 GMT'}, :method => :get, :path => '/'}, @now)) do
|
18
|
+
'AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20110909/us-east-1/host/aws4_request, SignedHeaders=date;host, Signature=b27ccfbfa7df52a200ff74193ca6e32d4b48b8856fab7ebf1c595d0670a7e470'
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
16
22
|
tests('get-vanilla-query-order-key with symbol keys') do
|
17
23
|
returns(@signer.sign({:query => {:'a' => 'foo', :'b' => 'foo'}, :headers => {:'Host' => 'host.foo.com', 'Date' => 'Mon, 09 Sep 2011 23:36:00 GMT'}, :method => :get, :path => '/'}, @now)) do
|
18
24
|
'AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20110909/us-east-1/host/aws4_request, SignedHeaders=date;host, Signature=0dc122f3b28b831ab48ba65cb47300de53fbe91b577fe113edac383730254a3b'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fog-aws
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Lane
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-01-
|
12
|
+
date: 2015-01-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -121,8 +121,10 @@ extra_rdoc_files: []
|
|
121
121
|
files:
|
122
122
|
- ".gitignore"
|
123
123
|
- ".travis.yml"
|
124
|
+
- CONTRIBUTING.md
|
125
|
+
- CONTRIBUTORS.md
|
124
126
|
- Gemfile
|
125
|
-
- LICENSE.
|
127
|
+
- LICENSE.md
|
126
128
|
- README.md
|
127
129
|
- Rakefile
|
128
130
|
- fog-aws.gemspec
|
data/LICENSE.txt
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
Copyright (c) 2014 Josh Lane
|
2
|
-
|
3
|
-
MIT License
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
-
a copy of this software and associated documentation files (the
|
7
|
-
"Software"), to deal in the Software without restriction, including
|
8
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
-
permit persons to whom the Software is furnished to do so, subject to
|
11
|
-
the following conditions:
|
12
|
-
|
13
|
-
The above copyright notice and this permission notice shall be
|
14
|
-
included in all copies or substantial portions of the Software.
|
15
|
-
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|