summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-core
diff options
context:
space:
mode:
authorHima Elisetty <hbindu@research.att.com>2018-01-12 10:36:42 -0500
committerHima Elisetty <hbindu@research.att.com>2018-01-17 12:08:18 -0500
commit1298fd26f37cd451cbf1adbea68b98151662e796 (patch)
treeca09e0586c1d0d401841fc6e12228e4dbc7f2f6f /ecomp-sdk/epsdk-core
parent304033445a8333cd088910fc3e43ca9222237816 (diff)
Introduce JUNIT Plumbing
Issue-ID: PORTAL-161, PORTAL-160, PORTAL-159 Includes Change in encryption and decryption algorithm Change-Id: I5f379d6d9ac25536744152ac1d61223a52f1ce7f Signed-off-by: Hima Elisetty <hbindu@research.att.com>
Diffstat (limited to 'ecomp-sdk/epsdk-core')
-rw-r--r--ecomp-sdk/epsdk-core/pom.xml7
-rw-r--r--ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/AppConfig.java2
-rw-r--r--ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/interceptor/ResourceInterceptor.java2
-rw-r--r--ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/restful/client/PortalRestClientBase.java4
-rw-r--r--ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/RestApiRequestBuilder.java6
-rw-r--r--ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/UrlAccessImpl.java2
-rw-r--r--ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/WebServiceCallServiceImpl.java2
7 files changed, 16 insertions, 9 deletions
diff --git a/ecomp-sdk/epsdk-core/pom.xml b/ecomp-sdk/epsdk-core/pom.xml
index 49b8f901..1032c707 100644
--- a/ecomp-sdk/epsdk-core/pom.xml
+++ b/ecomp-sdk/epsdk-core/pom.xml
@@ -348,6 +348,13 @@
</exclusion>
</exclusions>
</dependency>
+ <!-- Jacoco for offline instrumentation -->
+ <dependency>
+ <groupId>org.jacoco</groupId>
+ <artifactId>org.jacoco.agent</artifactId>
+ <version>${jacoco.version}</version>
+ <classifier>runtime</classifier>
+ </dependency>
</dependencies>
</project>
diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/AppConfig.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/AppConfig.java
index 60888b6d..0620945f 100644
--- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/AppConfig.java
+++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/AppConfig.java
@@ -211,7 +211,7 @@ public class AppConfig extends WebMvcConfigurerAdapter implements Configurable,
if (SystemProperties.containsProperty(SystemProperties.DB_ENCRYPT_FLAG)) {
String encryptFlag = SystemProperties.getProperty(SystemProperties.DB_ENCRYPT_FLAG);
if (encryptFlag != null && "true".equalsIgnoreCase(encryptFlag)) {
- password = CipherUtil.decrypt(password);
+ password = CipherUtil.decryptPKC(password);
}
}
dataSource.setPassword(password);
diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/interceptor/ResourceInterceptor.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/interceptor/ResourceInterceptor.java
index 4b4d721c..de65775b 100644
--- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/interceptor/ResourceInterceptor.java
+++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/interceptor/ResourceInterceptor.java
@@ -144,7 +144,7 @@ public class ResourceInterceptor extends HandlerInterceptorAdapter {
String ecompRestURL = PortalApiProperties.getProperty(PortalApiConstants.ECOMP_REST_URL);
String decreptedPwd = null;
try {
- decreptedPwd = CipherUtil.decrypt(app.getAppPassword(),
+ decreptedPwd = CipherUtil.decryptPKC(app.getAppPassword(),
SystemProperties.getProperty(SystemProperties.Decryption_Key));
} catch (Exception e) {
logger.error(EELFLoggerDelegate.errorLogger, "handleSessionUpdates failed to decrypt password", e);
diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/restful/client/PortalRestClientBase.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/restful/client/PortalRestClientBase.java
index 2c4da43d..5f9cbdc9 100644
--- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/restful/client/PortalRestClientBase.java
+++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/restful/client/PortalRestClientBase.java
@@ -98,7 +98,7 @@ public class PortalRestClientBase {
if (uebKey == null || app == null || app.getUsername() == null || app.getAppPassword() == null)
throw new IllegalArgumentException(
"getRestWithCredentials: Missing one or more required properties and/or database entries");
- String decryptedPassword = CipherUtil.decrypt(app.getAppPassword());
+ String decryptedPassword = CipherUtil.decryptPKC(app.getAppPassword());
CloseableHttpClient httpClient = HttpClients.createDefault();
HttpGet httpGet = new HttpGet(uri);
httpGet.setHeader("uebkey", uebKey);
@@ -150,7 +150,7 @@ public class PortalRestClientBase {
if (uebKey == null || app == null || app.getUsername() == null || app.getAppPassword() == null)
throw new IllegalArgumentException(
"postRestWithCredentials: missing one or more required properties and/or database entries");
- String decryptedPassword = CipherUtil.decrypt(app.getAppPassword());
+ String decryptedPassword = CipherUtil.decryptPKC(app.getAppPassword());
CloseableHttpClient httpClient = HttpClients.createDefault();
HttpPost httpPost = new HttpPost(uri);
httpPost.setHeader("uebkey", uebKey);
diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/RestApiRequestBuilder.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/RestApiRequestBuilder.java
index c6c40b70..1b3e82cd 100644
--- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/RestApiRequestBuilder.java
+++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/RestApiRequestBuilder.java
@@ -77,7 +77,7 @@ public class RestApiRequestBuilder {
appName = app.getName();
appUserName = app.getUsername();
try {
- decryptedPwd = CipherUtil.decrypt(app.getAppPassword(),
+ decryptedPwd = CipherUtil.decryptPKC(app.getAppPassword(),
SystemProperties.getProperty(SystemProperties.Decryption_Key));
} catch (CipherUtilException e) {
logger.error(EELFLoggerDelegate.errorLogger, "getViaREST failed", e);
@@ -115,7 +115,7 @@ public class RestApiRequestBuilder {
appName = app.getName();
appUserName = app.getUsername();
try {
- decryptedPwd = CipherUtil.decrypt(app.getAppPassword(),
+ decryptedPwd = CipherUtil.decryptPKC(app.getAppPassword(),
SystemProperties.getProperty(SystemProperties.Decryption_Key));
} catch (CipherUtilException e) {
logger.error(EELFLoggerDelegate.errorLogger, "postViaREST failed", e);
@@ -152,7 +152,7 @@ public class RestApiRequestBuilder {
appName = app.getName();
appUserName = app.getUsername();
try {
- decryptedPwd = CipherUtil.decrypt(app.getAppPassword(),
+ decryptedPwd = CipherUtil.decryptPKC(app.getAppPassword(),
SystemProperties.getProperty(SystemProperties.Decryption_Key));
} catch (CipherUtilException e) {
logger.error(EELFLoggerDelegate.errorLogger, "deleteViaRest failed", e);
diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/UrlAccessImpl.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/UrlAccessImpl.java
index ddadc101..06073be4 100644
--- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/UrlAccessImpl.java
+++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/UrlAccessImpl.java
@@ -127,7 +127,7 @@ public class UrlAccessImpl implements UrlAccessService {
for (int i = 0; i < roleFunctionArray.length; i++) {
if (match) {
if (!roleFunctionArray[i].equals("*")) {
- Pattern p = Pattern.compile(path[i], Pattern.CASE_INSENSITIVE);
+ Pattern p = Pattern.compile(Pattern.quote(path[i]), Pattern.CASE_INSENSITIVE);
Matcher m = p.matcher(roleFunctionArray[i]);
match = m.matches();
diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/WebServiceCallServiceImpl.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/WebServiceCallServiceImpl.java
index 71479820..f0a17913 100644
--- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/WebServiceCallServiceImpl.java
+++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/service/WebServiceCallServiceImpl.java
@@ -69,7 +69,7 @@ public class WebServiceCallServiceImpl implements WebServiceCallService {
if (app != null) {
String encriptedPwdDB = app.getAppPassword();
String appUserName = app.getUsername();
- String decreptedPwd = CipherUtil.decrypt(encriptedPwdDB,
+ String decreptedPwd = CipherUtil.decryptPKC(encriptedPwdDB,
secretKey == null ? SystemProperties.getProperty(SystemProperties.Decryption_Key) : secretKey);
if (decreptedPwd.equals(requestPassword) && appUserName.equals(requestAppName)) {
return true;