summaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorDaniel Silverthorn <daniel.silverthorn@amdocs.com>2018-12-11 13:07:50 -0500
committerDaniel Silverthorn <daniel.silverthorn@amdocs.com>2018-12-11 13:12:49 -0500
commit17b7235cdaca01a6d50d0b2bda6ceb2a239b8862 (patch)
treec3153aa8d964618a73190eabddb99e178f7e2974 /src/main/java
parentecdc4859a0eaf97db959b1064b1060e392fe1bf4 (diff)
Handle non-obfuscated config
Change-Id: I5c57fcc16a93881af5cdf33947967e0d7ef2dd33 Issue-ID: AAI-1997 Signed-off-by: Daniel Silverthorn <daniel.silverthorn@amdocs.com>
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/onap/aai/modelloader/config/ModelLoaderConfig.java20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/main/java/org/onap/aai/modelloader/config/ModelLoaderConfig.java b/src/main/java/org/onap/aai/modelloader/config/ModelLoaderConfig.java
index c81f0dc..1d4f854 100644
--- a/src/main/java/org/onap/aai/modelloader/config/ModelLoaderConfig.java
+++ b/src/main/java/org/onap/aai/modelloader/config/ModelLoaderConfig.java
@@ -172,7 +172,7 @@ public class ModelLoaderConfig implements IConfiguration {
@Override
public String getKeyStorePassword() {
- return Password.deobfuscate(modelLoaderProperties.getProperty(PROP_ML_DISTRIBUTION_KEYSTORE_PASSWORD));
+ return getDeobfuscatedValue(modelLoaderProperties.getProperty(PROP_ML_DISTRIBUTION_KEYSTORE_PASSWORD));
}
@Override
@@ -182,7 +182,7 @@ public class ModelLoaderConfig implements IConfiguration {
@Override
public String getPassword() {
- return Password.deobfuscate(modelLoaderProperties.getProperty(PROP_ML_DISTRIBUTION_PASSWORD));
+ return getDeobfuscatedValue(modelLoaderProperties.getProperty(PROP_ML_DISTRIBUTION_PASSWORD));
}
@Override
@@ -235,11 +235,11 @@ public class ModelLoaderConfig implements IConfiguration {
}
public String getAaiKeyStorePassword() {
- return Password.deobfuscate(modelLoaderProperties.getProperty(PROP_AAI_KEYSTORE_PASSWORD));
+ return getDeobfuscatedValue(modelLoaderProperties.getProperty(PROP_AAI_KEYSTORE_PASSWORD));
}
public String getBabelKeyStorePassword() {
- return Password.deobfuscate(modelLoaderProperties.getProperty(PROP_BABEL_KEYSTORE_PASSWORD));
+ return getDeobfuscatedValue(modelLoaderProperties.getProperty(PROP_BABEL_KEYSTORE_PASSWORD));
}
public String getBabelTrustStorePath() {
@@ -252,7 +252,7 @@ public class ModelLoaderConfig implements IConfiguration {
}
public String getBabelTrustStorePassword() {
- return Password.deobfuscate(modelLoaderProperties.getProperty(PROP_BABEL_TRUSTSTORE_PASSWORD));
+ return getDeobfuscatedValue(modelLoaderProperties.getProperty(PROP_BABEL_TRUSTSTORE_PASSWORD));
}
public String getAaiBaseUrl() {
@@ -301,7 +301,7 @@ public class ModelLoaderConfig implements IConfiguration {
* @return password for AAI authentication that has been reverse-engineered from its obfuscated form.
*/
public String getAaiAuthenticationPassword() {
- String password = Password.deobfuscate(modelLoaderProperties.getProperty(PROP_AAI_AUTHENTICATION_PASSWORD));
+ String password = getDeobfuscatedValue(modelLoaderProperties.getProperty(PROP_AAI_AUTHENTICATION_PASSWORD));
if (password != null && password.isEmpty()) {
password = null;
@@ -337,4 +337,12 @@ public class ModelLoaderConfig implements IConfiguration {
}
+ private String getDeobfuscatedValue(String property) {
+ if (property.startsWith("OBF:")) {
+ return Password.deobfuscate(property);
+ }
+
+ // Property is not obfuscated
+ return property;
+ }
}