firespring_dev_commands 2.1.3 → 2.1.4.pre.alpha.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
  SHA256:
3
- metadata.gz: 44213627e63b15337ede6416bf7dc17e6f70188d71ca2f2a19b601e61b21ae0e
4
- data.tar.gz: 356826da99f48dcaa041afe7afa642fdb18f72b38536b2a46753fd0a336508fa
3
+ metadata.gz: 7bfc98cc8da862092d77bcb5781f7ea61260c56e4207ed72cc5c2b6812a6fbaf
4
+ data.tar.gz: 2b1a49276792b8f5d24dbd4e188eb7c89a70d77876625e80edd193d4b06fc9ca
5
5
  SHA512:
6
- metadata.gz: 60b6e69d0bd7625fd033e528322d8d61512abdc3d1cd0637d295eeba000a65e8d55808a89c44c093fb09d136c6cba62a9641db4d30e54e0e248197a25693ca5e
7
- data.tar.gz: 0b3f4c05a9d1900179e2bd8cc7322390243a990cf04ca48963508af32dc54e6f469dc4bb151af2ce4968a371fc2e387e554db80f4f23a79dc9deeff2ea78fafc
6
+ metadata.gz: f20f8b61f93b885fe0d3039abba3d922dce072f64a565472c9ca61eaac69047679de5615e92399ffbe494069fbef2d6469fbd3661edccd0c0e4c6aa65d7a3075
7
+ data.tar.gz: 26f3c929fe09590e24851b5075fb2d4525f6fe3e67a0940dfc11e4289095a5338fecbe128165ead9b48ed7d27064949e96b55742913712d95d9ca2e2297f93e9
@@ -38,6 +38,12 @@ module Dev
38
38
 
39
39
  region = profileini['region'] || defaultini['region'] || Dev::Aws::DEFAULT_REGION
40
40
 
41
+ # Explicitly set the region to the one we are logging in to. Then exit if we are already logged in.
42
+ # This is to fix an issue where you are attempting to log in to an account in a different region.
43
+ # We were seeing issue where it would still be attempting to use the old region until the process exited
44
+ ENV['AWS_DEFAULT_REGION'] = region
45
+ return if Dev::Aws::Credentials.new.active?(account)
46
+
41
47
  serial = profileini['mfa_serial_name'] || defaultini['mfa_serial_name']
42
48
  serial = "arn:aws:iam::#{Dev::Aws::Account.new.root.id}:mfa/#{serial}" if serial
43
49
  serial ||= profileini['mfa_serial'] || defaultini['mfa_serial']
@@ -6,11 +6,14 @@ module Dev
6
6
  class Application
7
7
  # Contains rake tasks for displaying and setting application variables in parameter store
8
8
  class Config < Dev::Template::ApplicationInterface
9
- attr_reader :path
9
+ attr_reader :path_prefix, :key_parameter_path
10
+
11
+ # Allow for custom config path_prefix for the application
12
+ # Allow for custom key parameter path (otherwise base it off the path prefix)
13
+ def initialize(name, path_prefix, key_parameter_path: nil, exclude: [])
14
+ @path_prefix = path_prefix
15
+ @key_parameter_path = key_parameter_path || "#{path_prefix}/kms/id"
10
16
 
11
- # Allow for custom config path for the application
12
- def initialize(name, path, exclude: [])
13
- @path = path
14
17
  super(name, exclude:)
15
18
  end
16
19
 
@@ -18,7 +21,7 @@ module Dev
18
21
  def create_list_task!
19
22
  # Have to set a local variable to be accessible inside of the instance_eval block
20
23
  application = @name
21
- path = @path
24
+ path_prefix = @path_prefix
22
25
  exclude = @exclude
23
26
 
24
27
  DEV_COMMANDS_TOP_LEVEL.instance_eval do
@@ -29,8 +32,10 @@ module Dev
29
32
  desc "List all #{application} configs"
30
33
  task list: %w(init) do
31
34
  puts
32
- Dev::Aws::Parameter.new.list(path).each do |it|
33
- puts " #{it.name} => #{it.value} (#{it.type})"
35
+ puts "Listing all parameters which start with #{path_prefix}:".light_green
36
+ puts
37
+ Dev::Aws::Parameter.new.list(path_prefix).each do |it|
38
+ puts " #{it.name.light_white} => #{it.value.light_white} (#{it.type})"
34
39
  end
35
40
  puts
36
41
  end
@@ -44,7 +49,8 @@ module Dev
44
49
  def create_set_task!
45
50
  # Have to set a local variable to be accessible inside of the instance_eval block
46
51
  application = @name
47
- path = @path
52
+ path_prefix = @path_prefix
53
+ key_parameter_path = @key_parameter_path
48
54
  exclude = @exclude
49
55
 
50
56
  DEV_COMMANDS_TOP_LEVEL.instance_eval do
@@ -58,7 +64,7 @@ module Dev
58
64
  "\n\toptionally specify ENCRYPT=true to change a String type to a SecureString type"
59
65
  task set: %w(ensure_aws_credentials) do
60
66
  raise 'NAME is required' if ENV['NAME'].to_s.strip.blank?
61
- raise 'NAME is not found in this apps parameters' if Dev::Aws::Parameter.new.list(path).none? { |it| it.name == ENV['NAME'] }
67
+ raise 'NAME is not found in this apps parameters' if Dev::Aws::Parameter.new.list(path_prefix).none? { |it| it.name == ENV['NAME'] }
62
68
  raise 'VALUE is required' if ENV['VALUE'].to_s.strip.blank?
63
69
 
64
70
  param_path = ENV.fetch('NAME', nil)
@@ -68,7 +74,7 @@ module Dev
68
74
  params = {type: 'String'}
69
75
  if ENV['ENCRYPT'].to_s.strip == 'true' || old_value.type == 'SecureString'
70
76
  params[:type] = 'SecureString'
71
- params[:key_id] = Dev::Aws::Parameter.new.get_value("#{path}/kms/id")
77
+ params[:key_id] = Dev::Aws::Parameter.new.get_value(key_parameter_path)
72
78
  end
73
79
 
74
80
  message = 'This will change '.light_green +
@@ -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 = '2.1.3'.freeze
9
+ VERSION = '2.1.4.pre.alpha.2'.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: 2.1.3
4
+ version: 2.1.4.pre.alpha.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Firespring
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-22 00:00:00.000000000 Z
11
+ date: 2023-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -331,9 +331,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
331
331
  version: '3.1'
332
332
  required_rubygems_version: !ruby/object:Gem::Requirement
333
333
  requirements:
334
- - - ">="
334
+ - - ">"
335
335
  - !ruby/object:Gem::Version
336
- version: '0'
336
+ version: 1.3.1
337
337
  requirements: []
338
338
  rubygems_version: 3.4.10
339
339
  signing_key: