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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 17dd3fd68228d3795c582e27cd773d680077cdac
4
- data.tar.gz: dc58a9189e5914e48398e907b381fb71775b78d5
3
+ metadata.gz: b96d5e8e4defc964f4f383e3db8e5e933101ea78
4
+ data.tar.gz: ee9929b2c953ecd1962311725a3ae17ed4396a0c
5
5
  SHA512:
6
- metadata.gz: 8a7ebbf3ff34dc65a749d701657278a0f488a27da0049e3afb37e3c6f2dbec5e00cddad2ea7fa8289889db91a9be5fc0b8a3d7d1f0c609d5137d0bb2b6c997f7
7
- data.tar.gz: ee0ae5c80c7c3ae9910d2065cf533b918131594b7b429f9f42eb003662afb9800d4418ca9b2be42cf71446e2d7faf7345e2e2964135a681337639f17a40f4369
6
+ metadata.gz: bc2f7b1df08b2a0bf9fbd54a87db7d7b18c7d5360e7661f060a906e51685564d68f809521db01dfa40711389859fc2d69a6207d5d21024b5e9c0fdcb1ad91ea0
7
+ data.tar.gz: 391f26896bb27d3fc601329a11d68aac5d865a3bd1c9fff1319f02cd789d8bad7ce91d1ad152e7607175ab80ff43baa196d153d35e2ec06d9f86c5aea73e6cfc
@@ -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:
@@ -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.9.4...HEAD)
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
 
@@ -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 = "http://github.com/fog/fog-aws"
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")
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem 'json', '~> 1.8'
4
+ gem 'mime-types', '~> 2.6', '>= 2.6.2'
5
+
6
+ gemspec :path => "../"
@@ -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
- connection = options[:connection] || Excon.new(INSTANCE_METADATA_HOST)
17
- role_name = connection.get(:path => INSTANCE_METADATA_PATH, :expects => 200).body
18
- role_data = connection.get(:path => INSTANCE_METADATA_PATH+role_name, :expects => 200).body
19
- az_data = connection.get(:path => INSTANCE_METADATA_AZ, :expects => 200).body
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 => 'DBSubnetGroup'
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
- 'DBSubnetGroup' => db_subnet_group,
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
- attr_accessor :multipart_chunk_size
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
- if multipart_chunk_size && body.respond_to?(:read)
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
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module AWS
3
- VERSION = "0.10.0"
3
+ VERSION = "0.11.0"
4
4
  end
5
5
  end
@@ -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.10.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-07-15 00:00:00.000000000 Z
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: http://github.com/fog/fog-aws
1607
+ homepage: https://github.com/fog/fog-aws
1607
1608
  licenses:
1608
1609
  - MIT
1609
1610
  metadata: {}