aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeshu Kumar M <seshu.kumar.m@huawei.com>2018-12-05 03:58:34 +0000
committerGerrit Code Review <gerrit@onap.org>2018-12-05 03:58:34 +0000
commit12b82667b31640f815a973dc0762f78254165a52 (patch)
treee9c7a890a58ef649432068675efd69a545c9ad4e
parent0f8c365d5585875e7647e5863ea92dc5737e63b7 (diff)
parent00252f954034db74056a1d1cf28adb0cc2c8fa34 (diff)
Merge "Fix auth for catalog db"
-rw-r--r--adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/CatalogDbAdapterRest.java15
-rw-r--r--bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeleteE2EServiceInstance.bpmn6
-rw-r--r--common/src/main/java/org/onap/so/client/HttpClient.java1
3 files changed, 14 insertions, 8 deletions
diff --git a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/CatalogDbAdapterRest.java b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/CatalogDbAdapterRest.java
index 2fc1c3d70a..8c323af71b 100644
--- a/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/CatalogDbAdapterRest.java
+++ b/adapters/mso-catalog-db-adapter/src/main/java/org/onap/so/adapters/catalogdb/rest/CatalogDbAdapterRest.java
@@ -520,13 +520,20 @@ public class CatalogDbAdapterRest {
try {
if (smUuid != null && !"".equals(smUuid)) {
logger.debug("Query Csar by service model uuid: {}",smUuid);
- ToscaCsar toscaCsar = toscaCsarRepo.findById(smUuid).orElseGet(() -> null);
- if (toscaCsar != null) {
- QueryServiceCsar serviceCsar = new QueryServiceCsar(toscaCsar);
- entity = serviceCsar.JSON2(false, false);
+ Service service = serviceRepo.findFirstOneByModelUUIDOrderByModelVersionDesc(smUuid);
+
+ if (service != null) {
+ ToscaCsar toscaCsar = service.getCsar();
+ if (toscaCsar != null) {
+ QueryServiceCsar serviceCsar = new QueryServiceCsar(toscaCsar);
+ entity = serviceCsar.JSON2(false, false);
+ } else {
+ respStatus = HttpStatus.SC_NOT_FOUND;
+ }
} else {
respStatus = HttpStatus.SC_NOT_FOUND;
}
+
} else {
throw (new Exception("Incoming parameter is null or blank"));
}
diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeleteE2EServiceInstance.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeleteE2EServiceInstance.bpmn
index 17f6c66e4a..6084f570ce 100644
--- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeleteE2EServiceInstance.bpmn
+++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeleteE2EServiceInstance.bpmn
@@ -189,7 +189,7 @@ dcsi.postDecomposeService(execution)]]></bpmn:script>
<camunda:inputParameter name="headers">
<camunda:map>
<camunda:entry key="content-type">application/soap+xml</camunda:entry>
- <camunda:entry key="Authorization">Basic QlBFTENsaWVudDpwYXNzd29yZDEk</camunda:entry>
+ <camunda:entry key="Authorization">${UrnPropertiesReader.getVariable("mso.adapters.requestDb.auth", execution)}</camunda:entry>
</camunda:map>
</camunda:inputParameter>
<camunda:inputParameter name="payload">${CVFMI_updateServiceOperStatusRequest}</camunda:inputParameter>
@@ -206,12 +206,12 @@ dcsi.postDecomposeService(execution)]]></bpmn:script>
<bpmn:scriptTask id="ScriptTask_0f3tjbn" name="prepare update service operation status" scriptFormat="groovy">
<bpmn:incoming>SequenceFlow_0h5c1bd</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_1ab3vex</bpmn:outgoing>
- <bpmn:script><![CDATA[import org.onap.so.bpmn.infrastructure.scripts.*
+ <bpmn:script>import org.onap.so.bpmn.infrastructure.scripts.*
execution.setVariable("progress", "100")
execution.setVariable("result", "finished")
execution.setVariable("operationContent", "No actual resoure in service instance")
def csi= new DoDeleteE2EServiceInstance()
-csi.prepareUpdateServiceOperationStatus(execution)]]></bpmn:script>
+csi.prepareUpdateServiceOperationStatus(execution)</bpmn:script>
</bpmn:scriptTask>
<bpmn:intermediateCatchEvent id="IntermediateCatchEvent_0hrkmxb" name="End Delete Process">
<bpmn:outgoing>SequenceFlow_0h5c1bd</bpmn:outgoing>
diff --git a/common/src/main/java/org/onap/so/client/HttpClient.java b/common/src/main/java/org/onap/so/client/HttpClient.java
index 12f19ac607..66e970a154 100644
--- a/common/src/main/java/org/onap/so/client/HttpClient.java
+++ b/common/src/main/java/org/onap/so/client/HttpClient.java
@@ -47,7 +47,6 @@ public class HttpClient extends RestClient {
@Override
protected void initializeHeaderMap(Map<String, String> headerMap) {
-
}
@Override