summaryrefslogtreecommitdiffstats
path: root/policy-management/src/main/java/org
diff options
context:
space:
mode:
authorjhh <jorge.hernandez-herrero@att.com>2019-10-16 21:30:26 -0500
committerJorge Hernandez <jorge.hernandez-herrero@att.com>2019-10-24 14:12:41 +0000
commit327ac05ea0e29a8d604f187d78f1a48aa35d8b4a (patch)
treedd6c149b33afb32c63a274dd57f2da6b0b7b7143 /policy-management/src/main/java/org
parent6e0b450abe7e62fa47ffe14e95a67d035174dbdb (diff)
Allow encrypted property values
Issue-ID: POLICY-1945 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I0317a6de838d99b579638252859e42fc49cedfa8 Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Diffstat (limited to 'policy-management/src/main/java/org')
-rw-r--r--policy-management/src/main/java/org/onap/policy/drools/system/Main.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/policy-management/src/main/java/org/onap/policy/drools/system/Main.java b/policy-management/src/main/java/org/onap/policy/drools/system/Main.java
index 0e7b44f2..3451587b 100644
--- a/policy-management/src/main/java/org/onap/policy/drools/system/Main.java
+++ b/policy-management/src/main/java/org/onap/policy/drools/system/Main.java
@@ -21,7 +21,9 @@
package org.onap.policy.drools.system;
import java.util.Properties;
+import org.apache.commons.lang3.StringUtils;
import org.onap.policy.common.endpoints.event.comm.TopicEndpointManager;
+import org.onap.policy.common.utils.security.CryptoUtils;
import org.onap.policy.drools.persistence.SystemPersistenceConstants;
import org.onap.policy.drools.properties.DroolsPropertyConstants;
import org.onap.policy.drools.utils.PropertyUtil;
@@ -34,6 +36,10 @@ import org.slf4j.LoggerFactory;
* Programmatic entry point to the management layer.
*/
public class Main {
+ /**
+ * Symmetric Key to decode sensitive configuration data.
+ */
+ protected static final String SYSTEM_SYMM_KEY = "engine.symm.key";
/** constructor (hides public default one). */
private Main() {}
@@ -52,6 +58,9 @@ public class Main {
/* system properties */
for (Properties systemProperties : SystemPersistenceConstants.getManager().getSystemProperties()) {
+ if (!StringUtils.isBlank(systemProperties.getProperty(SYSTEM_SYMM_KEY))) {
+ PropertyUtil.setDefaultCryptoCoder(new CryptoUtils(systemProperties.getProperty(SYSTEM_SYMM_KEY)));
+ }
PropertyUtil.setSystemProperties(systemProperties);
}