Skip to content

Commit

Permalink
Fix staging deployment (#675)
Browse files Browse the repository at this point in the history
  • Loading branch information
lkemperman-cfa committed Mar 11, 2024
1 parent f0deffe commit a955acb
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 24 deletions.
17 changes: 11 additions & 6 deletions src/main/java/org/ladocuploader/app/cli/BasePGPEncrpytorImpl.java
Expand Up @@ -10,25 +10,20 @@
import org.bouncycastle.openpgp.jcajce.JcaPGPPublicKeyRingCollection;
import org.bouncycastle.openpgp.operator.KeyFingerPrintCalculator;
import org.bouncycastle.openpgp.operator.jcajce.*;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;

import java.io.*;
import java.security.SecureRandom;
import java.util.Date;
import java.util.Iterator;

@Slf4j
@Component
@Profile({"production", "staging"})
public class BasePGPEncrpytorImpl implements PGPEncryptor {

@Value("${form-flow.aws.access_key}")
private String accessKey;
@Value("${form-flow.aws.secret_key}")
private String secretKey;
@Value("${form-flow.aws.region}")

private String region;

private PGPSecretKey signingKey;
Expand All @@ -39,6 +34,16 @@ public class BasePGPEncrpytorImpl implements PGPEncryptor {
protected String seckeyFilePath;
protected String bucketName;

public BasePGPEncrpytorImpl(String sigkeyPassword, String seckeyFilePath, String pubkeyFilePath, String bucketName, String accessKey, String secretKey, String region) {
this.sigkeyPassword = sigkeyPassword;
this.seckeyFilePath = seckeyFilePath;
this.pubkeyFilePath = pubkeyFilePath;
this.bucketName = bucketName;
this.accessKey = accessKey;
this.secretKey = secretKey;
this.region = region;
}

@PostConstruct
public void init() {
log.info("Retrieving keys for signing and encryption");
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/org/ladocuploader/app/cli/PGPEceEncryptorImpl.java
Expand Up @@ -13,11 +13,11 @@ public class PGPEceEncryptorImpl extends BasePGPEncrpytorImpl {
public PGPEceEncryptorImpl(@Value("${pgp.ece.sigkey-password}") String sigkeyPassword,
@Value("${pgp.ece.seckey-file-path}") String seckeyFilePath,
@Value("${pgp.ece.pubkey-file-path}") String pubkeyFilePath,
@Value("${pgp.ece.bucket-name}") String bucketName) {
super();
this.sigkeyPassword = sigkeyPassword;
this.seckeyFilePath = seckeyFilePath;
this.pubkeyFilePath = pubkeyFilePath;
this.bucketName = bucketName;
@Value("${pgp.ece.bucket-name}") String bucketName,
@Value("${form-flow.aws.access_key}") String accessKey,
@Value("${form-flow.aws.secret_key}") String secretKey,
@Value("${form-flow.aws.region}") String region) {
super(sigkeyPassword, seckeyFilePath, pubkeyFilePath, bucketName, accessKey, secretKey, region);

}
}
11 changes: 5 additions & 6 deletions src/main/java/org/ladocuploader/app/cli/PGPEncryptorImpl.java
Expand Up @@ -13,12 +13,11 @@ public class PGPEncryptorImpl extends BasePGPEncrpytorImpl {
public PGPEncryptorImpl(@Value("${pgp.snap.sigkey-password}") String sigkeyPassword,
@Value("${pgp.snap.seckey-file-path}") String seckeyFilePath,
@Value("${pgp.snap.pubkey-file-path}") String pubkeyFilePath,
@Value("${pgp.snap.bucket-name}") String bucketName) {
super();
this.sigkeyPassword = sigkeyPassword;
this.seckeyFilePath = seckeyFilePath;
this.pubkeyFilePath = pubkeyFilePath;
this.bucketName = bucketName;
@Value("${pgp.snap.bucket-name}") String bucketName,
@Value("${form-flow.aws.access_key}") String accessKey,
@Value("${form-flow.aws.secret_key}") String secretKey,
@Value("${form-flow.aws.region}") String region) {
super(sigkeyPassword, seckeyFilePath, pubkeyFilePath, bucketName, accessKey, secretKey, region);

}
}
Expand Down
11 changes: 5 additions & 6 deletions src/main/java/org/ladocuploader/app/cli/PGPWicEncryptorImpl.java
Expand Up @@ -13,11 +13,10 @@ public class PGPWicEncryptorImpl extends BasePGPEncrpytorImpl {
public PGPWicEncryptorImpl(@Value("${pgp.wic.sigkey-password}") String sigkeyPassword,
@Value("${pgp.wic.seckey-file-path}") String seckeyFilePath,
@Value("${pgp.wic.pubkey-file-path}") String pubkeyFilePath,
@Value("${pgp.wic.bucket-name}") String bucketName) {
super();
this.sigkeyPassword = sigkeyPassword;
this.seckeyFilePath = seckeyFilePath;
this.pubkeyFilePath = pubkeyFilePath;
this.bucketName = bucketName;
@Value("${pgp.wic.bucket-name}") String bucketName,
@Value("${form-flow.aws.access_key}") String accessKey,
@Value("${form-flow.aws.secret_key}") String secretKey,
@Value("${form-flow.aws.region}") String region) {
super(sigkeyPassword, seckeyFilePath, pubkeyFilePath, bucketName, accessKey, secretKey, region);
}
}

0 comments on commit a955acb

Please sign in to comment.