train 1.4.1 → 1.4.2

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: f63093de8fc4481a4c9138635607941fc2c58d79
4
- data.tar.gz: 6cb07cade32d161a378fbd65e01deda7e6601b73
3
+ metadata.gz: 8f569e5004298f46f664132758d6ebda808d0d4d
4
+ data.tar.gz: 51a9051bf0a91c152c340326d5e44b2d48635b11
5
5
  SHA512:
6
- metadata.gz: cc3669cede169bc9b1d6279ad131e6f530e5030f5eec62cff45fd3ed67db8fb9110c3290fc2da2cc0a60bfca8bd7a6f6e94139679e48b2e95833dac91bfa2d13
7
- data.tar.gz: ea3b12df05af8e99a3999d379e67460f1d01f3c06217c6c4b2a28fc7e9e389319092c204ab5de0910a5c3f90aeb334657e421d73147bf02934ff3f96745a0874
6
+ metadata.gz: 4752da1809eb1f1ad136f13879596d0c8154b4b6c4eee474789406919aa6d67fe54fcc4220b3f2fc6a32c641017178eca10583a48653f9f591a51192b2d07e15
7
+ data.tar.gz: 03045744dd116b3e766242a255fbe277c978bf98708fcd14e7af7c77d59db5077a24eaa0d43df5e6dd8588b1c36b583ec9f55ace9f5876183344edf4f82495f6
@@ -1,10 +1,18 @@
1
1
  # Change Log
2
2
 
3
- ## [1.4.1](https://github.com/chef/train/tree/1.4.1) (2018-04-19)
4
- [Full Changelog](https://github.com/chef/train/compare/v1.4.0...1.4.1)
3
+ ## [1.4.2](https://github.com/chef/train/tree/1.4.2) (2018-04-26)
4
+ [Full Changelog](https://github.com/chef/train/compare/v1.4.1...1.4.2)
5
5
 
6
6
  **Merged pull requests:**
7
7
 
8
+ - switched method of determining aws account id to STS [\#286](https://github.com/chef/train/pull/286) ([tkrueger](https://github.com/tkrueger))
9
+
10
+ ## [v1.4.1](https://github.com/chef/train/tree/v1.4.1) (2018-04-19)
11
+ [Full Changelog](https://github.com/chef/train/compare/v1.4.0...v1.4.1)
12
+
13
+ **Merged pull requests:**
14
+
15
+ - Release 1.4.1 [\#287](https://github.com/chef/train/pull/287) ([jquick](https://github.com/jquick))
8
16
  - Add UUID for Cisco IOS and Nexus devices [\#285](https://github.com/chef/train/pull/285) ([jerryaldrichiii](https://github.com/jerryaldrichiii))
9
17
  - Add handling for privileged exec mode [\#284](https://github.com/chef/train/pull/284) ([jerryaldrichiii](https://github.com/jerryaldrichiii))
10
18
 
@@ -62,9 +62,8 @@ module Train::Transports
62
62
 
63
63
  def unique_identifier
64
64
  # use aws account id
65
- client = aws_client(::Aws::IAM::Client)
66
- arn = client.get_user.user.arn
67
- arn.split(':')[4]
65
+ client = aws_client(::Aws::STS::Client)
66
+ client.get_caller_identity.account
68
67
  end
69
68
  end
70
69
  end
@@ -3,5 +3,5 @@
3
3
  # Author:: Dominik Richter (<dominik.richter@gmail.com>)
4
4
 
5
5
  module Train
6
- VERSION = '1.4.1'.freeze
6
+ VERSION = '1.4.2'.freeze
7
7
  end
@@ -98,26 +98,23 @@ describe 'aws transport' do
98
98
  end
99
99
 
100
100
  describe 'unique_identifier' do
101
- class AwsArn
102
- def arn
103
- 'arn:aws:iam::158551926027:user/test-fixture-maker'
104
- end
105
- end
106
101
 
107
- class AwsUser
108
- def user
109
- AwsArn.new
102
+ class AwsCallerId
103
+ def account
104
+ "123456789012"
110
105
  end
111
106
  end
112
107
 
113
- class AwsClient
114
- def get_user
115
- AwsUser.new
108
+ class StsClient
109
+ def get_caller_identity
110
+ AwsCallerId.new
116
111
  end
117
112
  end
113
+
118
114
  it 'returns an account id' do
119
- connection.stubs(:aws_client).returns(AwsClient.new)
120
- connection.unique_identifier.must_equal '158551926027'
115
+ connection.stubs(:aws_client).returns(StsClient.new)
116
+ connection.unique_identifier.must_equal '123456789012'
121
117
  end
122
118
  end
119
+
123
120
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: train
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 1.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dominik Richter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-19 00:00:00.000000000 Z
11
+ date: 2018-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json