From bdef9f5dfd8c95eff86e710ef94c1fab4e652854 Mon Sep 17 00:00:00 2001 From: Chenfei Gao Date: Fri, 28 Feb 2020 14:45:48 -0500 Subject: Build XACML PDP support for native xacml policy type Added a new native application to the service loader framework Added a new translator for the native application Added custom serialization providers for xacml+json and xacml+xml Added a new endpoint for native xacml decision api Added a new api provider function to handle the native xacml api calls Added corresponding junit tests Issue-ID: POLICY-2182 Change-Id: I30fa4637612c324d543f9952386cf1a27a52d76c Signed-off-by: Chenfei Gao --- .../decisions/decision.native.request.xml | 19 +++++++++ .../decisions/decision.native.response.xml | 14 +++++++ .../decisions/decision.single.output.json | 46 ++++++++++++++++++++++ .../resources/decisions/decsion.single.output.json | 46 ---------------------- 4 files changed, 79 insertions(+), 46 deletions(-) create mode 100644 main/src/test/resources/decisions/decision.native.request.xml create mode 100644 main/src/test/resources/decisions/decision.native.response.xml create mode 100644 main/src/test/resources/decisions/decision.single.output.json delete mode 100644 main/src/test/resources/decisions/decsion.single.output.json (limited to 'main/src/test/resources/decisions') diff --git a/main/src/test/resources/decisions/decision.native.request.xml b/main/src/test/resources/decisions/decision.native.request.xml new file mode 100644 index 00000000..3fe984a4 --- /dev/null +++ b/main/src/test/resources/decisions/decision.native.request.xml @@ -0,0 +1,19 @@ + + + + + Julius Hibbert + + + + + http://medico.com/record/patient/BartSimpson + + + + + read + + + + \ No newline at end of file diff --git a/main/src/test/resources/decisions/decision.native.response.xml b/main/src/test/resources/decisions/decision.native.response.xml new file mode 100644 index 00000000..8c484e0a --- /dev/null +++ b/main/src/test/resources/decisions/decision.native.response.xml @@ -0,0 +1,14 @@ + + + + Permit + + + + + \ No newline at end of file diff --git a/main/src/test/resources/decisions/decision.single.output.json b/main/src/test/resources/decisions/decision.single.output.json new file mode 100644 index 00000000..707a3964 --- /dev/null +++ b/main/src/test/resources/decisions/decision.single.output.json @@ -0,0 +1,46 @@ +{ + "policies": { + "onap.scaleout.tca": { + "type": "onap.policies.monitoring.cdap.tca.hi.lo.app", + "version": "1.0.0", + "metadata": { + "policy-id": "onap.scaleout.tca", + "policy-version": 1 + }, + "properties": { + "tca_policy": { + "domain": "measurementsForVfScaling", + "metricsPerEventName": [ + { + "eventName": "vLoadBalancer", + "controlLoopSchemaType": "VNF", + "policyScope": "type=configuration", + "policyName": "onap.scaleout.tca", + "policyVersion": "v0.0.1", + "thresholds": [ + { + "closedLoopControlName": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3", + "closedLoopEventStatus": "ONSET", + "version": "1.0.2", + "fieldPath": "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated", + "thresholdValue": 500, + "direction": "LESS_OR_EQUAL", + "severity": "MAJOR" + }, + { + "closedLoopControlName": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3", + "closedLoopEventStatus": "ONSET", + "version": "1.0.2", + "fieldPath": "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated", + "thresholdValue": 5000, + "direction": "GREATER_OR_EQUAL", + "severity": "CRITICAL" + } + ] + } + ] + } + } + } + } +} \ No newline at end of file diff --git a/main/src/test/resources/decisions/decsion.single.output.json b/main/src/test/resources/decisions/decsion.single.output.json deleted file mode 100644 index 707a3964..00000000 --- a/main/src/test/resources/decisions/decsion.single.output.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "policies": { - "onap.scaleout.tca": { - "type": "onap.policies.monitoring.cdap.tca.hi.lo.app", - "version": "1.0.0", - "metadata": { - "policy-id": "onap.scaleout.tca", - "policy-version": 1 - }, - "properties": { - "tca_policy": { - "domain": "measurementsForVfScaling", - "metricsPerEventName": [ - { - "eventName": "vLoadBalancer", - "controlLoopSchemaType": "VNF", - "policyScope": "type=configuration", - "policyName": "onap.scaleout.tca", - "policyVersion": "v0.0.1", - "thresholds": [ - { - "closedLoopControlName": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3", - "closedLoopEventStatus": "ONSET", - "version": "1.0.2", - "fieldPath": "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated", - "thresholdValue": 500, - "direction": "LESS_OR_EQUAL", - "severity": "MAJOR" - }, - { - "closedLoopControlName": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3", - "closedLoopEventStatus": "ONSET", - "version": "1.0.2", - "fieldPath": "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated", - "thresholdValue": 5000, - "direction": "GREATER_OR_EQUAL", - "severity": "CRITICAL" - } - ] - } - ] - } - } - } - } -} \ No newline at end of file -- cgit 1.2.3-korg