diff options
Diffstat (limited to 'plugins')
9 files changed, 37 insertions, 12 deletions
diff --git a/plugins/grToolkit/provider/pom.xml b/plugins/grToolkit/provider/pom.xml index 5c77331c0..b44436697 100755 --- a/plugins/grToolkit/provider/pom.xml +++ b/plugins/grToolkit/provider/pom.xml @@ -118,6 +118,26 @@ </instructions> </configuration> </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <environmentVariables> + <ODL_USER>admin</ODL_USER> + <ODL_PASSWORD>admin</ODL_PASSWORD> + </environmentVariables> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-failsafe-plugin</artifactId> + <configuration> + <environmentVariables> + <ODL_USER>admin</ODL_USER> + <ODL_PASSWORD>admin</ODL_PASSWORD> + </environmentVariables> + </configuration> + </plugin> </plugins> </build> </project> diff --git a/plugins/grToolkit/provider/src/main/java/org/onap/ccsdk/sli/plugins/grtoolkit/GrToolkitProvider.java b/plugins/grToolkit/provider/src/main/java/org/onap/ccsdk/sli/plugins/grtoolkit/GrToolkitProvider.java index 5a8730bff..8da2f09ae 100755 --- a/plugins/grToolkit/provider/src/main/java/org/onap/ccsdk/sli/plugins/grtoolkit/GrToolkitProvider.java +++ b/plugins/grToolkit/provider/src/main/java/org/onap/ccsdk/sli/plugins/grtoolkit/GrToolkitProvider.java @@ -45,6 +45,7 @@ import org.apache.commons.lang.StringUtils; import org.json.JSONArray; import org.json.JSONObject; import org.onap.ccsdk.sli.core.dblib.DbLibService; +import org.onap.ccsdk.sli.core.utils.common.EnvProperties; import org.onap.ccsdk.sli.plugins.grtoolkit.connection.ConnectionManager; import org.onap.ccsdk.sli.plugins.grtoolkit.connection.ConnectionResponse; import org.onap.ccsdk.sli.plugins.grtoolkit.data.AdminHealth; @@ -183,7 +184,7 @@ public class GrToolkitProvider implements AutoCloseable, GrToolkitService, DataT */ private void setProperties() { log.info("Loading properties from {}", PROPERTIES_FILE); - properties = new Properties(); + properties = new EnvProperties(); File propertiesFile = new File(PROPERTIES_FILE); if(!propertiesFile.exists()) { log.warn("setProperties(): Properties file not found."); diff --git a/plugins/grToolkit/provider/src/main/resources/gr-toolkit.properties b/plugins/grToolkit/provider/src/main/resources/gr-toolkit.properties index e3463df08..bce40620e 100755 --- a/plugins/grToolkit/provider/src/main/resources/gr-toolkit.properties +++ b/plugins/grToolkit/provider/src/main/resources/gr-toolkit.properties @@ -24,7 +24,7 @@ adm.fqdn= adm.healthcheck=/healthcheck adm.port.http=8181 adm.port.ssl=8443 -controller.credentials=admin:admin +controller.credentials=${ODL_USER}:${ODL_PASSWORD} controller.useSsl=true controller.port.http=8181 controller.port.ssl=8443 diff --git a/plugins/grToolkit/provider/src/test/resources/gr-toolkit.properties b/plugins/grToolkit/provider/src/test/resources/gr-toolkit.properties index 52b19bf51..d3b15e70e 100755 --- a/plugins/grToolkit/provider/src/test/resources/gr-toolkit.properties +++ b/plugins/grToolkit/provider/src/test/resources/gr-toolkit.properties @@ -24,7 +24,7 @@ adm.fqdn=localhost adm.healthcheck=/adm/healthcheck adm.port.http=9999 adm.port.ssl=19999 -controller.credentials=admin:admin +controller.credentials=${ODL_USER}:${ODL_PASSWORD} controller.useSsl=false controller.port.http=9999 controller.port.ssl=19999 diff --git a/plugins/grToolkit/provider/src/test/resources/single/gr-toolkit.properties b/plugins/grToolkit/provider/src/test/resources/single/gr-toolkit.properties index cc7820e90..040f082df 100755 --- a/plugins/grToolkit/provider/src/test/resources/single/gr-toolkit.properties +++ b/plugins/grToolkit/provider/src/test/resources/single/gr-toolkit.properties @@ -23,7 +23,7 @@ adm.fqdn=localhost adm.healthcheck=/adm/healthcheck adm.port.http=9999 adm.port.ssl=19999 -controller.credentials=admin:admin +controller.credentials=${ODL_USER}:${ODL_PASSWORD} controller.useSsl=false controller.port.http=9999 controller.port.ssl=19999 diff --git a/plugins/grToolkit/provider/src/test/resources/six/gr-toolkit.properties b/plugins/grToolkit/provider/src/test/resources/six/gr-toolkit.properties index 54c9af742..f078634d3 100755 --- a/plugins/grToolkit/provider/src/test/resources/six/gr-toolkit.properties +++ b/plugins/grToolkit/provider/src/test/resources/six/gr-toolkit.properties @@ -23,7 +23,7 @@ adm.fqdn=localhost adm.healthcheck=/adm/healthcheck adm.port.http=9999 adm.port.ssl=19999 -controller.credentials=admin:admin +controller.credentials=${ODL_USER}:${ODK_PASSWORD} controller.useSsl=false controller.port.http=9999 controller.port.ssl=19999 diff --git a/plugins/grToolkit/provider/src/test/resources/three/gr-toolkit.properties b/plugins/grToolkit/provider/src/test/resources/three/gr-toolkit.properties index cc7820e90..040f082df 100755 --- a/plugins/grToolkit/provider/src/test/resources/three/gr-toolkit.properties +++ b/plugins/grToolkit/provider/src/test/resources/three/gr-toolkit.properties @@ -23,7 +23,7 @@ adm.fqdn=localhost adm.healthcheck=/adm/healthcheck adm.port.http=9999 adm.port.ssl=19999 -controller.credentials=admin:admin +controller.credentials=${ODL_USER}:${ODL_PASSWORD} controller.useSsl=false controller.port.http=9999 controller.port.ssl=19999 diff --git a/plugins/properties-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/prop/PropertiesNode.java b/plugins/properties-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/prop/PropertiesNode.java index b4bc84747..d5bf4d1dc 100644 --- a/plugins/properties-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/prop/PropertiesNode.java +++ b/plugins/properties-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/prop/PropertiesNode.java @@ -32,6 +32,7 @@ import java.util.Set; import org.onap.ccsdk.sli.core.sli.SvcLogicContext; import org.onap.ccsdk.sli.core.sli.SvcLogicException; import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin; +import org.onap.ccsdk.sli.core.utils.common.EnvProperties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -41,7 +42,7 @@ public class PropertiesNode implements SvcLogicJavaPlugin { public void readProperties(Map<String, String> paramMap, SvcLogicContext ctx) throws SvcLogicException { Parameters param = getParameters(paramMap); - Properties prop = new Properties(); + Properties prop = new EnvProperties(); try { File file = new File(param.fileName); try (InputStream in = new FileInputStream(file)) { @@ -63,14 +64,14 @@ public class PropertiesNode implements SvcLogicJavaPlugin { String name = (String) key; String value = prop.getProperty(name); if (value != null && value.trim().length() > 0) { - ctx.setAttribute(pfx + name, getObfuscatedVal(value.trim())); + ctx.setAttribute(pfx + name, EnvProperties.resolveValue(value.trim())); log.info("+++ " + pfx + name + ": [" + maskPassword(pfx + name, value) + "]"); } } } if (mm != null) { for (Map.Entry<String, String> entry : mm.entrySet()) { - ctx.setAttribute(pfx + entry.getKey(), getObfuscatedVal(entry.getValue())); + ctx.setAttribute(pfx + entry.getKey(), EnvProperties.resolveValue(entry.getValue())); log.info("+++ " + pfx + entry.getKey() + ": [" + maskPassword(pfx + entry.getKey(), entry.getValue()) + "]"); } @@ -81,7 +82,7 @@ public class PropertiesNode implements SvcLogicJavaPlugin { String name = (String) key; String value = prop.getProperty(name); if (value != null && value.trim().length() > 0) { - ctx.setAttribute(pfx + name, getObfuscatedVal(value.trim())); + ctx.setAttribute(pfx + name, EnvProperties.resolveValue(value.trim())); log.info("+++ " + pfx + name + ": [" + maskPassword(pfx + name, value) + "]"); } } @@ -92,7 +93,8 @@ public class PropertiesNode implements SvcLogicJavaPlugin { } } - /* Unobfuscate param value */ + /* Unobfuscate param value + * No longer needed - use EnvProperties.resolveValue instead private static String getObfuscatedVal(String paramValue) { String resValue = paramValue; if (paramValue != null && paramValue.startsWith("${") && paramValue.endsWith("}")) @@ -110,6 +112,7 @@ public class PropertiesNode implements SvcLogicJavaPlugin { } return resValue; } + */ /* * Getting extension has to do the following "" --> "" "name" --> "" "name.txt" --> "txt" diff --git a/plugins/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java b/plugins/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java index 3d7042493..e42dfa484 100755 --- a/plugins/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java +++ b/plugins/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java @@ -81,6 +81,7 @@ import org.glassfish.jersey.media.multipart.file.FileDataBodyPart; import org.onap.ccsdk.sli.core.sli.SvcLogicContext; import org.onap.ccsdk.sli.core.sli.SvcLogicException; import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin; +import org.onap.ccsdk.sli.core.utils.common.EnvProperties; import org.onap.logging.filter.base.HttpURLConnectionMetricUtil; import org.onap.logging.filter.base.MetricLogClientFilter; import org.onap.logging.filter.base.ONAPComponents; @@ -129,7 +130,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin { } try (FileInputStream in = new FileInputStream(configDir + "/" + UEB_PROPERTIES_FILE_NAME)) { - Properties props = new Properties(); + Properties props = new EnvProperties(); props.load(in); uebServers = props.getProperty("servers"); log.info("UEB support enabled"); |