fog-aws 3.6.4 → 3.6.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f289bf7f4001b92e347106bdfda3d867b870bec5669ac28b5cb9cec528807ab7
4
- data.tar.gz: 5fd55a3abe362e701f30eac3b6b0c590f070635442a74ee00309d954369e4e81
3
+ metadata.gz: fb6b720b1154779144fb0f7a9fad14d0db7e968513bcd81f53ef2d2dab9cd0ae
4
+ data.tar.gz: e391f374bd90f7e79fb3177c03e75da6facca417fa415204ed4a1b42b4b398e2
5
5
  SHA512:
6
- metadata.gz: 9e2b3950738fdeeacdeb9ec7ebe7edb561a4906b8b0d909a80ee743a4d9604a77e1d00732e44c0786b180b82352accfc907e15aba7ac9b001d68c5e782667dba
7
- data.tar.gz: 7cb59578e078f5210866b6db6b2a81f2148df51bb5e42533adbefff6050f7edcfa414ea05b448c677e5638044184fe4c01ff43cb7079be6ed72fe47727f0ca29
6
+ metadata.gz: 5bfcbc83a0c7159678946d75f3975064fd24fc16e607ed0b7c75e1f9f8bf96ea836e38107a3b633f0975735458043a3bae346e64e04118e10e8ca21e41beedd9
7
+ data.tar.gz: c848bb24b012778855303188eed83e8f60acd8344d47fd09e1ff732d5659fb46c0a92dc00c433f48be352bf768f8e3f43165e05c4394e322b3675a2407a1ec81
@@ -1,5 +1,17 @@
1
1
  # Change Log
2
2
 
