Remove base64 encoding of password from api 50/112750/6
authorRam Krishna Verma <ram_krishna.verma@bell.ca>
Wed, 16 Sep 2020 14:44:03 +0000 (10:44 -0400)
committerRam Krishna Verma <ram_krishna.verma@bell.ca>
Wed, 16 Sep 2020 18:20:03 +0000 (14:20 -0400)
Remove base64 encoding of db password from policy-api component.

Issue-ID: POLICY-2550
Change-Id: If395896f88f56f0284187f23d90ec5e0252ea17f
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
main/src/test/java/org/onap/policy/api/main/rest/TestApiRestServer.java
main/src/test/java/org/onap/policy/api/main/rest/provider/TestPolicyProvider.java
main/src/test/java/org/onap/policy/api/main/rest/provider/TestPolicyTypeProvider.java
packages/policy-api-tarball/src/main/resources/etc/defaultConfig.json
packages/policy-api-tarball/src/main/resources/etc/s3pConfig.json
pom.xml
testsuites/stability/src/main/resources/apisetup/config/api/etc/defaultConfig.json

index 78a5287..ca0b0f6 100644 (file)
@@ -35,7 +35,6 @@ import java.io.IOException;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Modifier;
 import java.security.SecureRandom;
-import java.util.Base64;
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
@@ -191,7 +190,7 @@ public class TestApiRestServer {
         providerParams.setDatabaseDriver("org.h2.Driver");
         providerParams.setDatabaseUrl("jdbc:h2:mem:testdb");
         providerParams.setDatabaseUser("policy");
-        providerParams.setDatabasePassword(Base64.getEncoder().encodeToString("P01icY".getBytes()));
+        providerParams.setDatabasePassword("P01icY");
         providerParams.setPersistenceUnit("ToscaConceptTest");
         apiParamGroup = new ApiParameterGroup("ApiGroup", null, providerParams, Collections.emptyList(),
             Collections.emptyList());
index 6e742c9..8d99179 100644 (file)
@@ -33,7 +33,6 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.fail;
 
 import java.util.ArrayList;
-import java.util.Base64;
 import java.util.Collections;
 import java.util.List;
 import org.junit.After;
@@ -104,7 +103,7 @@ public class TestPolicyProvider {
         providerParams.setDatabaseDriver("org.h2.Driver");
         providerParams.setDatabaseUrl("jdbc:h2:mem:testdb");
         providerParams.setDatabaseUser("policy");
-        providerParams.setDatabasePassword(Base64.getEncoder().encodeToString("P01icY".getBytes()));
+        providerParams.setDatabasePassword("P01icY");
         providerParams.setPersistenceUnit("ToscaConceptTest");
         apiParamGroup =
             new ApiParameterGroup("ApiGroup", null, providerParams, Collections.emptyList(), Collections.emptyList());
index 17d2cb9..5c7c25a 100644 (file)
@@ -4,6 +4,7 @@
  * ================================================================================
  * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
  * Modifications Copyright (C) 2019-2020 Nordix Foundation.
+ * Modifications Copyright (C) 2020 Bell Canada. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -28,7 +29,6 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 
-import java.util.Base64;
 import java.util.Collections;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
@@ -88,7 +88,7 @@ public class TestPolicyTypeProvider {
         providerParams.setDatabaseDriver("org.h2.Driver");
         providerParams.setDatabaseUrl("jdbc:h2:mem:testdb");
         providerParams.setDatabaseUser("policy");
-        providerParams.setDatabasePassword(Base64.getEncoder().encodeToString("P01icY".getBytes()));
+        providerParams.setDatabasePassword("P01icY");
         providerParams.setPersistenceUnit("ToscaConceptTest");
         apiParamGroup = new ApiParameterGroup("ApiGroup", null, providerParams,
                 Collections.emptyList(), Collections.emptyList());
index 997959f..1ffc1d6 100644 (file)
@@ -6,7 +6,7 @@
         "userName": "healthcheck",
         "password": "zb!XztG34",
         "https": true,
-        "aaf": false 
+        "aaf": false
     },
     "databaseProviderParameters": {
         "name": "PolicyProviderParameterGroup",
@@ -14,7 +14,7 @@
         "databaseDriver": "org.mariadb.jdbc.Driver",
         "databaseUrl": "jdbc:mariadb://mariadb:3306/policyadmin",
         "databaseUser": "policy_user",
-        "databasePassword": "cG9saWN5X3VzZXI=",
+        "databasePassword": "policy_user",
         "persistenceUnit": "PolicyMariaDb"
     },
     "preloadPolicyTypes": [
index 997959f..1ffc1d6 100644 (file)
@@ -6,7 +6,7 @@
         "userName": "healthcheck",
         "password": "zb!XztG34",
         "https": true,
-        "aaf": false 
+        "aaf": false
     },
     "databaseProviderParameters": {
         "name": "PolicyProviderParameterGroup",
@@ -14,7 +14,7 @@
         "databaseDriver": "org.mariadb.jdbc.Driver",
         "databaseUrl": "jdbc:mariadb://mariadb:3306/policyadmin",
         "databaseUser": "policy_user",
-        "databasePassword": "cG9saWN5X3VzZXI=",
+        "databasePassword": "policy_user",
         "persistenceUnit": "PolicyMariaDb"
     },
     "preloadPolicyTypes": [
diff --git a/pom.xml b/pom.xml
index 1919ed3..dd6d25f 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -5,6 +5,7 @@
   Copyright (C) 2018 Samsung Electronics Co., Ltd. All rights reserved.
   Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved.
   Modifications Copyright (C) 2019-2020 Nordix Foundation.
+  Modifications Copyright (C) 2020 Bell Canada. All rights reserved.
   ================================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
@@ -42,7 +43,7 @@
 
     <properties>
         <policy.common.version>1.7.1</policy.common.version>
-        <policy.models.version>2.3.1</policy.models.version>
+        <policy.models.version>2.3.2-SNAPSHOT</policy.models.version>
     </properties>
 
     <modules>
index 532963d..0ea9220 100644 (file)
@@ -14,7 +14,7 @@
         "databaseDriver": "org.mariadb.jdbc.Driver",
         "databaseUrl": "jdbc:mariadb://mariadb:3306/policyadmin",
         "databaseUser": "policy_user",
-        "databasePassword": "cG9saWN5X3VzZXI=",
+        "databasePassword": "policy_user",
         "persistenceUnit": "PolicyMariaDb"
     },
     "preloadPolicyTypes": [