firespring_dev_commands 1.4.1.pre.alpha.3 → 1.4.2.pre.alpha.1

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
  SHA256:
3
- metadata.gz: d093403925ecd78bcf6ffe42cbdf2c4588a22c7884a6699630a92336da75276d
4
- data.tar.gz: 6bd9ebd9e8625641f8389fdbc23553c5538343e50ea094a3b76ca2b9dd83b421
3
+ metadata.gz: a556d5109fb1e74b021e30d932cc33524aae18dcd2e3b71b8fe62b8cc4687d79
4
+ data.tar.gz: 2d1aef5ee8253ca64f9e490865b961c9115d5f63134393e5a5536a49f322e139
5
5
  SHA512:
6
- metadata.gz: 8867f10fff5d8b0a002328d53777128bffd2bc413a5ef6d5f94573ea03496a2ece79ee1c8b097410bc51e68245a37eb2cacec0a16caf52e0fac3243215c7e4b0
7
- data.tar.gz: b2cdf36f64c0cbb6101eba7f4473f7f0d711d9284a733b98e9bda26f6bf94e7b51ccf4c2b7aeadd4ce22469fb43d9a6adf33fc7eaa3f08c5820db5baf1bdfc7a
6
+ metadata.gz: 119b834f548aad204943289cf39ec53c25b7819f426ce8627a5138e27d36325fb154b16124081d3d614998e9757c073c7c8ff4e53853657d9cfbad459496072e
7
+ data.tar.gz: ee8bb55e9972671aa00eec2523a3b48b93e44a15c621f03917ab1fdd894f67f806075489d0ede916865a8bb2c9190e8abddb559c4ab0fde45b710266fb5f1769
@@ -55,7 +55,7 @@ module Dev
55
55
 
56
56
  # Look up the account name for the given account id
57
57
  def name_by_account(account)
58
- all.find { |it| it.id == account }.name
58
+ all.find { |it| it.id == account }&.name
59
59
  end
60
60
 
61
61
  # Setup base Aws settings
@@ -16,6 +16,11 @@ module Dev
16
16
  ::Aws::STS::Client.new.get_caller_identity.account
17
17
  end
18
18
 
19
+ # The role the profile is currently logged in to
20
+ def logged_in_role
21
+ ::Aws::STS::Client.new.get_caller_identity.arn
22
+ end
23
+
19
24
  # The region associated with the current login
20
25
  def logged_in_region
21
26
  ::Aws::STS::Client.new.send(:config).region
@@ -33,8 +33,10 @@ module Dev
33
33
  # Print the profile info for the current account
34
34
  def info
35
35
  Dev::Aws::Credentials.new.export!
36
+ current_role = Dev::Aws::Credentials.new.logged_in_role.split(%r{/})[1]
37
+ current_account_name = Dev::Aws::Account.new.name_by_account(current)
36
38
  puts
37
- puts " Currently logged in to the #{Dev::Aws::Account.new.name_by_account(current)} (#{current})".light_yellow
39
+ puts " Currently logged in as #{current_role} to the #{current_account_name} (#{current}) account".light_yellow
38
40
  puts
39
41
  puts ' To use this profile in your local aws cli, you must either pass the profile as a command line argument ' \
40
42
  'or export the corresponding aws variable:'.light_white
@@ -6,6 +6,6 @@ module Dev
6
6
  # Use 'v.v.v.pre.alpha.v' for pre-release vesions
7
7
  # Use 'v.v.v.beta.v for beta versions
8
8
  # Use semantic versioning for any releases (https://semver.org/)
9
- VERSION = '1.4.1.pre.alpha.3'.freeze
9
+ VERSION = '1.4.2.pre.alpha.1'.freeze
10
10
  end
11
11
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: firespring_dev_commands
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1.pre.alpha.3
4
+ version: 1.4.2.pre.alpha.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Firespring
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-02 00:00:00.000000000 Z
11
+ date: 2023-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport