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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 07096224821dda2e08f3bda1532073082f12266d
4
- data.tar.gz: 3c64010ced9c7dceb1f2c4202946538b76f8fe3d
3
+ metadata.gz: ade9648fa009d632f77f114e41b786898eca7d7b
4
+ data.tar.gz: 0afd2fb7d071037032f862e58bf57a453a0ebe7b
5
5
  SHA512:
6
- metadata.gz: f4cde26b9fce70ec6d900b823f7366018a0c075f6a891a0ee7aeddad68b11a1d65b5aa4c661d689d52a04fd4a444dc697f7c05817c35ee367f1a0881624ec995
7
- data.tar.gz: bfe73ddbdc975d9f48ee3a01ed1bd7f2c2a1e4736693d21e67fee32bbd5585f1fd20d7054fdda5f910bc5f3d98c030f723578fec2016021edae68a59bb633813
6
+ metadata.gz: 84fb44be2df3cc20d7388495c27d932ff4cecdb0f43d60bc7c74c4fa847f2b4176d06dd9cf88116322fb36b955b5d1fbb5e867902f1fd5009caa5ecef5417f3c
7
+ data.tar.gz: 3575d88a2f8dddff1e5e17f144f2f1910e41b20effd2494a49e0d9b1f831f9a19bbd4e2f10b455bcfafa89675c386b39dd4d13d024f00e40475bdc614ed5dabf
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ # v0.1.30
2
+ * Hotfix: Update STS expiration check logic. Add isolated STS host override.
3
+
1
4
  # v0.1.28
2
5
  * Fix STS usage when building new API connections from existing connections (#21 and #23)
3
6
 
@@ -1,4 +1,4 @@
1
1
  module MiasmaAws
2
2
  # Current library version
3
- VERSION = Gem::Version.new('0.1.28')
3
+ VERSION = Gem::Version.new('0.1.30')
4
4
  end
@@ -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[:aws_host]
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!(data) if sts_update_required?
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 >= Time.now - 1
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.28
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-06 00:00:00.000000000 Z
11
+ date: 2015-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: miasma