summaryrefslogtreecommitdiffstats
path: root/policy-endpoints/src/main/java/org/onap
diff options
context:
space:
mode:
Diffstat (limited to 'policy-endpoints/src/main/java/org/onap')
-rw-r--r--policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/RestServer.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/RestServer.java b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/RestServer.java
index 43e39d33..72747350 100644
--- a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/RestServer.java
+++ b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/RestServer.java
@@ -91,9 +91,9 @@ public class RestServer extends ServiceManagerContainer {
props.setProperty(svcpfx + PolicyEndPointProperties.PROPERTY_MANAGED_SUFFIX, "false");
props.setProperty(svcpfx + PolicyEndPointProperties.PROPERTY_HTTP_SWAGGER_SUFFIX, "true");
props.setProperty(svcpfx + PolicyEndPointProperties.PROPERTY_HTTP_AUTH_USERNAME_SUFFIX,
- restServerParameters.getUserName());
+ getValue(restServerParameters.getUserName()));
props.setProperty(svcpfx + PolicyEndPointProperties.PROPERTY_HTTP_AUTH_PASSWORD_SUFFIX,
- restServerParameters.getPassword());
+ getValue(restServerParameters.getPassword()));
props.setProperty(svcpfx + PolicyEndPointProperties.PROPERTY_HTTP_HTTPS_SUFFIX,
String.valueOf(restServerParameters.isHttps()));
props.setProperty(svcpfx + PolicyEndPointProperties.PROPERTY_AAF_SUFFIX,
@@ -124,6 +124,13 @@ public class RestServer extends ServiceManagerContainer {
return names.toString();
}
+ private String getValue(final String value) {
+ if (value != null && value.matches("[$][{].*[}]$")) {
+ return System.getenv(value.substring(2, value.length() - 1));
+ }
+ return value;
+ }
+
@Override
public String toString() {
return "RestServer [servers=" + servers + "]";