miasma-aws 0.1.28 → 0.1.30
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 +3 -0
- data/lib/miasma-aws/version.rb +1 -1
- data/lib/miasma/contrib/aws.rb +5 -3
- 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: ade9648fa009d632f77f114e41b786898eca7d7b
|
|
4
|
+
data.tar.gz: 0afd2fb7d071037032f862e58bf57a453a0ebe7b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 84fb44be2df3cc20d7388495c27d932ff4cecdb0f43d60bc7c74c4fa847f2b4176d06dd9cf88116322fb36b955b5d1fbb5e867902f1fd5009caa5ecef5417f3c
|
|
7
|
+
data.tar.gz: 3575d88a2f8dddff1e5e17f144f2f1910e41b20effd2494a49e0d9b1f831f9a19bbd4e2f10b455bcfafa89675c386b39dd4d13d024f00e40475bdc614ed5dabf
|
data/CHANGELOG.md
CHANGED
data/lib/miasma-aws/version.rb
CHANGED
data/lib/miasma/contrib/aws.rb
CHANGED
|
@@ -336,6 +336,7 @@ module Miasma
|
|
|
336
336
|
attribute :aws_sts_external_id, String
|
|
337
337
|
attribute :aws_sts_role_session_name, String
|
|
338
338
|
attribute :aws_sts_region, String
|
|
339
|
+
attribute :aws_sts_host, String
|
|
339
340
|
attribute :aws_credentials_file, String, :required => true, :default => File.join(Dir.home, '.aws/credentials')
|
|
340
341
|
attribute :aws_config_file, String, :required => true, :default => File.join(Dir.home, '.aws/config')
|
|
341
342
|
attribute :aws_access_key_id, String, :required => true
|
|
@@ -486,7 +487,7 @@ module Miasma
|
|
|
486
487
|
:aws_credentials_file => creds.fetch(:aws_credentials_file, aws_credentials_file),
|
|
487
488
|
:aws_config_file => creds.fetch(:aws_config_file, aws_config_file),
|
|
488
489
|
:aws_profile_name => creds[:aws_profile_name],
|
|
489
|
-
:aws_host => creds[:
|
|
490
|
+
:aws_host => creds[:aws_sts_host]
|
|
490
491
|
)
|
|
491
492
|
role_info = sts.assume_role(
|
|
492
493
|
creds[:aws_sts_role_arn],
|
|
@@ -629,7 +630,7 @@ module Miasma
|
|
|
629
630
|
end
|
|
630
631
|
end
|
|
631
632
|
if(aws_sts_token)
|
|
632
|
-
sts_assume_role!(
|
|
633
|
+
sts_assume_role!(attributes) if sts_update_required?
|
|
633
634
|
options.set(:headers, 'X-Amz-Security-Token', aws_sts_token)
|
|
634
635
|
end
|
|
635
636
|
signature = signer.generate(http_method, path, options)
|
|
@@ -641,7 +642,8 @@ module Miasma
|
|
|
641
642
|
# @return [TrueClass, FalseClass]
|
|
642
643
|
def sts_update_required?(args={})
|
|
643
644
|
expiry = args.fetch(:aws_sts_token_expires, data[:aws_sts_token_expires])
|
|
644
|
-
expiry.nil? || expiry
|
|
645
|
+
expiry.nil? || expiry <= Time.now - 1
|
|
646
|
+
true
|
|
645
647
|
end
|
|
646
648
|
|
|
647
649
|
# Simple callback to allow request option adjustments prior to
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: miasma-aws
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.30
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Chris Roberts
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-10-
|
|
11
|
+
date: 2015-10-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: miasma
|