From 1be844e494300c9c2eae7becbaf0aa9136d9278c Mon Sep 17 00:00:00 2001 From: zm330 Date: Sat, 23 May 2020 12:11:08 +0800 Subject: Update DeleteSliceService auth Issue-ID: SO-2942 Signed-off-by: zm330 Change-Id: I93015340d57e9feeba0d212bef7978a3a33d1026 --- .../infrastructure/scripts/DeleteCommunicationService.groovy | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'bpmn') diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteCommunicationService.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteCommunicationService.groovy index 84da1e4ec9..26936bfd71 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteCommunicationService.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteCommunicationService.groovy @@ -199,7 +199,7 @@ class DeleteCommunicationService extends AbstractServiceTaskProcessor { * 再次调用deleteE2EServiceInstance接口,然后获取到operationid, */ void sendRequest2NSMFWF(DelegateExecution execution) { - LOGGER.trace("begin preRequestSend2NSMF") + LOGGER.debug("begin preRequestSend2NSMF") try { //url:/onap/so/infra/e2eServiceInstances/v3/{serviceInstanceId}" def NSMF_endpoint = UrnPropertiesReader.getVariable("mso.infra.endpoint.url", execution) @@ -213,9 +213,13 @@ class DeleteCommunicationService extends AbstractServiceTaskProcessor { """ requestBody.replaceAll("\\s+", "") - String basicAuthValue = UrnPropertiesReader.getVariable("mso.infra.endpoint.auth", execution) + String msoKey = UrnPropertiesReader.getVariable("mso.msoKey", execution) + String basicAuth = UrnPropertiesReader.getVariable("mso.infra.endpoint.auth", execution) + String basicAuthValue = utils.encrypt(basicAuth, msoKey) + String encodeString = utils.getBasicAuth(basicAuthValue, msoKey) + HttpClient httpClient = getHttpClientFactory().newJsonClient(new URL(url), ONAPComponents.SO) - httpClient.addAdditionalHeader("Authorization", basicAuthValue) + httpClient.addAdditionalHeader("Authorization", encodeString) httpClient.addAdditionalHeader("Accept", "application/json") Response httpResponse = httpClient.delete(requestBody) handleNSSMFWFResponse(httpResponse, execution) @@ -228,7 +232,7 @@ class DeleteCommunicationService extends AbstractServiceTaskProcessor { exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) } - LOGGER.trace("exit preRequestSend2NSMF") + LOGGER.debug("exit preRequestSend2NSMF") } /** -- cgit 1.2.3-korg