Skip to content

Commit

Permalink
Fixed secret management inside of decode keystore
Browse files Browse the repository at this point in the history
  • Loading branch information
cameroncaci committed Oct 18, 2023
1 parent 69f97b3 commit 90dc4ec
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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()) {
Expand Down

0 comments on commit 90dc4ec

Please sign in to comment.