aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPamela Dragosh <pdragosh@research.att.com>2019-05-16 14:37:44 +0000
committerGerrit Code Review <gerrit@onap.org>2019-05-16 14:37:44 +0000
commita615aee346641826b8b533a025f38759ad104afb (patch)
tree7c426a1f6b273102b9c9e4ba4f732c8ea50fbd37
parent494d243dc151c59d8a3dc1e2195cb615f22e08be (diff)
parentedaece07fe7f9e6d87f01fb1bf42817f55fc59f1 (diff)
Merge "Change to fix SQLInvalidAuthorizationSpecException"
-rw-r--r--applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/operationshistory/CountRecentOperationsPip.java9
-rw-r--r--applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/operationshistory/GetOperationOutcomePip.java9
-rw-r--r--applications/guard/src/test/resources/xacml.properties2
3 files changed, 19 insertions, 1 deletions
diff --git a/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/operationshistory/CountRecentOperationsPip.java b/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/operationshistory/CountRecentOperationsPip.java
index 00f7680b..7304dfca 100644
--- a/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/operationshistory/CountRecentOperationsPip.java
+++ b/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/operationshistory/CountRecentOperationsPip.java
@@ -33,6 +33,7 @@ import java.sql.Timestamp;
import java.time.Instant;
import java.time.temporal.ChronoUnit;
import java.util.Arrays;
+import java.util.Base64;
import java.util.Collection;
import java.util.Properties;
@@ -70,6 +71,14 @@ public class CountRecentOperationsPip extends StdOnapPip {
//
Properties emProperties = new Properties();
emProperties.putAll(properties);
+
+ //
+ // Need to decode the password before creating the EntityManager
+ //
+ String decodedPassword = new String(Base64.getDecoder()
+ .decode(emProperties.getProperty("javax.persistence.jdbc.password")));
+ emProperties.setProperty("javax.persistence.jdbc.password", decodedPassword);
+
//
// Create the entity manager factory
//
diff --git a/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/operationshistory/GetOperationOutcomePip.java b/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/operationshistory/GetOperationOutcomePip.java
index 4f327cf5..f2339b11 100644
--- a/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/operationshistory/GetOperationOutcomePip.java
+++ b/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/operationshistory/GetOperationOutcomePip.java
@@ -29,6 +29,7 @@ import com.att.research.xacml.std.pip.StdPIPResponse;
import com.google.common.base.Strings;
import java.util.Arrays;
+import java.util.Base64;
import java.util.Collection;
import java.util.Properties;
@@ -66,6 +67,14 @@ public class GetOperationOutcomePip extends StdOnapPip {
//
Properties emProperties = new Properties();
emProperties.putAll(properties);
+
+ //
+ // Need to decode the password before creating the EntityManager
+ //
+ String decodedPassword = new String(Base64.getDecoder()
+ .decode(emProperties.getProperty("javax.persistence.jdbc.password")));
+ emProperties.setProperty("javax.persistence.jdbc.password", decodedPassword);
+
//
// Create the entity manager factory
//
diff --git a/applications/guard/src/test/resources/xacml.properties b/applications/guard/src/test/resources/xacml.properties
index 3d4d025c..252143ea 100644
--- a/applications/guard/src/test/resources/xacml.properties
+++ b/applications/guard/src/test/resources/xacml.properties
@@ -50,4 +50,4 @@ xacml.pip.engines=count-recent-operations,get-operation-outcome
javax.persistence.jdbc.driver=org.h2.Driver
javax.persistence.jdbc.url=jdbc:h2:mem:testdb;DATABASE_TO_UPPER=FALSE
javax.persistence.jdbc.user=policy
-javax.persistence.jdbc.password=P01icY
+javax.persistence.jdbc.password=UDAxaWNZ