Skip to content

Commit

Permalink
Add a workaround to load DB Enc PW from System Property (#286)
Browse files Browse the repository at this point in the history
  • Loading branch information
f11h authored May 28, 2021
1 parent 2c9fd72 commit 6585fdd
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
package eu.interop.federationgateway.config;

import java.util.List;
import javax.annotation.PostConstruct;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
Expand All @@ -30,6 +31,8 @@
@ConfigurationProperties("efgs")
public class EfgsProperties {

private static final String PASSWORD_PROPERTY_NAME = "efgs_dbencryption_password";

private final ContentNegotiation contentNegotiation = new ContentNegotiation();
private final UploadSettings uploadSettings = new UploadSettings();
private final DownloadSettings downloadSettings = new DownloadSettings();
Expand Down Expand Up @@ -113,4 +116,14 @@ public static class HeaderFields {
public static class DbEncryption {
private String password;
}

/**
* Workaround to load DB Encryption Password from System Property until environment is setup correctly.
*/
@PostConstruct
public void workaround() {
if (System.getProperties().containsKey(PASSWORD_PROPERTY_NAME)) {
dbEncryption.setPassword(System.getProperty(PASSWORD_PROPERTY_NAME));
}
}
}

0 comments on commit 6585fdd

Please sign in to comment.