summaryrefslogtreecommitdiffstats
path: root/adapters/mso-sdnc-adapter/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'adapters/mso-sdnc-adapter/src/main')
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/SDNCAdapterApplication.java3
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/Constants.java9
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/SDNCRestClient.java4
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/BPRestCallback.java4
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCAdapterUtils.java7
-rw-r--r--adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCConnector.java4
-rw-r--r--adapters/mso-sdnc-adapter/src/main/resources/application-local.yaml8
-rw-r--r--adapters/mso-sdnc-adapter/src/main/resources/application.yaml18
8 files changed, 29 insertions, 28 deletions
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/SDNCAdapterApplication.java b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/SDNCAdapterApplication.java
index f88aab08a6..2fd0a58dda 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/SDNCAdapterApplication.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/SDNCAdapterApplication.java
@@ -29,12 +29,9 @@ import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.context.annotation.Bean;
-import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
@SpringBootApplication(scanBasePackages = { "org.onap" })
-@EnableJpaRepositories({"org.onap.so.db.request.data.repository"})
-@EntityScan({ "org.onap.so.db.request.beans"})
public class SDNCAdapterApplication {
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/Constants.java b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/Constants.java
index d114788267..09597b26b7 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/Constants.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/Constants.java
@@ -28,13 +28,8 @@ public interface Constants {
public static final String DEFAULT_BPEL_URL = "http://localhost:8080//active-bpel/services/SDNCAdapterCallbackV1";
public static final String MY_URL_PROP = "org.onap.so.adapters.sdnc.myurl";
- public static final String DEFAULT_MY_URL = "https://localhost:8443/adapters/rest/SDNCNotify";
-
public static final String SDNC_AUTH_PROP = "org.onap.so.adapters.sdnc.sdncauth";
- public static final String DEFAULT_SDNC_AUTH = "406B2AE613211B6FB52466DE6E1769AC";
-
- public static final String DEFAULT_BPEL_AUTH = "05FDA034C27D1CA51AAB8FAE512EDE45241E16FC8C137D292AA3A964431C82DB";
- public static final String BPEL_AUTH_PROP = "org.onap.so.adapters.sdnc.bpelauth";
+ public static final String BPEL_AUTH_PROP = "org.onap.so.adapters.sdnc.bpelauth";
public static final String SDNC_SVCCFGRESP_ROOT = "input";
@@ -42,7 +37,7 @@ public interface Constants {
public static final String SDNC_RESP_CODE = "/response-code";
public static final String SDNC_RESP_MSG = "/response-message";
public static final String SDNC_CONNECTTIME_PROP = "org.onap.so.adapters.sdnc.sdncconnecttime";
- public static final String ENCRYPTION_KEY = "aa3871669d893c7fb8abbcda31b88b4f";
+ public static final String ENCRYPTION_KEY_PROP = "org.onap.so.adapters.network.encryptionKey";
public static final String REQUEST_TUNABLES = "org.onap.so.adapters.sdnc";
}
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/SDNCRestClient.java b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/SDNCRestClient.java
index 71937245bc..fd924cad79 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/SDNCRestClient.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/impl/SDNCRestClient.java
@@ -143,7 +143,7 @@ public class SDNCRestClient{
con.setConnectTimeout(Integer.parseInt(env.getProperty(Constants.SDNC_CONNECTTIME_PROP)));
con.setReadTimeout(Integer.parseInt(rt.getTimeout()));
con.setRequestProperty("Accept", "application/yang.data+xml"); //for response in xml
- String userCredentials = CryptoUtils.decryptProperty(env.getProperty(Constants.SDNC_AUTH_PROP), Constants.DEFAULT_SDNC_AUTH, Constants.ENCRYPTION_KEY);
+ String userCredentials = CryptoUtils.decrypt(env.getProperty(Constants.SDNC_AUTH_PROP), env.getProperty(Constants.ENCRYPTION_KEY_PROP));
String basicAuth = "Basic " + DatatypeConverter.printBase64Binary(userCredentials.getBytes());
con.setRequestProperty ("Authorization", basicAuth);
@@ -308,7 +308,7 @@ public class SDNCRestClient{
{
Map<String, Object> reqCtx = bp.getRequestContext();
Map<String, List<String>> headers = new HashMap<>();
- String userCredentials = CryptoUtils.decryptProperty(env.getProperty(Constants.BPEL_AUTH_PROP), Constants.DEFAULT_BPEL_AUTH, Constants.ENCRYPTION_KEY);
+ String userCredentials = CryptoUtils.decrypt(env.getProperty(Constants.BPEL_AUTH_PROP), env.getProperty(Constants.ENCRYPTION_KEY_PROP));
String basicAuth = "Basic " + DatatypeConverter.printBase64Binary(userCredentials.getBytes());
reqCtx.put(MessageContext.HTTP_REQUEST_HEADERS, headers);
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/BPRestCallback.java b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/BPRestCallback.java
index d5ce96ea5a..9c4dd5e8a0 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/BPRestCallback.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/BPRestCallback.java
@@ -119,8 +119,8 @@ public class BPRestCallback {
boolean error = false;
try {
- String userCredentials = CryptoUtils.decryptProperty(env.getProperty(Constants.BPEL_AUTH_PROP),
- Constants.DEFAULT_BPEL_AUTH, Constants.ENCRYPTION_KEY);
+ String userCredentials = CryptoUtils.decrypt(env.getProperty(Constants.BPEL_AUTH_PROP),
+ env.getProperty(Constants.ENCRYPTION_KEY_PROP));
String authorization = "Basic " + DatatypeConverter.printBase64Binary(userCredentials.getBytes());
method.setHeader("Authorization", authorization);
} catch (Exception e) {
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCAdapterUtils.java b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCAdapterUtils.java
index 05e272f867..dcb1fdae8c 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCAdapterUtils.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCAdapterUtils.java
@@ -64,12 +64,7 @@ public final class SDNCAdapterUtils {
* @param pathSegment the path segment to encode
* @return the encoded path segment
*/
- public static String encodeURLPathSegment(String pathSegment) {
- try {
+ public static String encodeURLPathSegment(String pathSegment) {
return UriUtils.encodePathSegment(pathSegment, "UTF-8");
- } catch (UnsupportedEncodingException e) {
- LOGGER.debug("Exception:", e);
- throw new RuntimeException("UTF-8 encoding is not supported");
- }
}
} \ No newline at end of file
diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCConnector.java b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCConnector.java
index 6e4fbd830e..1c5025a59d 100644
--- a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCConnector.java
+++ b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCConnector.java
@@ -114,8 +114,8 @@ public abstract class SDNCConnector {
}
- String userCredentials = CryptoUtils.decryptProperty(env.getProperty(Constants.SDNC_AUTH_PROP),
- Constants.DEFAULT_SDNC_AUTH, Constants.ENCRYPTION_KEY);
+ String userCredentials = CryptoUtils.decrypt(env.getProperty(Constants.SDNC_AUTH_PROP),
+ env.getProperty(Constants.ENCRYPTION_KEY_PROP));
String authorization = "Basic " + DatatypeConverter.printBase64Binary(userCredentials.getBytes());
if(null != method) {
method.setHeader("Authorization", authorization);
diff --git a/adapters/mso-sdnc-adapter/src/main/resources/application-local.yaml b/adapters/mso-sdnc-adapter/src/main/resources/application-local.yaml
index 44f295e425..4141548c29 100644
--- a/adapters/mso-sdnc-adapter/src/main/resources/application-local.yaml
+++ b/adapters/mso-sdnc-adapter/src/main/resources/application-local.yaml
@@ -17,7 +17,7 @@ org:
onap:
so:
adapters:
- sdnc:
+ sdnc:
'.':
put: PUT|60000|sdncurl5|
query: GET|60000|sdncurl2|
@@ -57,7 +57,7 @@ org:
changedelete: POST|270000|sdncurl6|sdnc-request-header|org:onap:sdnctl:vnf
delete: POST|270000|sdncurl6|sdnc-request-header|org:onap:sdnctl:vnf
rollback: POST|270000|sdncurl6|sdnc-request-header|org:onap:sdnctl:vnf
- bpelauth: 9997930a04f74e8dfd3acedf6be6f8c2ec4fb3720521304f64a468ba54ef1e14
+ bpelauth: BBD450258299BD2FEF7E3EBA3CD2B58AD417355332319856D761654AA876830A9839820D33DE8426A81E5D48649A4BE6FE7021F5
bpelurl: http://localhost:8080/mso/SDNCAdapterCallbackService
generic-resource:
network-topology-operation:
@@ -92,7 +92,7 @@ org:
myurl: http://localhost:8080/adapters/rest/SDNCNotify
rest:
bpelurl: http://localhost:8080/mso/WorkflowMessage
- sdncauth: 406B2AE613211B6FB52466DE6E1769AC
+ sdncauth: 1C2DC9B30545C5F673B3C33904608E942476F0C969B3CF7A2509459AB83C9062EFAAE89E91D6DB
sdncconnecttime: 5000
sdncurl10: 'https://localhost:8443/restconf/operations/GENERIC-RESOURCE-API:'
sdncurl12: https://localhost:8443/
@@ -101,6 +101,8 @@ org:
vfmodule:
'':
query: GET|60000|sdncurl12|
+ network:
+ encryptionKey: aa3871669d893c7fb8abbcda31b88b4f
spring:
security:
usercredentials:
diff --git a/adapters/mso-sdnc-adapter/src/main/resources/application.yaml b/adapters/mso-sdnc-adapter/src/main/resources/application.yaml
index 185bc5cbd1..6009eff016 100644
--- a/adapters/mso-sdnc-adapter/src/main/resources/application.yaml
+++ b/adapters/mso-sdnc-adapter/src/main/resources/application.yaml
@@ -12,11 +12,23 @@ mso:
queue-capacity: 500
#Actuator
-management:
- context-path: /manage
+management:
+ endpoints:
+ web:
+ base-path: /manage
+ server:
+ servlet:
+ context-path: /manage
metrics:
se-global-registry: false
export:
prometheus:
enabled: true # Whether exporting of metrics to Prometheus is enabled.
- step: 1m # Step size (i.e. reporting frequency) to use. \ No newline at end of file
+ step: 1m # Step size (i.e. reporting frequency) to use.
+
+org:
+ onap:
+ so:
+ adapters:
+ network:
+ encryptionKey: aa3871669d893c7fb8abbcda31b88b4f