fog-aws 0.10.0 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -2
- data/CHANGELOG.md +12 -1
- data/fog-aws.gemspec +1 -1
- data/gemfiles/Gemfile-ruby-1.9 +6 -0
- data/lib/fog/aws/credential_fetcher.rb +19 -4
- data/lib/fog/aws/models/rds/cluster.rb +2 -2
- data/lib/fog/aws/models/storage/file.rb +9 -2
- data/lib/fog/aws/version.rb +1 -1
- data/tests/credentials_tests.rb +14 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b96d5e8e4defc964f4f383e3db8e5e933101ea78
|
4
|
+
data.tar.gz: ee9929b2c953ecd1962311725a3ae17ed4396a0c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc2f7b1df08b2a0bf9fbd54a87db7d7b18c7d5360e7661f060a906e51685564d68f809521db01dfa40711389859fc2d69a6207d5d21024b5e9c0fdcb1ad91ea0
|
7
|
+
data.tar.gz: 391f26896bb27d3fc601329a11d68aac5d865a3bd1c9fff1319f02cd789d8bad7ce91d1ad152e7607175ab80ff43baa196d153d35e2ec06d9f86c5aea73e6cfc
|
data/.travis.yml
CHANGED
@@ -10,7 +10,7 @@ matrix:
|
|
10
10
|
- rvm: 1.8.7
|
11
11
|
gemfile: gemfiles/Gemfile-ruby-1.8.7
|
12
12
|
- rvm: 1.9.3
|
13
|
-
gemfile: Gemfile
|
13
|
+
gemfile: gemfiles/Gemfile-ruby-1.9
|
14
14
|
- rvm: 2.0.0
|
15
15
|
gemfile: Gemfile
|
16
16
|
- rvm: 2.1.0
|
@@ -30,7 +30,7 @@ matrix:
|
|
30
30
|
- rvm: jruby-18mode
|
31
31
|
gemfile: gemfiles/Gemfile-ruby-1.8.7
|
32
32
|
- rvm: jruby-19mode
|
33
|
-
gemfile: Gemfile
|
33
|
+
gemfile: gemfiles/Gemfile-ruby-1.9
|
34
34
|
- rvm: jruby-head
|
35
35
|
gemfile: Gemfile
|
36
36
|
allow_failures:
|
data/CHANGELOG.md
CHANGED
@@ -2,7 +2,18 @@
|
|
2
2
|
|
3
3
|
## [Unreleased](https://github.com/fog/fog-aws/tree/HEAD)
|
4
4
|
|
5
|
-
[Full Changelog](https://github.com/fog/fog-aws/compare/v0.
|
5
|
+
[Full Changelog](https://github.com/fog/fog-aws/compare/v0.10.0...HEAD)
|
6
|
+
|
7
|
+
**Merged pull requests:**
|
8
|
+
|
9
|
+
- GitHub does no longer provide http:// pages [\#284](https://github.com/fog/fog-aws/pull/284) ([amatsuda](https://github.com/amatsuda))
|
10
|
+
- Skip multipart if body size is less than chunk. [\#283](https://github.com/fog/fog-aws/pull/283) ([brettcave](https://github.com/brettcave))
|
11
|
+
- ECS container credentials [\#281](https://github.com/fog/fog-aws/pull/281) ([ryansch](https://github.com/ryansch))
|
12
|
+
- test\(ci\): fix 1.9 builds with json \>= 2.0 [\#280](https://github.com/fog/fog-aws/pull/280) ([lanej](https://github.com/lanej))
|
13
|
+
- Change DBSubnetGroup to DBSubnetGroupName model cluster while creation [\#279](https://github.com/fog/fog-aws/pull/279) ([chanakyacool](https://github.com/chanakyacool))
|
14
|
+
|
15
|
+
## [v0.10.0](https://github.com/fog/fog-aws/tree/v0.10.0) (2016-07-15)
|
16
|
+
[Full Changelog](https://github.com/fog/fog-aws/compare/v0.9.4...v0.10.0)
|
6
17
|
|
7
18
|
**Closed issues:**
|
8
19
|
|
data/fog-aws.gemspec
CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
|
|
11
11
|
spec.summary = %q{Module for the 'fog' gem to support Amazon Web Services.}
|
12
12
|
spec.description = %q{This library can be used as a module for `fog` or as standalone provider
|
13
13
|
to use the Amazon Web Services in applications..}
|
14
|
-
spec.homepage = "
|
14
|
+
spec.homepage = "https://github.com/fog/fog-aws"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
17
17
|
spec.files = `git ls-files -z`.split("\x0")
|
@@ -6,6 +6,8 @@ module Fog
|
|
6
6
|
INSTANCE_METADATA_PATH = "/latest/meta-data/iam/security-credentials/"
|
7
7
|
INSTANCE_METADATA_AZ = "/latest/meta-data/placement/availability-zone/"
|
8
8
|
|
9
|
+
CONTAINER_CREDENTIALS_HOST = "http://169.254.170.2"
|
10
|
+
|
9
11
|
module ServiceMethods
|
10
12
|
def fetch_credentials(options)
|
11
13
|
if options[:use_iam_profile] && Fog.mocking?
|
@@ -13,10 +15,23 @@ module Fog
|
|
13
15
|
end
|
14
16
|
if options[:use_iam_profile]
|
15
17
|
begin
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
18
|
+
role_data = nil
|
19
|
+
az_data = nil
|
20
|
+
|
21
|
+
if ENV["AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"]
|
22
|
+
connection = options[:connection] || Excon.new(CONTAINER_CREDENTIALS_HOST)
|
23
|
+
credential_path = options[:credential_path] || ENV["AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"]
|
24
|
+
role_data = connection.get(:path => credential_path, :expects => 200).body
|
25
|
+
|
26
|
+
connection = options[:metadata_connection] || Excon.new(INSTANCE_METADATA_HOST)
|
27
|
+
az_data = connection.get(:path => INSTANCE_METADATA_AZ, :expects => 200).body
|
28
|
+
else
|
29
|
+
connection = options[:connection] || Excon.new(INSTANCE_METADATA_HOST)
|
30
|
+
role_name = connection.get(:path => INSTANCE_METADATA_PATH, :expects => 200).body
|
31
|
+
role_data = connection.get(:path => INSTANCE_METADATA_PATH+role_name, :expects => 200).body
|
32
|
+
az_data = connection.get(:path => INSTANCE_METADATA_AZ, :expects => 200).body
|
33
|
+
end
|
34
|
+
|
20
35
|
region = az_data[0..-2] # get region from az
|
21
36
|
|
22
37
|
session = Fog::JSON.decode(role_data)
|
@@ -8,7 +8,7 @@ module Fog
|
|
8
8
|
attribute :backup_retention_period, :aliases => 'BackupRetentionPeriod', :type => :integer
|
9
9
|
attribute :db_cluster_members, :aliases => 'DBClusterMembers', :type => :array
|
10
10
|
attribute :db_cluster_parameter_group, :aliases => 'DBClusterParameterGroup'
|
11
|
-
attribute :db_subnet_group, :aliases => '
|
11
|
+
attribute :db_subnet_group, :aliases => 'DBSubnetGroupName'
|
12
12
|
attribute :endpoint, :aliases => 'Endpoint'
|
13
13
|
attribute :engine, :aliases => 'Engine'
|
14
14
|
attribute :engine_version, :aliases => 'EngineVersion'
|
@@ -72,7 +72,7 @@ module Fog
|
|
72
72
|
'BackupRetentionPeriod' => backup_retention_period,
|
73
73
|
'DBClusterIdentifier' => identity,
|
74
74
|
'DBClusterParameterGroup' => db_cluster_parameter_group,
|
75
|
-
'
|
75
|
+
'DBSubnetGroupName' => db_subnet_group,
|
76
76
|
'Endpoint' => endpoint,
|
77
77
|
'Engine' => engine,
|
78
78
|
'EngineVersion' => engine_version,
|
@@ -27,7 +27,11 @@ module Fog
|
|
27
27
|
|
28
28
|
# @note Chunk size to use for multipart uploads.
|
29
29
|
# Use small chunk sizes to minimize memory. E.g. 5242880 = 5mb
|
30
|
-
|
30
|
+
attr_reader :multipart_chunk_size
|
31
|
+
def multipart_chunk_size=(mp_chunk_size)
|
32
|
+
raise ArgumentError.new("minimum multipart_chunk_size is 5242880") if mp_chunk_size < 5242880
|
33
|
+
@multipart_chunk_size = mp_chunk_size
|
34
|
+
end
|
31
35
|
|
32
36
|
def acl
|
33
37
|
requires :directory, :key
|
@@ -205,7 +209,10 @@ module Fog
|
|
205
209
|
options['x-amz-storage-class'] = storage_class if storage_class
|
206
210
|
options.merge!(encryption_headers)
|
207
211
|
|
208
|
-
|
212
|
+
# With a single PUT operation you can upload objects up to 5 GB in size. Automatically set MP for larger objects.
|
213
|
+
multipart_chunk_size=5242880 if !multipart_chunk_size && Fog::Storage.get_body_size(body) > 5368709120
|
214
|
+
|
215
|
+
if multipart_chunk_size && Fog::Storage.get_body_size(body) >= multipart_chunk_size && body.respond_to?(:read)
|
209
216
|
data = multipart_save(options)
|
210
217
|
merge_attributes(data.body)
|
211
218
|
else
|
data/lib/fog/aws/version.rb
CHANGED
data/tests/credentials_tests.rb
CHANGED
@@ -28,6 +28,19 @@ Shindo.tests('AWS | credentials', ['aws']) do
|
|
28
28
|
:aws_credentials_expire_at => expires_at}) { Fog::Compute::AWS.fetch_credentials(:use_iam_profile => true) }
|
29
29
|
end
|
30
30
|
|
31
|
+
ENV["AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"] = '/v1/credentials?id=task_id'
|
32
|
+
Excon.stub({:method => :get, :path => '/v1/credentials?id=task_id'}, {:status => 200, :body => Fog::JSON.encode(credentials)})
|
33
|
+
|
34
|
+
tests("#fetch_credentials") do
|
35
|
+
returns({:aws_access_key_id => 'dummykey',
|
36
|
+
:aws_secret_access_key => 'dummysecret',
|
37
|
+
:aws_session_token => 'dummytoken',
|
38
|
+
:region => "us-west-1",
|
39
|
+
:aws_credentials_expire_at => expires_at}) { Fog::Compute::AWS.fetch_credentials(:use_iam_profile => true) }
|
40
|
+
end
|
41
|
+
|
42
|
+
ENV["AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"] = nil
|
43
|
+
|
31
44
|
compute = Fog::Compute::AWS.new(:use_iam_profile => true)
|
32
45
|
|
33
46
|
tests("#refresh_credentials_if_expired") do
|
@@ -54,6 +67,7 @@ Shindo.tests('AWS | credentials', ['aws']) do
|
|
54
67
|
end
|
55
68
|
|
56
69
|
ensure
|
70
|
+
ENV["AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"] = nil
|
57
71
|
Excon.stubs.clear
|
58
72
|
Excon.defaults[:mock] = old_mock_value
|
59
73
|
Fog.unmock! if !fog_was_mocked
|
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.
|
4
|
+
version: 0.11.0
|
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: 2016-
|
12
|
+
date: 2016-08-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -145,6 +145,7 @@ files:
|
|
145
145
|
- fog-aws.gemspec
|
146
146
|
- gemfiles/Gemfile-edge
|
147
147
|
- gemfiles/Gemfile-ruby-1.8.7
|
148
|
+
- gemfiles/Gemfile-ruby-1.9
|
148
149
|
- lib/fog/aws.rb
|
149
150
|
- lib/fog/aws/auto_scaling.rb
|
150
151
|
- lib/fog/aws/beanstalk.rb
|
@@ -1603,7 +1604,7 @@ files:
|
|
1603
1604
|
- tests/signaturev4_tests.rb
|
1604
1605
|
- tests/signed_params_tests.rb
|
1605
1606
|
- tests/storage_tests.rb
|
1606
|
-
homepage:
|
1607
|
+
homepage: https://github.com/fog/fog-aws
|
1607
1608
|
licenses:
|
1608
1609
|
- MIT
|
1609
1610
|
metadata: {}
|