Fix Fortify Scan Issue:
[policy/engine.git] / ONAP-PDP-REST / src / main / java / org / onap / policy / pdp / rest / api / services / PAPServices.java
index 57a80b5..5919484 100644 (file)
@@ -40,6 +40,7 @@ import org.onap.policy.common.logging.flexlogger.FlexLogger;
 import org.onap.policy.common.logging.flexlogger.Logger;
 import org.onap.policy.pdp.rest.config.PDPApiAuth;
 import org.onap.policy.rest.XACMLRestProperties;
+import org.onap.policy.utils.CryptoUtils;
 import org.onap.policy.xacml.api.XACMLErrorConstants;
 import org.onap.policy.xacml.std.pap.StdPDPPolicy;
 
@@ -53,9 +54,9 @@ public class PAPServices {
     
     private int responseCode = 0;
     private static String environment = "DEVL";
-    private static Boolean junit = false;
+    public static Boolean junit = false;
     private static List<String> paps = null;
-    private static final Object papResourceLock = new Object();
+       private static final Object papResourceLock = new Object();
     private String operation = null;
     private String requestMethod = null;
     private String encoding = null; 
@@ -76,7 +77,7 @@ public class PAPServices {
     private String getPAPEncoding(){
         if(encoding  == null){
             String userID =  XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_USERID);
-            String pass = XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_PASS);
+            String pass =CryptoUtils.decryptTxtNoExStr(XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_PASS));
             Base64.Encoder encoder = Base64.getEncoder();
             encoding =  encoder.encodeToString((userID+":"+pass).getBytes(StandardCharsets.UTF_8));
         }
@@ -96,6 +97,10 @@ public class PAPServices {
         }
         return result;
     }
+    
+    public static void setPaps(List<String> paps) {
+               PAPServices.paps = paps;
+       }
 
     public int getResponseCode() {
         return responseCode;