diff options
author | danielhanrahan <daniel.hanrahan@est.tech> | 2024-02-28 16:05:07 +0000 |
---|---|---|
committer | danielhanrahan <daniel.hanrahan@est.tech> | 2024-02-29 12:21:52 +0000 |
commit | c5222a72ef11bd440f5c2bd017e820922ff6735a (patch) | |
tree | 072780e0dc9426a0828f29447eedeb4e4f75116d /dmi-plugin-demo-and-csit-stub/dmi-plugin-demo-and-csit-stub-service | |
parent | 181c63d7007e685657cbd0d2c9b7693a073835dc (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 'dmi-plugin-demo-and-csit-stub/dmi-plugin-demo-and-csit-stub-service')
-rw-r--r-- | dmi-plugin-demo-and-csit-stub/dmi-plugin-demo-and-csit-stub-service/src/main/java/org/onap/cps/ncmp/dmi/rest/stub/controller/DmiRestStubController.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/dmi-plugin-demo-and-csit-stub/dmi-plugin-demo-and-csit-stub-service/src/main/java/org/onap/cps/ncmp/dmi/rest/stub/controller/DmiRestStubController.java b/dmi-plugin-demo-and-csit-stub/dmi-plugin-demo-and-csit-stub-service/src/main/java/org/onap/cps/ncmp/dmi/rest/stub/controller/DmiRestStubController.java index 9d5e383b1c..b536c75fb6 100644 --- a/dmi-plugin-demo-and-csit-stub/dmi-plugin-demo-and-csit-stub-service/src/main/java/org/onap/cps/ncmp/dmi/rest/stub/controller/DmiRestStubController.java +++ b/dmi-plugin-demo-and-csit-stub/dmi-plugin-demo-and-csit-stub-service/src/main/java/org/onap/cps/ncmp/dmi/rest/stub/controller/DmiRestStubController.java @@ -52,6 +52,7 @@ import org.springframework.kafka.core.KafkaTemplate; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @@ -118,7 +119,7 @@ public class DmiRestStubController { } /** - * Get resource data from passthrough operational or running for a cm handle. + * Create resource data from passthrough operational or running for a cm handle. * * @param cmHandleId The identifier for a network function, network element, subnetwork, * or any other cm object by managed Network CM Proxy @@ -134,7 +135,9 @@ public class DmiRestStubController { @PathVariable("datastoreName") final String datastoreName, @RequestParam(value = "resourceIdentifier") final String resourceIdentifier, @RequestParam(value = "options", required = false) final String options, - @RequestParam(value = "topic", required = false) final String topic) { + @RequestParam(value = "topic", required = false) final String topic, + @RequestHeader(value = "Authorization", required = false) final String authorization) { + log.info("DMI AUTH HEADER: {}", authorization); delay(dataForCmHandleDelayMs); final String sampleJson = ResourceFileReaderUtil.getResourceFileContent(applicationContext.getResource( ResourceLoader.CLASSPATH_URL_PREFIX + "data/operational/ietf-network-topology-sample-rfc8345.json")); |