3
+ ## [v3.6.4](https://github.com/fog/fog-aws/tree/v3.6.4) (2020-05-14)
4
+ [Full Changelog](https://github.com/fog/fog-aws/compare/v3.6.3...v3.6.4)
5
+
6
+ **Closed issues:**
7
+
8
+ - Is fog-aws compatible with AWS Trust Services? [\#558](https://github.com/fog/fog-aws/issues/558)
9
+
10
+ **Merged pull requests:**
11
+
12
+ - Add support for IMDSv2 in CredentialFetcher [\#559](https://github.com/fog/fog-aws/pull/559) ([atyndall](https://github.com/atyndall))
13
+ - Don’t install development scripts [\#557](https://github.com/fog/fog-aws/pull/557) ([amarshall](https://github.com/amarshall))
14
+
3
15
  ## [v3.6.3](https://github.com/fog/fog-aws/tree/v3.6.3) (2020-04-22)
4
16
  [Full Changelog](https://github.com/fog/fog-aws/compare/v3.6.2...v3.6.3)
5
17
 
@@ -26,14 +26,12 @@ module Fog
26
26
 
27
27
  if region.nil?
28
28
  connection = options[:metadata_connection] || Excon.new(INSTANCE_METADATA_HOST)
29
- token = connection.put(:path => INSTANCE_METADATA_TOKEN, :idempotent => true, :expects => 200, :headers => { "X-aws-ec2-metadata-token-ttl-seconds" => "300" }).body
30
- token_header = { "X-aws-ec2-metadata-token" => token }
29
+ token_header = fetch_credentials_token_header(connection, options[:disable_imds_v2])
31
30
  region = connection.get(:path => INSTANCE_METADATA_AZ, :idempotent => true, :expects => 200, :headers => token_header).body[0..-2]
32
31
  end
33
32
  else
34
33
  connection = options[:connection] || Excon.new(INSTANCE_METADATA_HOST)
35
- token = connection.put(:path => INSTANCE_METADATA_TOKEN, :idempotent => true, :expects => 200, :headers => { "X-aws-ec2-metadata-token-ttl-seconds" => "300" }).body
36
- token_header = { "X-aws-ec2-metadata-token" => token }
34
+ token_header = fetch_credentials_token_header(connection, options[:disable_imds_v2])
37
35
  role_name = connection.get(:path => INSTANCE_METADATA_PATH, :idempotent => true, :expects => 200, :headers => token_header).body
38
36
  role_data = connection.get(:path => INSTANCE_METADATA_PATH+role_name, :idempotent => true, :expects => 200, :headers => token_header).body
39
37
  region ||= connection.get(:path => INSTANCE_METADATA_AZ, :idempotent => true, :expects => 200, :headers => token_header).body[0..-2]
@@ -58,6 +56,26 @@ module Fog
58
56
  super
59
57
  end
60
58
  end
59
+
60
+ def fetch_credentials_token_header(connection, disable_imds_v2)
61
+ return nil if disable_imds_v2
62
+
63
+ token = connection.put(
64
+ :path => INSTANCE_METADATA_TOKEN,
65
+ :idempotent => true,
66
+ :expects => 200,
67
+ :retry_interval => 1,
68
+ :retry_limit => 3,
69
+ :read_timeout => 1,
70
+ :write_timeout => 1,
71
+ :connect_timeout => 1,
72
+ :headers => { "X-aws-ec2-metadata-token-ttl-seconds" => "300" }
73
+ ).body
74
+
75
+ { "X-aws-ec2-metadata-token" => token }
76
+ rescue Excon::Error
77
+ nil
78
+ end
61
79
  end
62
80
 
63
81
  module ConnectionMethods
@@ -68,7 +68,7 @@ module Fog
68
68
  },
69
69
  {
70
70
  :id => 't1.micro',
71
- :name => 'Micro Instance',
71
+ :name => 'T1 Micro Instance',
72
72
  :bits => 32,
73
73
  :cores => 1,
74
74
  :disk => 0,
@@ -88,7 +88,7 @@ module Fog
88
88
  },
89
89
  {
90
90
  :id => 't2.micro',
91
- :name => 'Micro Instance',
91
+ :name => 'T2 Micro Instance',
92
92
  :bits => 64,
93
93
  :cores => 1,
94
94
  :disk => 0,
@@ -98,7 +98,7 @@ module Fog
98
98
  },
99
99
  {
100
100
  :id => 't2.small',
101
- :name => 'Small Instance',
101
+ :name => 'T2 Small Instance',
102
102
  :bits => 64,
103
103
  :cores => 1,
104
104
  :disk => 0,
@@ -108,7 +108,7 @@ module Fog
108
108
  },
109
109
  {
110
110
  :id => 't2.medium',
111
- :name => 'Medium Instance',
111
+ :name => 'T2 Medium Instance',
112
112
  :bits => 64,
113
113
  :cores => 2,
114
114
  :disk => 0,
@@ -118,7 +118,7 @@ module Fog
118
118
  },
119
119
  {
120
120
  :id => 't2.large',
121
- :name => 'Large Instance',
121
+ :name => 'T2 Large Instance',
122
122
  :bits => 64,
123
123
  :cores => 2,
124
124
  :disk => 0,
@@ -128,7 +128,7 @@ module Fog
128
128
  },
129
129
  {
130
130
  :id => 't2.xlarge',
131
- :name => 'Extra Large Instance',
131
+ :name => 'T2 Extra Large Instance',
132
132
  :bits => 64,
133
133
  :cores => 4,
134
134
  :disk => 0,
@@ -138,7 +138,7 @@ module Fog
138
138
  },
139
139
  {
140
140
  :id => 't2.2xlarge',
141
- :name => 'Double Extra Large Instance',
141
+ :name => 'T2 Double Extra Large Instance',
142
142
  :bits => 64,
143
143
  :cores => 8,
144
144
  :disk => 0,
@@ -368,7 +368,7 @@ module Fog
368
368
  },
369
369
  {
370
370
  :id => 'm1.small',
371
- :name => 'Small Instance',
371
+ :name => 'M1 Small Instance',
372
372
  :bits => 32,
373
373
  :cores => 1,
374
374
  :disk => 160,
@@ -378,7 +378,7 @@ module Fog
378
378
  },
379
379
  {
380
380
  :id => 'm1.medium',
381
- :name => 'Medium Instance',
381
+ :name => 'M1 Medium Instance',
382
382
  :bits => 32,
383
383
  :cores => 1,
384
384
  :disk => 400,
@@ -388,7 +388,7 @@ module Fog
388
388
  },
389
389
  {
390
390
  :id => 'm1.large',
391
- :name => 'Large Instance',
391
+ :name => 'M1 Large Instance',
392
392
  :bits => 64,
393
393
  :cores => 2,
394
394
  :disk => 850,
@@ -398,7 +398,7 @@ module Fog
398
398
  },
399
399
  {
400
400
  :id => 'm1.xlarge',
401
- :name => 'Extra Large Instance',
401
+ :name => 'M1 Extra Large Instance',
402
402
  :bits => 64,
403
403
  :cores => 4,
404
404
  :disk => 1690,
@@ -1276,16 +1276,6 @@ module Fog
1276
1276
  :ebs_optimized_available => true,
1277
1277
  :instance_store_volumes => 0
1278
1278
  },
1279
- {
1280
- :id => 'r5.8xlarge',
1281
- :name => 'R5 Eight Extra Large',
1282
- :bits => 64,
1283
- :cores => 32,
1284
- :disk => 0,
1285
- :ram => 274878,
1286
- :ebs_optimized_available => true,
1287
- :instance_store_volumes => 0
1288
- },
1289
1279
  {
1290
1280
  :id => "r5.8xlarge",
1291
1281
  :name => "R5 Octuple Extra Large",
@@ -1306,16 +1296,6 @@ module Fog
1306
1296
  :ebs_optimized_available => true,
1307
1297
  :instance_store_volumes => 0
1308
1298
  },
1309
- {
1310
- :id => "r5.12xlarge",
1311
- :name => "R5 Sixteen Extra Large",
1312
- :bits => 64,
1313
- :cores => 64,
1314
- :ram => 549756,
1315
- :disk => 0,
1316
- :ebs_optimized_available => true,
1317
- :instance_store_volumes => 0
1318
- },
1319
1299
  {
1320
1300
  :id => "r5.16xlarge",
1321
1301
  :name => "R5 Sixteen Extra Large",
@@ -1798,7 +1778,7 @@ module Fog
1798
1778
  },
1799
1779
  {
1800
1780
  :id => "u-6tb1.metal",
1801
- :name => "X1e Sixteen Extra Large",
1781
+ :name => "U 6TB Metal",
1802
1782
  :bits => 64,
1803
1783
  :cores => 448,
1804
1784
  :ram => 6597071,
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module AWS
3
- VERSION = "3.6.4"
3
+ VERSION = "3.6.5"
4
4
  end
5
5
  end
@@ -30,6 +30,23 @@ Shindo.tests('AWS | credentials', ['aws']) do
30
30
  aws_credentials_expire_at: expires_at) { Fog::AWS::Compute.fetch_credentials(use_iam_profile: true) }
31
31
  end
32
32
 
33
+ tests('#fetch_credentials when the v2 token 404s') do
34
+ Excon.stub({ method: :put, path: '/latest/api/token' }, { status: 404, body: 'not found' })
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::AWS::Compute.fetch_credentials(use_iam_profile: true) }
40
+ end
41
+
42
+ tests('#fetch_credentials when the v2 disabled') do
43
+ returns(aws_access_key_id: 'dummykey',
44
+ aws_secret_access_key: 'dummysecret',
45
+ aws_session_token: 'dummytoken',
46
+ region: 'us-west-1',
47
+ aws_credentials_expire_at: expires_at) { Fog::AWS::Compute.fetch_credentials(use_iam_profile: true, disable_imds_v2: true) }
48
+ end
49
+
33
50
  ENV['AWS_CONTAINER_CREDENTIALS_RELATIVE_URI'] = '/v1/credentials?id=task_id'
34
51
  Excon.stub({ method: :get, path: '/v1/credentials?id=task_id' }, { status: 200, body: Fog::JSON.encode(credentials) })
35
52
 
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: 3.6.4
4
+ version: 3.6.5
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: 2020-05-14 00:00:00.000000000 Z
12
+ date: 2020-05-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler