From 97c3610bad688660bd0b30e0e9384cd5edc8f2b0 Mon Sep 17 00:00:00 2001 From: Terry Brady Date: Fri, 14 Jul 2023 15:31:51 -0700 Subject: [PATCH 01/11] add decryption by default --- lib/uc3-ssm.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/uc3-ssm.rb b/lib/uc3-ssm.rb index 8395121..89bc376 100644 --- a/lib/uc3-ssm.rb +++ b/lib/uc3-ssm.rb @@ -229,7 +229,7 @@ def sanitize_parameter_key(key) def retrieve_ssm_value(key) return key if @ssm_skip_resolution - @client.get_parameter(name: key)[:parameter][:value] + @client.get_parameter(name: key, with_decryption: true)[:parameter][:value] rescue Aws::SSM::Errors::ParameterNotFound @logger.debug "ParameterNotFound for key '#{key}' in retrieve_ssm_value" nil From 0c5ebb8c2a23e664c0c9f8c8567b01f66fce1ee8 Mon Sep 17 00:00:00 2001 From: Terry Brady Date: Fri, 14 Jul 2023 15:38:43 -0700 Subject: [PATCH 02/11] ver update --- lib/uc3-ssm/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/uc3-ssm/version.rb b/lib/uc3-ssm/version.rb index 6426f3d..7af0eb3 100644 --- a/lib/uc3-ssm/version.rb +++ b/lib/uc3-ssm/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Uc3Ssm - VERSION = '0.3.7' + VERSION = '0.3.8' end From 8d3f684220b3793d846852a3257a3dbc7d95ef74 Mon Sep 17 00:00:00 2001 From: Terry Brady Date: Fri, 14 Jul 2023 16:21:40 -0700 Subject: [PATCH 03/11] 0.3.9 --- lib/uc3-ssm/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/uc3-ssm/version.rb b/lib/uc3-ssm/version.rb index 7af0eb3..eff5a58 100644 --- a/lib/uc3-ssm/version.rb +++ b/lib/uc3-ssm/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Uc3Ssm - VERSION = '0.3.8' + VERSION = '0.3.9' end From 822c24da639830772e8a5c5c259d32dc1cbb8ceb Mon Sep 17 00:00:00 2001 From: Terry Brady Date: Mon, 17 Jul 2023 09:39:36 -0700 Subject: [PATCH 04/11] force change --- lib/uc3-ssm.rb | 2 +- lib/uc3-ssm/version.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/uc3-ssm.rb b/lib/uc3-ssm.rb index 89bc376..1edc610 100644 --- a/lib/uc3-ssm.rb +++ b/lib/uc3-ssm.rb @@ -228,7 +228,7 @@ def sanitize_parameter_key(key) # Attempt to retrieve the value from AWS SSM def retrieve_ssm_value(key) return key if @ssm_skip_resolution - + puts 'get with decrypt ' @client.get_parameter(name: key, with_decryption: true)[:parameter][:value] rescue Aws::SSM::Errors::ParameterNotFound @logger.debug "ParameterNotFound for key '#{key}' in retrieve_ssm_value" diff --git a/lib/uc3-ssm/version.rb b/lib/uc3-ssm/version.rb index eff5a58..634d9c2 100644 --- a/lib/uc3-ssm/version.rb +++ b/lib/uc3-ssm/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Uc3Ssm - VERSION = '0.3.9' + VERSION = '0.3.10' end From e3ab1123801821e14cb97774d7a479cc86bd23e7 Mon Sep 17 00:00:00 2001 From: Terry Brady Date: Mon, 17 Jul 2023 10:10:56 -0700 Subject: [PATCH 05/11] rm debug --- lib/uc3-ssm.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/uc3-ssm.rb b/lib/uc3-ssm.rb index 1edc610..f8b89b0 100644 --- a/lib/uc3-ssm.rb +++ b/lib/uc3-ssm.rb @@ -228,7 +228,6 @@ def sanitize_parameter_key(key) # Attempt to retrieve the value from AWS SSM def retrieve_ssm_value(key) return key if @ssm_skip_resolution - puts 'get with decrypt ' @client.get_parameter(name: key, with_decryption: true)[:parameter][:value] rescue Aws::SSM::Errors::ParameterNotFound @logger.debug "ParameterNotFound for key '#{key}' in retrieve_ssm_value" From a7da1353e9c06256e4972152e2cc3717212792f2 Mon Sep 17 00:00:00 2001 From: Terry Brady Date: Fri, 14 Jul 2023 15:31:51 -0700 Subject: [PATCH 06/11] add decryption by default --- lib/uc3-ssm.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/uc3-ssm.rb b/lib/uc3-ssm.rb index 8395121..89bc376 100644 --- a/lib/uc3-ssm.rb +++ b/lib/uc3-ssm.rb @@ -229,7 +229,7 @@ def sanitize_parameter_key(key) def retrieve_ssm_value(key) return key if @ssm_skip_resolution - @client.get_parameter(name: key)[:parameter][:value] + @client.get_parameter(name: key, with_decryption: true)[:parameter][:value] rescue Aws::SSM::Errors::ParameterNotFound @logger.debug "ParameterNotFound for key '#{key}' in retrieve_ssm_value" nil From d8d4646b11e77985eeb6dc8cbf53bf5f0c4e7b69 Mon Sep 17 00:00:00 2001 From: Terry Brady Date: Fri, 14 Jul 2023 15:38:43 -0700 Subject: [PATCH 07/11] ver update --- lib/uc3-ssm/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/uc3-ssm/version.rb b/lib/uc3-ssm/version.rb index 6426f3d..7af0eb3 100644 --- a/lib/uc3-ssm/version.rb +++ b/lib/uc3-ssm/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Uc3Ssm - VERSION = '0.3.7' + VERSION = '0.3.8' end From 0405de2f702be3a79fef2fb74994931038dbbf8f Mon Sep 17 00:00:00 2001 From: Terry Brady Date: Fri, 14 Jul 2023 16:21:40 -0700 Subject: [PATCH 08/11] 0.3.9 --- lib/uc3-ssm/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/uc3-ssm/version.rb b/lib/uc3-ssm/version.rb index 7af0eb3..eff5a58 100644 --- a/lib/uc3-ssm/version.rb +++ b/lib/uc3-ssm/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Uc3Ssm - VERSION = '0.3.8' + VERSION = '0.3.9' end From ddc1c73e500588f3344be4acb95c43a77c1fd04f Mon Sep 17 00:00:00 2001 From: Terry Brady Date: Mon, 17 Jul 2023 09:39:36 -0700 Subject: [PATCH 09/11] force change --- lib/uc3-ssm.rb | 2 +- lib/uc3-ssm/version.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/uc3-ssm.rb b/lib/uc3-ssm.rb index 89bc376..1edc610 100644 --- a/lib/uc3-ssm.rb +++ b/lib/uc3-ssm.rb @@ -228,7 +228,7 @@ def sanitize_parameter_key(key) # Attempt to retrieve the value from AWS SSM def retrieve_ssm_value(key) return key if @ssm_skip_resolution - + puts 'get with decrypt ' @client.get_parameter(name: key, with_decryption: true)[:parameter][:value] rescue Aws::SSM::Errors::ParameterNotFound @logger.debug "ParameterNotFound for key '#{key}' in retrieve_ssm_value" diff --git a/lib/uc3-ssm/version.rb b/lib/uc3-ssm/version.rb index eff5a58..634d9c2 100644 --- a/lib/uc3-ssm/version.rb +++ b/lib/uc3-ssm/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Uc3Ssm - VERSION = '0.3.9' + VERSION = '0.3.10' end From dd3c0ae533d398f6e2f51a86eeb1f6df793a1120 Mon Sep 17 00:00:00 2001 From: Terry Brady Date: Mon, 17 Jul 2023 10:10:56 -0700 Subject: [PATCH 10/11] rm debug --- lib/uc3-ssm.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/uc3-ssm.rb b/lib/uc3-ssm.rb index 1edc610..f8b89b0 100644 --- a/lib/uc3-ssm.rb +++ b/lib/uc3-ssm.rb @@ -228,7 +228,6 @@ def sanitize_parameter_key(key) # Attempt to retrieve the value from AWS SSM def retrieve_ssm_value(key) return key if @ssm_skip_resolution - puts 'get with decrypt ' @client.get_parameter(name: key, with_decryption: true)[:parameter][:value] rescue Aws::SSM::Errors::ParameterNotFound @logger.debug "ParameterNotFound for key '#{key}' in retrieve_ssm_value" From c4d8c2075d30bed19e69db7e87d0cf041484b462 Mon Sep 17 00:00:00 2001 From: Terry Brady Date: Mon, 17 Jul 2023 11:49:36 -0700 Subject: [PATCH 11/11] fix tests --- spec/test/resolver_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/test/resolver_spec.rb b/spec/test/resolver_spec.rb index f804668..215349f 100644 --- a/spec/test/resolver_spec.rb +++ b/spec/test/resolver_spec.rb @@ -46,19 +46,19 @@ def mock_ssm(name, value) "ARN": "arn:aws:ssm:us-west-2:1111111111:parameter#{name}" } } - allow_any_instance_of(Aws::SSM::Client).to receive(:get_parameter).with({ name: name }) + allow_any_instance_of(Aws::SSM::Client).to receive(:get_parameter).with({ name: name, with_decryption: true }) .and_return(param_json) end # rubocop:enable Metrics/MethodLength def mock_ssm_failure(name, err) - allow_any_instance_of(Aws::SSM::Client).to receive(:get_parameter).with({ name: name }) + allow_any_instance_of(Aws::SSM::Client).to receive(:get_parameter).with({ name: name, with_decryption: true }) .and_raise(err) end def mock_ssm_not_found(name) allow_any_instance_of(Aws::SSM::Client).to receive(:get_parameter) - .with({ name: name }) + .with({ name: name, with_decryption: true }) .and_raise(Aws::SSM::Errors::ParameterNotFound.new({}, name)) end