From c5222a72ef11bd440f5c2bd017e820922ff6735a Mon Sep 17 00:00:00 2001 From: danielhanrahan Date: Wed, 28 Feb 2024 16:05:07 +0000 Subject: Add bearer token to NCMP passthrough operations (CPS-2126 #2) For NCMP resource data passthrough operations, accept an authorization header and propagate it to outgoing DMI request if it has a bearer token, otherwise use same behaviour as before Issue-ID: CPS-2128 Change-Id: Ib3bf401abce4221a8b706989fb6f07618aa33fe2 Signed-off-by: danielhanrahan --- .../controller/NetworkCmProxyStubController.java | 36 +++++++++++++--------- 1 file changed, 21 insertions(+), 15 deletions(-) (limited to 'cps-ncmp-rest-stub/cps-ncmp-rest-stub-service') diff --git a/cps-ncmp-rest-stub/cps-ncmp-rest-stub-service/src/main/java/org/onap/cps/ncmp/rest/stub/controller/NetworkCmProxyStubController.java b/cps-ncmp-rest-stub/cps-ncmp-rest-stub-service/src/main/java/org/onap/cps/ncmp/rest/stub/controller/NetworkCmProxyStubController.java index 0e4f7f987f..08a492e0f7 100644 --- a/cps-ncmp-rest-stub/cps-ncmp-rest-stub-service/src/main/java/org/onap/cps/ncmp/rest/stub/controller/NetworkCmProxyStubController.java +++ b/cps-ncmp-rest-stub/cps-ncmp-rest-stub-service/src/main/java/org/onap/cps/ncmp/rest/stub/controller/NetworkCmProxyStubController.java @@ -69,7 +69,8 @@ public class NetworkCmProxyStubController implements NetworkCmProxyApi { final String resourceIdentifier, final String optionsParamInQuery, final String topicParamInQuery, - final Boolean includeDescendants) { + final Boolean includeDescendants, + final String authorization) { if (DatastoreType.PASSTHROUGH_OPERATIONAL == DatastoreType.fromDatastoreName(datastoreName)) { final ResponseEntity> asyncResponse = populateAsyncResponse(topicParamInQuery); final Map asyncResponseData = asyncResponse.getBody(); @@ -142,16 +143,18 @@ public class NetworkCmProxyStubController implements NetworkCmProxyApi { @Override public ResponseEntity createResourceDataRunningForCmHandle(final String datastoreName, final String cmHandle, - @NotNull @Valid final String resourceIdentifier, - @Valid final Object body, - final String contentType) { + @NotNull @Valid final String resourceIdentifier, + @Valid final Object body, + final String contentType, + final String authorization) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } - + @Override public ResponseEntity deleteResourceDataRunningForCmHandle(final String datastoreName, final String cmHandle, @NotNull @Valid final String resourceIdentifier, - final String contentType) { + final String contentType, + final String authorization) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -180,18 +183,20 @@ public class NetworkCmProxyStubController implements NetworkCmProxyApi { @Override public ResponseEntity executeDataOperationForCmHandles(final String topicParamInQuery, - final DataOperationRequest dataOperationRequest) { + final DataOperationRequest dataOperationRequest, + final String authorization) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @Override public ResponseEntity patchResourceDataRunningForCmHandle(final String datastoreName, final String cmHandle, - @NotNull @Valid final String resourceIdentifier, - @Valid final Object body, - final String contentType) { + @NotNull @Valid final String resourceIdentifier, + @Valid final Object body, + final String contentType, + final String authorization) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } - + @Override public ResponseEntity queryResourceDataForCmHandle(final String datastoreName, final String cmHandle, @Valid final String cpsPath, @Valid final String options, @@ -220,11 +225,12 @@ public class NetworkCmProxyStubController implements NetworkCmProxyApi { } @Override - public ResponseEntity updateResourceDataRunningForCmHandle(final String datastoreName, - final String cmHandle, - @NotNull @Valid final String resourceIdentifier, + public ResponseEntity updateResourceDataRunningForCmHandle(final String datastoreName, + final String cmHandle, + @NotNull @Valid final String resourceIdentifier, @Valid final Object body, - final String contentType) { + final String contentType, + final String authorization) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } -- cgit 1.2.3-korg