From 90dc4eca5d02ec33129ecc870729912d228f0bbf Mon Sep 17 00:00:00 2001 From: cameroncaci Date: Wed, 18 Oct 2023 09:04:58 -0400 Subject: [PATCH] Fixed secret management inside of decode keystore --- .../trdmlambda/milmove/util/DecodeKeystore.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/milmove/trdmlambda/milmove/util/DecodeKeystore.java b/src/main/java/com/milmove/trdmlambda/milmove/util/DecodeKeystore.java index 34ce2be..96cdbf3 100644 --- a/src/main/java/com/milmove/trdmlambda/milmove/util/DecodeKeystore.java +++ b/src/main/java/com/milmove/trdmlambda/milmove/util/DecodeKeystore.java @@ -5,7 +5,6 @@ import java.util.Base64; import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import ch.qos.logback.classic.Logger; @@ -14,8 +13,13 @@ public class DecodeKeystore { private Logger logger = (Logger) LoggerFactory.getLogger(DecodeKeystore.class); - public DecodeKeystore(@Value("${TRDM_LAMBDA_MILMOVE_KEYPAIR_BASE64}") String base64Content, - @Value("${TRDM_LAMBDA_MILMOVE_KEYPAIR_FILEPATH}") String filepath) throws Exception { + private String base64Content; + private String filepath; + + public DecodeKeystore(SecretFetcher secretFetcher) { + this.base64Content = secretFetcher.getSecret("trdm_lambda_milmove_keypair_base64"); + this.filepath = secretFetcher.getSecret("trdm_lambda_milmove_keypair_filepath"); + File file = new File(filepath); if (file.exists()) {