firespring_dev_commands 1.4.1 → 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: '079a3a5fa28a439cd72ea214bdf111b144a824b4534c2b3b7e5862d3ff1d2db5'
4
- data.tar.gz: ff97e70671d801e0b4d8017d81f94606e9efb11dedcf610a053c39914a3d6473
3
+ metadata.gz: a556d5109fb1e74b021e30d932cc33524aae18dcd2e3b71b8fe62b8cc4687d79
4
+ data.tar.gz: 2d1aef5ee8253ca64f9e490865b961c9115d5f63134393e5a5536a49f322e139
5
5
  SHA512:
6
- metadata.gz: 26df853330845cbc3fbe7a773aaf009247d92110f3b72728e9fb11a2efc1d5cd274a3de8bc39f40b8cb7b802841ed9990f6dbab8f47e5bdc2fcab03ab517b555
7
- data.tar.gz: 5fb33894729714b7e7531679af55cd172a97f10383b8794e9a4f8532f09b1d28c8622f9390d2bc923b96e6ad0163e67653b8b841679bbfa6645d8a18ce5a2001
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'.freeze
9
+ VERSION = '1.4.2.pre.alpha.1'.freeze
10
10
  end
11
11
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: firespring_dev_commands
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 1.4.2.pre.alpha.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Firespring
@@ -453,9 +453,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
453
453
  version: '2.7'
454
454
  required_rubygems_version: !ruby/object:Gem::Requirement
455
455
  requirements:
456
- - - ">="
456
+ - - ">"
457
457
  - !ruby/object:Gem::Version
458
- version: '0'
458
+ version: 1.3.1
459
459
  requirements: []
460
460
  rubygems_version: 3.1.6
461
461
  signing_key: