Merge "Remove legacy password encryption"
authorSébastien Determe <sebastien.determe@intl.att.com>
Tue, 21 Apr 2020 13:33:42 +0000 (13:33 +0000)
committerGerrit Code Review <gerrit@onap.org>
Tue, 21 Apr 2020 13:33:42 +0000 (13:33 +0000)
README.md
extra/docker/clamp/clamp.env
src/main/java/org/onap/clamp/clds/Application.java
src/main/java/org/onap/clamp/clds/config/EncodedPasswordBasicDataSource.java [deleted file]
src/main/java/org/onap/clamp/clds/config/spring/CldsConfiguration.java
src/main/resources/application-noaaf.properties
src/main/resources/application.properties
src/test/resources/application.properties
src/test/resources/https/https-test.properties

index 65fc053..e4309aa 100644 (file)
--- a/README.md
+++ b/README.md
@@ -41,9 +41,9 @@ Note that all others configurations can be configured in the JSON as well,
 
 ```json
 {
-    "spring.datasource.cldsdb.url": "jdbc:mysql://anotherDB.onap.org:3306/cldsdb4?autoReconnect=true&connectTimeout=10000&socketTimeout=10000&retriesAllDown=3",
-    "spring.datasource.cldsdb.username": "admin",
-    "spring.datasource.cldsdb.password": "password"
+    "spring.datasource.url": "jdbc:mysql://anotherDB.onap.org:3306/cldsdb4?autoReconnect=true&connectTimeout=10000&socketTimeout=10000&retriesAllDown=3",
+    "spring.datasource.username": "admin",
+    "spring.datasource.password": "password"
     
     "clamp.config.dcae.inventory.url": "http://dcaegen2.host:8080",
     "clamp.config.dcae.dispatcher.url": "http://dcaegen2.host:8080",
index 3270db2..fc80be5 100644 (file)
@@ -1,2 +1,2 @@
 ### Be careful, this must be in one line only ###
-SPRING_APPLICATION_JSON={"spring.datasource.cldsdb.url":"jdbc:mariadb:sequential://db:3306/cldsdb4?autoReconnect=true&connectTimeout=10000&socketTimeout=10000&retriesAllDown=3","spring.profiles.active":"clamp-default,clamp-default-user,clamp-sdc-controller,clamp-ssl-config","clamp.config.policy.api.url":"http4://third-party-proxy:8085","clamp.config.policy.pap.url":"http4://third-party-proxy:8085","clamp.config.dcae.inventory.url":"http://third-party-proxy:8085","clamp.config.dcae.deployment.url":"http4://third-party-proxy:8085"}
+SPRING_APPLICATION_JSON={"spring.datasource.url":"jdbc:mariadb:sequential://db:3306/cldsdb4?autoReconnect=true&connectTimeout=10000&socketTimeout=10000&retriesAllDown=3","spring.profiles.active":"clamp-default,clamp-default-user,clamp-sdc-controller,clamp-ssl-config","clamp.config.policy.api.url":"http4://third-party-proxy:8085","clamp.config.policy.pap.url":"http4://third-party-proxy:8085","clamp.config.dcae.inventory.url":"http://third-party-proxy:8085","clamp.config.dcae.deployment.url":"http4://third-party-proxy:8085"}
index 63320d2..8423299 100644 (file)
@@ -65,8 +65,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
 import org.springframework.transaction.annotation.EnableTransactionManagement;
 
 @ComponentScan(basePackages = { "org.onap.clamp" })
-@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class, SecurityAutoConfiguration.class,
-    UserDetailsServiceAutoConfiguration.class })
+@SpringBootApplication(exclude = { SecurityAutoConfiguration.class, UserDetailsServiceAutoConfiguration.class })
 @EnableJpaRepositories(basePackages = { "org.onap.clamp" })
 @EntityScan(basePackages = { "org.onap.clamp" })
 @EnableTransactionManagement
diff --git a/src/main/java/org/onap/clamp/clds/config/EncodedPasswordBasicDataSource.java b/src/main/java/org/onap/clamp/clds/config/EncodedPasswordBasicDataSource.java
deleted file mode 100644 (file)
index 0d39cd5..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP CLAMP
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. 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. 
- * You may obtain a copy of the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software 
- * distributed under the License is distributed on an "AS IS" BASIS, 
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
- * See the License for the specific language governing permissions and 
- * limitations under the License.
- * ============LICENSE_END============================================
- * ===================================================================
- * 
- */
-
-package org.onap.clamp.clds.config;
-
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
-
-import java.security.GeneralSecurityException;
-
-import org.apache.commons.codec.DecoderException;
-import org.apache.commons.dbcp.BasicDataSource;
-import org.onap.clamp.clds.util.CryptoUtils;
-
-/**
- * This class is an extension of the standard datasource, it will be used to
- * decode the encoded password defined in the application.properties.
- *
- */
-public class EncodedPasswordBasicDataSource extends BasicDataSource {
-    protected static final EELFLogger logger        = EELFManager.getInstance()
-            .getLogger(EncodedPasswordBasicDataSource.class);
-    protected static final EELFLogger metricsLogger = EELFManager.getInstance().getMetricsLogger();
-
-    /**
-     * This method is used automatically by Spring to decode the password.
-     */
-    @Override
-    public synchronized void setPassword(String encodedPassword) {
-        try {
-            this.password = CryptoUtils.decrypt(encodedPassword);
-        } catch (GeneralSecurityException e) {
-            logger.error("Unable to decrypt the DB password", e);
-        } catch (DecoderException e) {
-            logger.error("Exception caught when decoding the HEX String Key for encryption", e);
-        }
-    }
-}
\ No newline at end of file
index b247846..14c08c8 100644 (file)
 
 package org.onap.clamp.clds.config.spring;
 
-import javax.sql.DataSource;
-
 import org.onap.clamp.clds.config.ClampProperties;
-import org.onap.clamp.clds.config.EncodedPasswordBasicDataSource;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.config.PropertiesFactoryBean;
-import org.springframework.boot.context.properties.ConfigurationProperties;
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
@@ -44,16 +40,6 @@ public class CldsConfiguration {
     @Autowired
     private ClampProperties refProp;
 
-    /**
-     * Clds Identity database DataSource configuration.
-     *
-     * @return encoded password data source
-     */
-    @Bean(name = "cldsDataSource")
-    @ConfigurationProperties(prefix = "spring.datasource.cldsdb")
-    public DataSource cldsDataSource() {
-        return new EncodedPasswordBasicDataSource();
-    }
 
     /**
      * This loads the file system.properties.
index 044fcec..fba4134 100644 (file)
@@ -96,21 +96,21 @@ camel.springboot.xmlRests=classpath:/clds/camel/rest/*.xml
 #camel.springboot.typeConversion = false
 
 #clds datasource connection details
-spring.datasource.cldsdb.driverClassName=org.mariadb.jdbc.Driver
-spring.datasource.cldsdb.url=jdbc:mariadb:sequential://localhost:3306/cldsdb4?autoReconnect=true&connectTimeout=10000&socketTimeout=10000&retriesAllDown=3
-spring.datasource.cldsdb.username=clds
-spring.datasource.cldsdb.password=4c90a0b48204383f4283448d23e0b885a47237b2a23588e7c4651604f51c1067
-spring.datasource.cldsdb.validationQuery=SELECT 1
-spring.datasource.cldsdb.validationQueryTimeout=20000
-spring.datasource.cldsdb.validationInterval=30000
-spring.datasource.cldsdb.testWhileIdle = true
-spring.datasource.cldsdb.minIdle = 0
-spring.datasource.cldsdb.initialSize=0
+spring.datasource.driverClassName=org.mariadb.jdbc.Driver
+spring.datasource.url=jdbc:mariadb:sequential://localhost:3306/cldsdb4?autoReconnect=true&connectTimeout=10000&socketTimeout=10000&retriesAllDown=3
+spring.datasource.username=clds
+spring.datasource.password=sidnnd83K
+spring.datasource.validationQuery=SELECT 1
+spring.datasource.validationQueryTimeout=20000
+spring.datasource.validationInterval=30000
+spring.datasource.testWhileIdle = true
+spring.datasource.minIdle = 0
+spring.datasource.initialSize=0
 # Automatically test whether a connection provided is good or not
-spring.datasource.cldsdb.testOnBorrow=true
-spring.datasource.cldsdb.ignoreExceptionOnPreLoad=true
+spring.datasource.testOnBorrow=true
+spring.datasource.ignoreExceptionOnPreLoad=true
 # control the sql db initialization (from schema.sql and data.sql)
-spring.datasource.initialize=false
+spring.datasource..initialize=false
 
 spring.jpa.properties.javax.persistence.schema-generation.database.action=none
 s#pring.jpa.properties.javax.persistence.schema-generation.create-source=metadata
index 3069cf6..c5bab26 100644 (file)
@@ -100,19 +100,19 @@ camel.springboot.xmlRests=classpath:/clds/camel/rest/*.xml
 #camel.springboot.typeConversion = false
 
 #clds datasource connection details
-spring.datasource.cldsdb.driverClassName=org.mariadb.jdbc.Driver
-spring.datasource.cldsdb.url=jdbc:mariadb:sequential://localhost:3306/cldsdb4?autoReconnect=true&connectTimeout=10000&socketTimeout=10000&retriesAllDown=3
-spring.datasource.cldsdb.username=clds
-spring.datasource.cldsdb.password=4c90a0b48204383f4283448d23e0b885a47237b2a23588e7c4651604f51c1067
-spring.datasource.cldsdb.validationQuery=SELECT 1
-spring.datasource.cldsdb.validationQueryTimeout=20000
-spring.datasource.cldsdb.validationInterval=30000
-spring.datasource.cldsdb.testWhileIdle = true
-spring.datasource.cldsdb.minIdle = 0
-spring.datasource.cldsdb.initialSize=0
+spring.datasource.driverClassName=org.mariadb.jdbc.Driver
+spring.datasource.url=jdbc:mariadb:sequential://localhost:3306/cldsdb4?autoReconnect=true&connectTimeout=10000&socketTimeout=10000&retriesAllDown=3
+spring.datasource.username=clds
+spring.datasource.password=sidnnd83K
+spring.datasource.validationQuery=SELECT 1
+spring.datasource.validationQueryTimeout=20000
+spring.datasource.validationInterval=30000
+spring.datasource.testWhileIdle = true
+spring.datasource.minIdle = 0
+spring.datasource.initialSize=0
 # Automatically test whether a connection provided is good or not
-spring.datasource.cldsdb.testOnBorrow=true
-spring.datasource.cldsdb.ignoreExceptionOnPreLoad=true
+spring.datasource.testOnBorrow=true
+spring.datasource.ignoreExceptionOnPreLoad=true
 
 spring.jpa.properties.javax.persistence.schema-generation.database.action=none
 #spring.jpa.properties.javax.persistence.schema-generation.create-source=metadata
index ea17836..a8ec7ad 100644 (file)
@@ -85,19 +85,19 @@ camel.springboot.xmlRests=classpath:/clds/camel/rest/*.xml
 #camel.springboot.typeConversion = false
 
 #clds datasource connection details
-spring.datasource.cldsdb.driverClassName=org.mariadb.jdbc.Driver
-spring.datasource.cldsdb.url=jdbc:mariadb:sequential://localhost:3306,localhost:${docker.mariadb.port.host}/cldsdb4?autoReconnect=true&connectTimeout=10000&socketTimeout=10000&retriesAllDown=3
-spring.datasource.cldsdb.username=clds
-spring.datasource.cldsdb.password=4c90a0b48204383f4283448d23e0b885a47237b2a23588e7c4651604f51c1067
-spring.datasource.cldsdb.validationQuery=SELECT 1
-spring.datasource.cldsdb.validationQueryTimeout=20000
-spring.datasource.cldsdb.validationInterval=30000
-spring.datasource.cldsdb.testWhileIdle = true
-spring.datasource.cldsdb.minIdle = 0
-spring.datasource.cldsdb.initialSize=0
+spring.datasource.driverClassName=org.mariadb.jdbc.Driver
+spring.datasource.url=jdbc:mariadb:sequential://localhost:3306,localhost:${docker.mariadb.port.host}/cldsdb4?autoReconnect=true&connectTimeout=10000&socketTimeout=10000&retriesAllDown=3
+spring.datasource.username=clds
+spring.datasource.password=sidnnd83K
+spring.datasource.validationQuery=SELECT 1
+spring.datasource.validationQueryTimeout=20000
+spring.datasource.validationInterval=30000
+spring.datasource.testWhileIdle = true
+spring.datasource.minIdle = 0
+spring.datasource.initialSize=0
 # Automatically test whether a connection provided is good or not
-spring.datasource.cldsdb.testOnBorrow=true
-spring.datasource.cldsdb.ignoreExceptionOnPreLoad=true
+spring.datasource.testOnBorrow=true
+spring.datasource.ignoreExceptionOnPreLoad=true
 
 spring.jpa.properties.javax.persistence.schema-generation.database.action=none
 #spring.jpa.properties.javax.persistence.schema-generation.create-source=metadata
index 46bca15..df1823f 100644 (file)
@@ -72,19 +72,19 @@ spring.profiles.active=clamp-default, clamp-aaf-authentication,clamp-ssl-config
 
 
 #clds datasource connection details
-spring.datasource.cldsdb.driverClassName=org.mariadb.jdbc.Driver
-spring.datasource.cldsdb.url=jdbc:mariadb:sequential://localhost:${docker.mariadb.port.host}/cldsdb4?autoReconnect=true&retriesAllDown=2147483647&failoverLoopRetries=2147483647
-spring.datasource.cldsdb.username=clds
-spring.datasource.cldsdb.password=4c90a0b48204383f4283448d23e0b885a47237b2a23588e7c4651604f51c1067
-spring.datasource.cldsdb.validationQuery=SELECT 1
-spring.datasource.cldsdb.validationQueryTimeout=20000
-spring.datasource.cldsdb.validationInterval=30000
-spring.datasource.cldsdb.testWhileIdle = true
-spring.datasource.cldsdb.minIdle = 0
-spring.datasource.cldsdb.initialSize=0
+spring.datasource.driverClassName=org.mariadb.jdbc.Driver
+spring.datasource.url=jdbc:mariadb:sequential://localhost:${docker.mariadb.port.host}/cldsdb4?autoReconnect=true&retriesAllDown=2147483647&failoverLoopRetries=2147483647
+spring.datasource.username=clds
+spring.datasource.password=sidnnd83K
+spring.datasource.validationQuery=SELECT 1
+spring.datasource.validationQueryTimeout=20000
+spring.datasource.validationInterval=30000
+spring.datasource.testWhileIdle = true
+spring.datasource.minIdle = 0
+spring.datasource.initialSize=0
 # Automatically test whether a connection provided is good or not
-spring.datasource.cldsdb.testOnBorrow=true
-spring.datasource.cldsdb.ignoreExceptionOnPreLoad=true
+spring.datasource.testOnBorrow=true
+spring.datasource.ignoreExceptionOnPreLoad=true
 
 camel.springboot.consumer-template-cache-size=1000
 camel.springboot.producer-template-cache-size=1000