aboutsummaryrefslogtreecommitdiffstats
path: root/cps-ncmp-rest-stub
diff options
context:
space:
mode:
authordanielhanrahan <daniel.hanrahan@est.tech>2024-02-28 16:05:07 +0000
committerdanielhanrahan <daniel.hanrahan@est.tech>2024-02-29 12:21:52 +0000
commitc5222a72ef11bd440f5c2bd017e820922ff6735a (patch)
tree072780e0dc9426a0828f29447eedeb4e4f75116d /cps-ncmp-rest-stub
parent181c63d7007e685657cbd0d2c9b7693a073835dc (diff)
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 <daniel.hanrahan@est.tech>
Diffstat (limited to 'cps-ncmp-rest-stub')
-rw-r--r--cps-ncmp-rest-stub/cps-ncmp-rest-stub-service/src/main/java/org/onap/cps/ncmp/rest/stub/controller/NetworkCmProxyStubController.java36
1 files changed, 21 insertions, 15 deletions
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<Map<String, Object>> asyncResponse = populateAsyncResponse(topicParamInQuery);
final Map<String, Object> asyncResponseData = asyncResponse.getBody();
@@ -142,16 +143,18 @@ public class NetworkCmProxyStubController implements NetworkCmProxyApi {
@Override
public ResponseEntity<Void> 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<Void> 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<Object> executeDataOperationForCmHandles(final String topicParamInQuery,
- final DataOperationRequest dataOperationRequest) {
+ final DataOperationRequest dataOperationRequest,
+ final String authorization) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
}
@Override
public ResponseEntity<Object> 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<Object> 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<Object> updateResourceDataRunningForCmHandle(final String datastoreName,
- final String cmHandle,
- @NotNull @Valid final String resourceIdentifier,
+ public ResponseEntity<Object> 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);
}