aboutsummaryrefslogtreecommitdiffstats
path: root/restapi-call-node/provider/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'restapi-call-node/provider/src/main')
-rwxr-xr-xrestapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java21
1 files changed, 20 insertions, 1 deletions
diff --git a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java
index 220e18fd..c539010f 100755
--- a/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java
+++ b/restapi-call-node/provider/src/main/java/org/onap/ccsdk/sli/plugins/restapicall/RestapiCallNode.java
@@ -141,7 +141,7 @@ public class RestapiCallNode implements SvcLogicJavaPlugin {
}
String userName = partnerObject.getString(partnerUserKey);
String password = partnerObject.getString(partnerPasswordKey);
- PartnerDetails details = new PartnerDetails(userName, password, url);
+ PartnerDetails details = new PartnerDetails(userName, getObfuscatedVal(password), url);
partnerStore.put(partnerKey, details);
log.info("mapped partner using partner key " + partnerKey);
} else {
@@ -153,6 +153,25 @@ public class RestapiCallNode implements SvcLogicJavaPlugin {
}
}
+ /* Unobfuscate param value */
+ private static String getObfuscatedVal(String paramValue) {
+ String resValue = paramValue;
+ if (paramValue != null && paramValue.startsWith("${") && paramValue.endsWith("}"))
+ {
+ String paramStr = paramValue.substring(2, paramValue.length()-1);
+ if (paramStr != null && paramStr.length() > 0)
+ {
+ String val = System.getenv(paramStr);
+ if (val != null && val.length() > 0)
+ {
+ resValue=val;
+ log.info("Obfuscated value RESET for param value:" + paramValue);
+ }
+ }
+ }
+ return resValue;
+ }
+
/**
* Returns parameters from the parameter map.
*