policy/xacml-pdp.git
4 years agoFix optimization bug add coverage plus 31/103431/5
Pamela Dragosh [Tue, 10 Mar 2020 11:54:05 +0000 (07:54 -0400)]
Fix optimization bug add coverage plus

Fix a NPE bug and add more code coverage.

Also is missing returning of context details for subscriber policies.

This code is a bit ad-hoc and there is a separate JIRA POLICY-2147 to
support re-factoring this codebase.

Added scanning for advice to be returned. For optimization, because of
the need for some changes in XACML github dependency, we are stuck with
a little narly code to get it to fully work. POLICY-2417 is created to
address this in Guilen.

Upgraded to released XACML artifact - this has been tested locally for
a few weeks with naming, guard and this optimzation code. It removed
Jackson in lieu of Json, cleaned up some security fixes, upgraded
dependencies, and added more code coverage.

Issue-ID: POLICY-2066
Change-Id: I3cae99de265c815200ec2ce71e471338772bdb5b
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agoUpdates to support fixed guard policy types 30/103330/3
Pamela Dragosh [Sun, 8 Mar 2020 14:41:26 +0000 (10:41 -0400)]
Updates to support fixed guard policy types

Because the new TOSCA compliant policy types support required
fields, we can simplify the guard translator to utilize Match
in the target vs the previous complicated Condition usage.

Added test coverage to bump above 90% specifically for the
guard and coordination code.

Added a sonar exclusion for the test module.

Issue-ID: POLICY-2244
Change-Id: Ia90d117bd7b86d28a2268fd5ab8315dce7bf0c12
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agoAdded xacml.properties to packages for native app 74/103174/2
Chenfei Gao [Thu, 5 Mar 2020 19:18:34 +0000 (14:18 -0500)]
Added xacml.properties to packages for native app

Issue-ID: POLICY-2182
Change-Id: Ife38e989aeda445c9fc2531bb92426f2d28bb818
Signed-off-by: Chenfei Gao <cgao@research.att.com>
4 years agoPoint to docker 2.0.1 82/102682/1
Pamela Dragosh [Sun, 1 Mar 2020 21:53:13 +0000 (16:53 -0500)]
Point to docker 2.0.1

policy/docker is released

Issue-ID: POLICY-2378
Change-Id: I1ca967d48dca59d72d3490044ee499770d04f286
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agoMerge "Build XACML PDP support for native xacml policy type"
Ram Krishna Verma [Sun, 1 Mar 2020 15:45:46 +0000 (15:45 +0000)]
Merge "Build XACML PDP support for native xacml policy type"

4 years agoBuild XACML PDP support for native xacml policy type 27/102627/1
Chenfei Gao [Fri, 28 Feb 2020 19:45:48 +0000 (14:45 -0500)]
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 <cgao@research.att.com>
4 years agoXACML pdp support for clc. 14/102514/5
pramod.jamkhedkar [Thu, 27 Feb 2020 17:55:59 +0000 (12:55 -0500)]
XACML pdp support for clc.

Added policies for SON and PCI to support each blocking the other, with test cases and appropriate requests

Issue-ID: POLICY-2163
Change-Id: I8153f9cd973a7cd6824fcd6c9787628a74148d46
Signed-off-by: pramod.jamkhedkar <pramod@research.att.com>
4 years agoUpgrades to cucumber 58/102258/1
Pamela Dragosh [Mon, 24 Feb 2020 18:31:45 +0000 (13:31 -0500)]
Upgrades to cucumber

To keep in step with policy/parent upgrades.

Issue-ID: POLICY-2381
Change-Id: Ic25821bcf410e2fdf261abd155eb21030c509aa1
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agoUse datatype in matchable translator 24/102024/2
Pamela Dragosh [Wed, 19 Feb 2020 21:59:01 +0000 (16:59 -0500)]
Use datatype in matchable translator

With the new changes to models/api, the full policy template will
be retrieved along with inherited policy types and datatypes.

Changed api caller to return tosca template instead of individual
policy type so all policy types and data types are available.

Changed stdmatchabletranslator to be able to flexibly go deep with
list/map of datatypes of attributes. NOTE: This should be re-factored
at a later date as its a bit messy.

The naming application was used to test this code, but it was determined
by the CCSDK team that they will not do filtering this release. Instead,
switched to combined results policy type to return the full policy type.

Issue-ID: POLICY-1740
Change-Id: Ieb4e46e7fb2c639a1155be3bc07f5587c4f7b09a
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agoAdd missing apps/naming directory for testing 99/101699/1
Pamela Dragosh [Thu, 13 Feb 2020 17:23:53 +0000 (12:23 -0500)]
Add missing apps/naming directory for testing

Just clears a warning from main JUnit tests.

Issue-ID: POLICY-1740
Change-Id: Ie9e5bb0463bf5827085a714a61a5d87021f37860
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agoReview intellij git ignored files 09/101409/1
Bruno Sakoto [Fri, 7 Feb 2020 19:33:19 +0000 (14:33 -0500)]
Review intellij git ignored files

Issue-ID: POLICY-2359
Signed-off-by: Bruno Sakoto <bruno.sakoto@bell.ca>
Change-Id: Ie2203067494ee9f59c56fd9cfc7ed9023b797e44

4 years agoUpdating module names to resolve conflicts 03/101203/3
Ram Krishna Verma [Wed, 5 Feb 2020 21:32:11 +0000 (16:32 -0500)]
Updating module names to resolve conflicts

Issue-ID: POLICY-2355
Change-Id: I2933cf17fa790113eaaf8b9adc199c3b8fdc0e75
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
4 years agoRemove assembly warning 47/100547/2
Pamela Dragosh [Tue, 21 Jan 2020 15:06:05 +0000 (10:06 -0500)]
Remove assembly warning

Use ${file.separator}

Issue-ID: POLICY-2329
Change-Id: I1bca4f17ea562d656edc368aa8fc34d59206203d
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agoUse alpine image for xacml-pdp 95/100395/1
Jim Hahn [Thu, 16 Jan 2020 21:32:58 +0000 (16:32 -0500)]
Use alpine image for xacml-pdp

Issue-ID: POLICY-1586
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: I4ed9fa70dd95d061f0cd4c81822853b92387e2f6

4 years agoMerge "Ensure one jacoco output file"
Pamela Dragosh [Thu, 16 Jan 2020 21:01:22 +0000 (21:01 +0000)]
Merge "Ensure one jacoco output file"

4 years agoAdd missing property file to xacml tarball 90/100390/1
Jim Hahn [Thu, 16 Jan 2020 18:51:21 +0000 (13:51 -0500)]
Add missing property file to xacml tarball

When attempting to run the xacml-pdp CSIT, the log file contains a
complain about a missing apps/naming/xacml.properties file; it was
missing from the tarball.

Issue-ID: POLICY-1586
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: Ie967efb9b82b0aabe513df9ea213867faca06840

4 years agoEnsure one jacoco output file 86/100386/1
Pamela Dragosh [Thu, 16 Jan 2020 17:31:52 +0000 (12:31 -0500)]
Ensure one jacoco output file

Sub-modules under sub-modules need to set the path to
ensure a single jacoco-ut.exec file is produced and
appended to.

This doesn't seem to affect the results, but I'd like
to be consistent.

Issue-ID: POLICY-2321
Change-Id: Ia2223df55ce0f4be6e81fa61bf7df711e12ad760
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agoUpdate policy-xacml-pdp for java11 docker 53/100353/1
Jim Hahn [Wed, 15 Jan 2020 21:46:49 +0000 (16:46 -0500)]
Update policy-xacml-pdp for java11 docker

Issue-ID: POLICY-1586
Change-Id: I6ff51d191a506297cbe69161114c0721b59bb5d2
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoUpdate sonar configuration 95/100295/1
Pamela Dragosh [Tue, 14 Jan 2020 20:12:03 +0000 (15:12 -0500)]
Update sonar configuration

policy/parent now has the configuration
don't need to evaluate packages and testsuites

Issue-ID: POLICY-2321
Change-Id: I957e0d69845afa2fed5907ab3edd8dcf69596a0e
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agopolicy/xacml-pdp jdk11 upgrades 87/100287/2
HOCKLA [Tue, 14 Jan 2020 17:39:47 +0000 (11:39 -0600)]
policy/xacml-pdp jdk11 upgrades

Issue-ID: POLICY-1596
Change-Id: I00164ea17eb9d547b45c01e5f46f7aaf0f9a25e2
Signed-off-by: HOCKLA <ah999m@att.com>
4 years agoPoint to policy/models release version 16/100216/1
HOCKLA [Fri, 10 Jan 2020 21:09:21 +0000 (15:09 -0600)]
Point to policy/models release version

Issue-ID: POLICY-1592
Change-Id: Ie53416e58b439f4dfec17eb260ece3326eaf53d3
Signed-off-by: HOCKLA <ah999m@att.com>
4 years agoEnabling logback file to be loaded using oom configmap 87/100087/2
a.sreekumar [Wed, 8 Jan 2020 13:04:35 +0000 (13:04 +0000)]
Enabling logback file to be loaded using oom configmap

Change-Id: Icda10390a6ff3b6b524907562050658f3b283afd
Issue-ID: POLICY-2308
Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech>
4 years agoRemoved supported policy types from Pdp-Status message 83/99983/3
HOCKLA [Thu, 2 Jan 2020 17:45:22 +0000 (11:45 -0600)]
Removed supported policy types from Pdp-Status message

Issue-ID: POLICY-2230
Change-Id: I363dc450b6d7aaf13696c50792cbea5a8d643413
Signed-off-by: HOCKLA <ah999m@att.com>
4 years agoAdd optimization subscriber request 95/99495/3
Pamela Dragosh [Wed, 11 Dec 2019 15:00:21 +0000 (10:00 -0500)]
Add optimization subscriber request

Adding support for a preliminary request to pull subscriber details.
The returned decision adds scope attributes for the original request.

Fixed some checkstyle issues due to new checkstyle requirements.

Issue-ID: POLICY-2066
Change-Id: Ief02d896ce33e4864bb20e9185b0d0f5eb254bfd
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agoAdd SDNC naming application 03/99303/9
Pamela Dragosh [Sun, 8 Dec 2019 22:44:31 +0000 (17:44 -0500)]
Add SDNC naming application

Requires changes to StdMatchableTranslator to go deeper when
searching for matchable attributes.

NOTE: will re-visit the StdMatchableTranslator at a later date
in order to support more robust Policy Types. And document best
practices for defining matchables.

Issue-ID: POLICY-1740
Change-Id: I291cf1c2e6eba0a677a3312dd11f0e56178a805b
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agoChanges for optimization refactoring 94/99294/3
Pamela Dragosh [Sun, 8 Dec 2019 12:32:33 +0000 (07:32 -0500)]
Changes for optimization refactoring

Companion review to https://gerrit.onap.org/r/c/policy/models/+/99288

The policy types for optimization were refactored, so the xacml
optimization application tests need to accomodate that.

Issue-ID: POLICY-2066
Change-Id: Ibc03b0652e771175a2fa38f5c3a3d81c7e371147
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agoPoint to release versions of policy/parent and policy/common 25/99225/4
HOCKLA [Thu, 5 Dec 2019 19:16:28 +0000 (13:16 -0600)]
Point to release versions of policy/parent and policy/common

Issue-ID: POLICY-1583
Change-Id: I0fb606c7ba7334a6826a1246c76fe1970b1f9a44
Signed-off-by: HOCKLA <ah999m@att.com>
4 years agoClear some simple xacml sonar 32/99032/3
Pamela Dragosh [Mon, 2 Dec 2019 19:38:05 +0000 (14:38 -0500)]
Clear some simple xacml sonar

Missing assertions in JUnit test cases.
Use replace vs replaceAll
Swapping arguments

Issue-ID: POLICY-2079
Change-Id: I5accd462eab3d4f6b3321e375d4ba1084caf4b8c
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agoChanged Xacml-pdp to report pdp group defined in XacmlPdpParameters config file 52/98452/3
HOCKLA [Fri, 15 Nov 2019 14:52:39 +0000 (08:52 -0600)]
Changed Xacml-pdp to report pdp group defined in XacmlPdpParameters config file

Ignore the pdp group specified in the PdpUpdate message.
Updated junits and test resources.

Issue-ID: POLICY-2229
Change-Id: I0c7a33c45424cef6440b0837e1dd22a7487c5d44
Signed-off-by: HOCKLA <ah999m@att.com>
4 years agoMerge "Added 'onap.monitoring.*' in list of supported policy types"
Liam Fallon [Thu, 14 Nov 2019 21:01:24 +0000 (21:01 +0000)]
Merge "Added 'onap.monitoring.*' in list of supported policy types"

4 years agoAdded 'onap.monitoring.*' in list of supported policy types 16/98316/5
Ali Hockla [Tue, 12 Nov 2019 17:49:32 +0000 (11:49 -0600)]
Added 'onap.monitoring.*' in list of supported policy types

Issue-ID: POLICY-2223
Change-Id: I1a7a1b4083ff74ca86455e1ab6ae7f96b8c04d35
Signed-off-by: Ali Hockla <ah999m@att.com>
4 years agoDo not hardcode io.fabric8 plugin 54/98254/2
Pamela Dragosh [Mon, 11 Nov 2019 17:37:51 +0000 (12:37 -0500)]
Do not hardcode io.fabric8 plugin

policy/parent now has this defined

Issue-ID: POLICY-2222
Change-Id: Ia054539a41f58dde26bf30d9d3b0f7f95da3b20d
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agoMerge "Implement closest match algorithm"
Jorge Hernandez [Wed, 13 Nov 2019 13:55:40 +0000 (13:55 +0000)]
Merge "Implement closest match algorithm"

4 years agoImplement closest match algorithm 28/97928/10
Pamela Dragosh [Mon, 4 Nov 2019 21:18:08 +0000 (16:18 -0500)]
Implement closest match algorithm

Needed to add more obligations, which make it easier to
scan through obligations and be able to pull information
about the policy.

Adding weight as an obligation for Optimization policies in
order to implement "closest match" algorithm.

Moved Obligation to a support class.

Added JUnit code coverage on the translator classes.

Split some methods up to reduce complexity via sonar.

Issue-ID: POLICY-2066
Change-Id: Ibb13d2dc0a63ab2a6d585b0697a0c1d129fa8f7b
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agoAdded support to return status and error if pdp-x failed to load policy 98/98198/8
Ali Hockla [Fri, 8 Nov 2019 18:54:02 +0000 (12:54 -0600)]
Added support to return status and error if pdp-x failed to load policy

Issue-ID: POLICY-2175
Change-Id: I32d2fe78846f58d6e700100dd523732817f1f04d
Signed-off-by: Ali Hockla <ah999m@att.com>
4 years agoAdded support for 'Active' and 'Passive' states. 62/97962/3
Ali Hockla [Tue, 5 Nov 2019 14:15:20 +0000 (08:15 -0600)]
Added support for 'Active' and 'Passive' states.

Removed the rest server start/stop from the Activator because the engine
starts in PASSIVE state.
Added code to start/stop the rest server when a pdp state change occurs.

Issue-ID: POLICY-2154
Change-Id: Iec6fcc990dc3dde702a911eb4f90d29e25c395a2
Signed-off-by: Ali Hockla <ah999m@att.com>
4 years agoMerge "Added abbreviated decision API call to stability and performance JMeter tests"
Liam Fallon [Mon, 4 Nov 2019 17:14:20 +0000 (17:14 +0000)]
Merge "Added abbreviated decision API call to stability and performance JMeter tests"

4 years agoMore examples of optimization policies and cleanup 87/97887/7
Pamela Dragosh [Sun, 3 Nov 2019 22:42:09 +0000 (17:42 -0500)]
More examples of optimization policies and cleanup

Fixed a couple of sonar issues - log exception and do not
nest more 3 if-else-try.

Cleaned up the JUnit test to make debugging a bit easier.

Added more examples for testing optimization tests.

Moved the target back into the Policy and kept the Condition
on the Rule. Works exactly the same, just a bit cleaner and
one less rule to deal with.

Issue-ID: POLICY-2066
Change-Id: Ife28dc2ce959dcf1fb8ca72061ebc5dca862a7f4
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agoAdded abbreviated decision API call to stability and performance JMeter tests 56/97856/1
Ali Hockla [Fri, 1 Nov 2019 13:38:21 +0000 (08:38 -0500)]
Added abbreviated decision API call to stability and performance JMeter tests

Issue-ID: POLICY-2168
Change-Id: I3bd0ef114374f5d01e2d93501ed6cf0748097987
Signed-off-by: Ali Hockla <ah999m@att.com>
4 years agoAdd common Jersey version 48/97848/1
liamfallon [Fri, 1 Nov 2019 11:55:29 +0000 (11:55 +0000)]
Add common Jersey version

Add a common version of Jersey for all Policy Framework components.

Issue-ID: POLICY-2209
Change-Id: I0d61800b423bffbe584e29621a87068eef4c1e6c
Signed-off-by: liamfallon <liam.fallon@est.tech>
4 years agoOptimization improvements and test cases 35/97635/5
Pamela Dragosh [Mon, 28 Oct 2019 12:51:10 +0000 (08:51 -0400)]
Optimization improvements and test cases

* StdBaseTranslator added helpful support methods and
can now add obligations to either rule, policy or policy sets.
* StdMatchablePolicyRequest improved to support optional
policy-type as part of the request to refine the output results.
* Added more tests to ensure that the decision is returning the
appropriate results.
* Added more Javadoc for code.
* Added some sonar fix for either log or throw exception.

Issue-ID: POLICY-2066
Change-Id: I90d6d90c2cdbb627e96cfce1d2632b2439a1e477
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agoMerge "Fix sonar and coverage"
Liam Fallon [Thu, 24 Oct 2019 20:28:19 +0000 (20:28 +0000)]
Merge "Fix sonar and coverage"

4 years agoFix sonar and coverage 65/97565/1
Pamela Dragosh [Thu, 24 Oct 2019 16:42:38 +0000 (12:42 -0400)]
Fix sonar and coverage

Turns out cyclomatic complexity is there in one method.
The other JUnits in the applications cover the rest of
the class, when time permits I will add that in there
for completeness.

Issue-ID: POLICY-2066
Change-Id: I31fd43625883bd569d4078bbd684554f6f3fbf53
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agoMerge "Removed type_version from abbreviated Monitor decision results"
Pamela Dragosh [Thu, 24 Oct 2019 13:22:40 +0000 (13:22 +0000)]
Merge "Removed type_version from abbreviated Monitor decision results"

4 years agoRemoved type_version from abbreviated Monitor decision results 93/97493/1
HOCKLA [Wed, 23 Oct 2019 17:24:12 +0000 (12:24 -0500)]
Removed type_version from abbreviated Monitor decision results

Issue-ID: POLICY-2126
Change-Id: I2a4907bb61651d9cfe2793e69404d9ccbe41ccd8
Signed-off-by: HOCKLA <ah999m@att.com>
4 years agoConsolidate common translatable code some sonar 31/97431/4
Pamela Dragosh [Tue, 22 Oct 2019 17:06:56 +0000 (13:06 -0400)]
Consolidate common translatable code some sonar

There is duplicate code for some common translation of policy
decision responses and for scanning obligations.

Removed some TODO items (left others because I want to look
at them more closely).

Stored System.lineSeparator into a static var so that I can
remove some unnecessary ifs. There's still one left that I
am not worried about.

Gson as a static variable.

Issue-ID: POLICY-2066
Change-Id: I9c8162d5ad1c5f884be347dd94631fa74ca76f85
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agoUse yaml policies in models-examples 90/97390/1
Pamela Dragosh [Mon, 21 Oct 2019 18:21:54 +0000 (14:21 -0400)]
Use yaml policies in models-examples

Now that yaml is supported, use those policies that are
stored in the models-examples that are preloaded into the
api.

Fixed a minor checkstyle issue. Not sure why it was missed.

Issue-ID: POLICY-2066
Change-Id: I2f4384a310bfa818555de5dacb477daf82fac6de
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agoMerge "Modified Decision API to accept query parameters and abbreviate Monitor decisi...
Pamela Dragosh [Mon, 21 Oct 2019 12:56:25 +0000 (12:56 +0000)]
Merge "Modified Decision API to accept query parameters and abbreviate Monitor decision results"

4 years agoModified Decision API to accept query parameters and abbreviate Monitor decision... 78/97078/4
HOCKLA [Mon, 14 Oct 2019 19:25:29 +0000 (14:25 -0500)]
Modified Decision API to accept query parameters and abbreviate Monitor decision results

Issue-ID: POLICY-2126
Change-Id: I18d50a8746ede792ec9507ab98125383c5914ba1
Signed-off-by: HOCKLA <ah999m@att.com>
4 years agooverride cert stores 07/97207/6
jhh [Wed, 16 Oct 2019 16:58:59 +0000 (11:58 -0500)]
override cert stores

Issue-ID: POLICY-2064
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: Ia98f383de7e1946e49c1f2c6117f2065c84ad26e

4 years agoSonar xacml-pdp issues 62/95762/3
Pamela Dragosh [Mon, 16 Sep 2019 17:09:46 +0000 (13:09 -0400)]
Sonar xacml-pdp issues

Either log or re-throw exception
Refactor to not nest more than 3 statements
Refactor to throw at most one exception
Move variable to comply with Java Code conventions
String literal on LHS

Issue-ID: POLICY-2079
Change-Id: Iac33623ef4694cf38c4a69c8f0b9040d8439998e
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agoRemoved TestUtils from common and into a 'xacml-test' project 89/96489/3
Ali Hockla [Tue, 1 Oct 2019 23:42:04 +0000 (18:42 -0500)]
Removed TestUtils from common and into a 'xacml-test' project

Issue-ID: POLICY-2090
Change-Id: Id688e305f878f56e374e6bd9047d9d6c75fbe0c6
Signed-off-by: Ali Hockla <ah999m@att.com>
4 years agoUpgrade to Tosca derivedFrom fix 59/95659/5
Pamela Dragosh [Fri, 13 Sep 2019 16:12:45 +0000 (12:12 -0400)]
Upgrade to Tosca derivedFrom fix

Upgrade to models fix for derivedFrom() append of 0.0.0
And some sonar fixes for:

Exceptions should be either logged or rethrown but not both
Preconditions" and logging arguments should not require evaluation
Reduced cognitive complexity

Issue-ID: POLICY-2079
Change-Id: Ied8630020e8a737c33b1484db953df133c89398f
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agoAdd yaml support to xacml-pdp rest server 17/95617/2
Jim Hahn [Thu, 12 Sep 2019 20:05:18 +0000 (16:05 -0400)]
Add yaml support to xacml-pdp rest server

Also modified code to use StandardYamlCoder.

Change-Id: I0596c8b054339ac68ef8c4250cd25b9ff88d47e4
Issue-ID: POLICY-2085
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoBump versions for xacml-pdp master 90/95390/1
Jim Hahn [Tue, 10 Sep 2019 15:14:09 +0000 (11:14 -0400)]
Bump versions for xacml-pdp master

Change-Id: I6ca46b3bbc9529c6fef5a332b224a4de69e3cdef
Issue-ID: POLICY-2045
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoRelease xacml-pdp 2.1.2 90/95290/1 5.0.0-ONAP
Pamela Dragosh [Tue, 10 Sep 2019 00:29:52 +0000 (20:29 -0400)]
Release xacml-pdp 2.1.2

Releasing 2.1.2

Issue-ID: POLICY-2045
Change-Id: I2c7c1968a6b194d7f582062a27416ffc57c4ad68
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agoUpgrade to released artifacts 85/95285/1
Pamela Dragosh [Mon, 9 Sep 2019 23:47:56 +0000 (19:47 -0400)]
Upgrade to released artifacts

Upgrade to released parent, common and models

Issue-ID: POLICY-2045
Change-Id: I4ee2e7d752d45449d7d2c0173c3b6b672e160166
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agoIntegrate using Policy Type to find Matchable 06/94706/7
Pamela Dragosh [Fri, 30 Aug 2019 19:21:05 +0000 (15:21 -0400)]
Integrate using Policy Type to find Matchable

Utilize's Jim's helper class to pull from API policy types
definitions so that Xacml PDP can determine which properties
are "matchable".

Override initialize to set translator parameters.

Utilize the metadata section of ToscaProperties to store
the matchable field.

Updated Matchable Request to be dynamic with respect to the
incoming resource attributes.

Stored the policy types as JSON.

Issue-ID: POLICY-1899
Change-Id: Icff3605495b0a34ebfcdfa54346095ce2d8468a4
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agoChange "pap" to "policy-api" in xacml-pdp config 48/94848/1
Jim Hahn [Tue, 3 Sep 2019 15:07:16 +0000 (11:07 -0400)]
Change "pap" to "policy-api" in xacml-pdp config

The json config file is really only an example, but the example leads
users down the wrong path, because it implies that xacml-pdp connects
to "pap" to get policy type information, when it actually talks to
"policy-api".  Updated the config file.

Change-Id: Id2a42264591acd37b7813673fdcaa790257a9d8a
Issue-ID: POLICY-1911
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoGet policy type from policy-api 93/94593/3
Jim Hahn [Wed, 28 Aug 2019 19:20:18 +0000 (15:20 -0400)]
Get policy type from policy-api

Added a class to retrieve a policy type from the policy-api.
Updated property files to include parameters that are needed
to configure it.
Updates per review comments:
- change PolicyApi to PolicyApiCaller
- use HttpClientFactory
- removed superfluous constructors from exception classes
- changed parameters to use RestServerParameters instead of BusTopicParams

Change-Id: I8aad6ca5a733c8ad9cc983496e745ebe7400dd17
Issue-ID: POLICY-1911
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoXACML junit spews dmaap errors 44/94244/1
Jim Hahn [Fri, 23 Aug 2019 22:40:54 +0000 (18:40 -0400)]
XACML junit spews dmaap errors

Modified junit parameters to specify "noop" instead of "dmaap"
in the topic properties, eliminating the dmaap error messages
from the log.

Change-Id: I350d988d10219e6ded2c011a4ed117fd5e71876a
Issue-ID: POLICY-1725
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoupdate keystore 77/94177/2
jhh [Fri, 23 Aug 2019 03:42:23 +0000 (22:42 -0500)]
update keystore

Issue-ID: POLICY-1988
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: I544a0bdf63582cdff74765d7fad1b7f993d0bfa0
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
4 years agoReview maven dependency for snakeyaml 01/92901/2
Bruno Sakoto [Wed, 7 Aug 2019 14:09:22 +0000 (10:09 -0400)]
Review maven dependency for snakeyaml

Remove explicit version for snakeyaml maven dependency and inherit it
from integration parent artifact.

Issue-ID: POLICY-1603
Signed-off-by: Bruno Sakoto <bruno.sakoto@bell.ca>
Change-Id: Iae360f073f9962014fbb64dbe150e75edc49d039

4 years agoBump version of policy/xacml-pdp 25/92925/1
Jim Hahn [Wed, 7 Aug 2019 16:34:50 +0000 (12:34 -0400)]
Bump version of policy/xacml-pdp

Change-Id: I2770d2803c79b5eb72b69bb6aa4a1da43a0f6a0b
Issue-ID: POLICY-1965
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoAdd release 2.1.1 file 34/92834/1
jhh [Tue, 6 Aug 2019 17:09:51 +0000 (12:09 -0500)]
Add release 2.1.1 file

Issue-ID: POLICY-1953
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: I352905ea9e2876879896cc0842df43139d487d65

4 years agoUpdate to latest common/models released versions 86/92686/3
jhh [Mon, 5 Aug 2019 13:53:04 +0000 (08:53 -0500)]
Update to latest common/models released versions

policy/models: 2.1.2
policy/common: 1.5.1

Issue-ID: POLICY-1953
Change-Id: I9ea6939e760ae5098896aedcfa632cc7426e927d
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
4 years agoMerge "Use new addTopic() method in xacml-pdp"
Jorge Hernandez [Wed, 31 Jul 2019 14:34:22 +0000 (14:34 +0000)]
Merge "Use new addTopic() method in xacml-pdp"

4 years agoMerge "Fix guard table creation during startup issue"
Ram Krishna Verma [Wed, 31 Jul 2019 10:19:50 +0000 (10:19 +0000)]
Merge "Fix guard table creation during startup issue"

4 years agoFix guard table creation during startup issue 97/91897/10
Michael Mokry [Tue, 23 Jul 2019 18:54:30 +0000 (13:54 -0500)]
Fix guard table creation during startup issue

- Added -hpolicydb to the mysql command in the script
- Made this configurable by utilizing the existing parameters in
xacml.properties for db connections.  No OOM or CSIT changes should be
needed now.

PATCH UPDATE:
- used Awk to extract property values
- removed echo except one needed for the base64 command, as far
as I can tell it is needed when assigning output to a variable,
I tried to get it to work unsuccessfully.
- added exit code 2 for missing properties as suggested by Jorge
and Jim

PATCH UPDATE:
- remove echo from base64 using Jim's suggestion
- Added code to remove escape backslashes from properties file,
I didn't see these locally but when testing in windriver they
show up in the xacml.properties file on OOM installs
- More changes per Jorge's latest review

Change-Id: I79c0502d8a4fadd2160785014fcb9db3c0faab5e
Issue-ID: POLICY-1934
Signed-off-by: Michael Mokry <michael.mokry@att.com>
4 years agoUse new addTopic() method in xacml-pdp 10/92310/1
Jim Hahn [Tue, 30 Jul 2019 15:53:14 +0000 (11:53 -0400)]
Use new addTopic() method in xacml-pdp

Replaced ParameterUtils with the use of the new
addTopic(TopicParameterGroup) method.

Change-Id: I35bf8a78d4670835dda005cdb218665a3bf48a16
Issue-ID: POLICY-1953
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoAdd stopBubbling to lombok.config for XACML-PDP 13/92113/2
Jim Hahn [Fri, 26 Jul 2019 13:18:44 +0000 (09:18 -0400)]
Add stopBubbling to lombok.config for XACML-PDP

Change-Id: If489f95f80f324620bbcdca85d0fe2b4b2285d31
Issue-ID: POLICY-1938
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoMerge "Add more junit coverage to xacml-pdp (round #2)"
Jim Hahn [Wed, 24 Jul 2019 16:37:07 +0000 (16:37 +0000)]
Merge "Add more junit coverage to xacml-pdp (round #2)"

4 years agoMerge "S3P Stability and Performance Tests"
Pamela Dragosh [Wed, 24 Jul 2019 13:21:28 +0000 (13:21 +0000)]
Merge "S3P Stability and Performance Tests"

4 years agoAdd more junit coverage to xacml-pdp (round #2) 04/91904/2
Jim Hahn [Tue, 23 Jul 2019 14:57:03 +0000 (10:57 -0400)]
Add more junit coverage to xacml-pdp (round #2)

Also removed unused methods.
Also extracted constants.

Change-Id: I8d2cff05a365f145f2080369e9ea52d08be7e508
Issue-ID: POLICY-1772
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoS3P Stability and Performance Tests 99/91899/1
Michael Mokry [Tue, 23 Jul 2019 19:09:49 +0000 (14:09 -0500)]
S3P Stability and Performance Tests

- Modified the jmeter scripts to include performance and stability testing with
Decision APIs

Change-Id: If10e5c598406af21d620b359a1f20b64fd433b18
Issue-ID: POLICY-1773
Signed-off-by: Michael Mokry <michael.mokry@att.com>
4 years agoFixed xacml-pdp registration 00/91900/1
Jim Hahn [Tue, 23 Jul 2019 19:00:59 +0000 (15:00 -0400)]
Fixed xacml-pdp registration

Apparently, TimerTasks may not be cancelled and then re-scheduled.
Modified the code to use a scheduled thread pool instead.

Change-Id: I2e26a5a37636f570f362481823a0274fe558e2e9
Issue-ID: POLICY-1939
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoAdd junit coverage to xacml-pdp 33/91833/2
Jim Hahn [Mon, 22 Jul 2019 14:57:57 +0000 (10:57 -0400)]
Add junit coverage to xacml-pdp

Change-Id: I9b59dcd27705e40c424b6a76420e0395adbe44bb
Issue-ID: POLICY-1772
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoModify xacml-pdp to use RestServer from common 99/91699/1
Jim Hahn [Wed, 17 Jul 2019 13:59:40 +0000 (09:59 -0400)]
Modify xacml-pdp to use RestServer from common

Change-Id: I331483e2e28f2c57160b3eaace40fc84a1c13727
Issue-ID: POLICY-1652
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoAdded comment to checkstyle suppression 10/91110/4
Jim Hahn [Wed, 10 Jul 2019 12:43:33 +0000 (08:43 -0400)]
Added comment to checkstyle suppression

Change-Id: I7c7c89e8b4367bbc2ea7a97e403eb253e955a9a5
Issue-ID: POLICY-1074
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoFix xacml-pdp due to sonar changes in common 46/91046/1
Jim Hahn [Mon, 8 Jul 2019 16:13:39 +0000 (12:13 -0400)]
Fix xacml-pdp due to sonar changes in common

Fixed breakages due to changes made in policy/common to satisfy
sonar.

Change-Id: I6c655ca9509bc1d52277d55b02103e9875de2c29
Issue-ID: POLICY-1791
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoRemove topic.properties and incorporate into overall config file for xacml 13/90913/1
a.sreekumar [Thu, 4 Jul 2019 14:14:39 +0000 (14:14 +0000)]
Remove topic.properties and incorporate into overall config file for xacml

Change-Id: I3be6248db65041f5d9b7acfcf0fcd2f49d9d70f8
Issue-ID: POLICY-1744
Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech>
4 years agoFix xacml decision policy-type 53/90853/3
Pamela Dragosh [Wed, 3 Jul 2019 18:29:37 +0000 (14:29 -0400)]
Fix xacml decision policy-type

Wrong attribute id was being used. Added info logging statement
to assist in debugging. Added JUnit to support this.

Issue-ID: POLICY-1843
Change-Id: I11d83574f91751804a45281d2e0c9cd3150e30eb
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agoUse ToStringTester from utils-test 36/90736/1
ramverma [Mon, 1 Jul 2019 15:48:07 +0000 (15:48 +0000)]
Use ToStringTester from utils-test

Changing ToStringTester from utils to utils-test.
Bumping the policy/common & policy/models version.

Change-Id: Idf665bc92345c445f483ebfb190d39c7019280aa
Issue-ID: POLICY-1746
Signed-off-by: ramverma <ram.krishna.verma@est.tech>
4 years agoBump xacml-pdp to 2.1.1-SNAPSHOT 79/90679/1
Pamela Dragosh [Fri, 28 Jun 2019 17:54:59 +0000 (13:54 -0400)]
Bump xacml-pdp to 2.1.1-SNAPSHOT

Released 2.1.0

Issue-ID: POLICY-1737
Change-Id: Ieb3015e9373a9a71a71f2811cbc6db9315d58109
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agoRemove POLICY_PDPX_HOME in policy-pdpx.sh and Dockerfile 95/90495/2
shaoqiu [Fri, 28 Jun 2019 05:03:09 +0000 (05:03 +0000)]
Remove POLICY_PDPX_HOME in policy-pdpx.sh and Dockerfile

Update the policy-pdpx.sh and Dockerfile according to the comments in
commit: https://gerrit.onap.org/r/c/policy/api/+/89972

Issue-ID: POLICY-1702
Change-Id: Id46c108f5893d3e81e2038d9d5063b9f8a5eb5ee
Signed-off-by: shaoqiu <tim.huang@est.tech>
4 years agoFix xacml-pdp latest tag 79/90479/2 2.1.0
Pamela Dragosh [Tue, 25 Jun 2019 19:00:24 +0000 (15:00 -0400)]
Fix xacml-pdp latest tag

Eliminating the patch - using Rashmi's changes.

Issue-ID: POLICY-1737
Change-Id: Iaacd198aeca5daef71e4356f7446e23b9c65d9ce
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Signed-off-by: pdragosh <pdragosh@research.att.com>
4 years agoUpgrade to release common & models 99/90399/1
Pamela Dragosh [Mon, 24 Jun 2019 15:48:59 +0000 (11:48 -0400)]
Upgrade to release common & models

Released common 1.5.0 and models 2.1.0

Issue-ID: POLICY-1737
Change-Id: Ia5bf6965c7c85b1de74b90b1d4fd179cac01bdea
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agoMerge "Create simple way to populate guard table"
Jorge Hernandez [Fri, 21 Jun 2019 15:12:53 +0000 (15:12 +0000)]
Merge "Create simple way to populate guard table"

4 years agoMerge "Upgrade to release 3.0.0 parent"
Jim Hahn [Thu, 20 Jun 2019 21:05:03 +0000 (21:05 +0000)]
Merge "Upgrade to release 3.0.0 parent"

4 years agoUpgrade to release 3.0.0 parent 53/90253/1
Pamela Dragosh [Thu, 20 Jun 2019 20:19:45 +0000 (16:19 -0400)]
Upgrade to release 3.0.0 parent

Policy/parent released

Issue-ID: POLICY-1737
Change-Id: I8814c011b923286b714ab5e97fb3665d58c9f40c
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agoCreate simple way to populate guard table 71/90171/5
Michael Mokry [Wed, 19 Jun 2019 15:21:18 +0000 (10:21 -0500)]
Create simple way to populate guard table

Created a script that takes in the guard type as argument and executes
the sql in a .sql file to insert data

Made changes based on review comments:
1) Moved it all to the testsuite package
2) Modified the script to remove the guard type argument and
replaced it with a parameter for the filename
3) added exit 1 where applicable
        4) renamed sql file to be more general and avoid a specific use
case.
Change-Id: I89a2fa81153449b6716d9d215aa2af56748212b4
Issue-ID: POLICY-1786
Signed-off-by: Michael Mokry <michael.mokry@att.com>
4 years agoUpdate totalPoliciesCount statistic 80/90180/1
Jim Hahn [Wed, 19 Jun 2019 18:24:31 +0000 (14:24 -0400)]
Update totalPoliciesCount statistic

Modified the code to set the policy count statistic at start-up
and whenever the policy list is changed.
Also fixed a couple of checkstyle issues in guard.

Change-Id: I92017fe64cd5d19c36908347193cc21d183f051e
Issue-ID: POLICY-1844
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoMerge "Create the operationshistory table from pdpx"
Pamela Dragosh [Wed, 19 Jun 2019 12:14:33 +0000 (12:14 +0000)]
Merge "Create the operationshistory table from pdpx"

4 years agoCreate the operationshistory table from pdpx 06/89206/8
Michael Mokry [Mon, 3 Jun 2019 20:13:03 +0000 (15:13 -0500)]
Create the operationshistory table from pdpx

Added create table sql statement to the policy-pdpx.sh to create the operationshistory table during
xacml-pdp installation
Added changes per Jorge's review
1) Added sql file with create table statement
2) Added bash script to execute sql file
3) modified policy-pdpx.sh to execute new bash script
4) other changes

Change-Id: Iaae63dc65db1ff9181de12928e072f04c87e50e7
Issue-ID: POLICY-1827
Signed-off-by: Michael Mokry <michael.mokry@att.com>
4 years agoChange getCanonicalName() to getName() in xacml-pdp 13/90013/1
Jim Hahn [Mon, 17 Jun 2019 14:30:20 +0000 (10:30 -0400)]
Change getCanonicalName() to getName() in xacml-pdp

Per javadocs, getName() should generally be used instead of
Class.getCanonicalName(). This change only applies to classes; it
does not apply to File objects.

Change-Id: Id9ad514a7ba10e7cdbf292bba2b07135bdbd2572
Issue-ID: POLICY-1646
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoFix xacml docker chmod 71/89371/2
Jim Hahn [Wed, 5 Jun 2019 13:06:36 +0000 (09:06 -0400)]
Fix xacml docker chmod

The chmod in the docker builder for my local VM does not appear to
support the "+x" style options. Modified the xacml docker
file to use "755" instead.

Change-Id: I6cba12e62d84f626e03b3aee33d50d71faa602c4
Issue-ID: POLICY-1829
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoBump xacml-pdp to version 2.1.0 34/88934/1
Jim Hahn [Thu, 30 May 2019 16:34:09 +0000 (12:34 -0400)]
Bump xacml-pdp to version 2.1.0

Change-Id: I231fa4c077db75d426278f6f718876bb2c76a8db
Issue-ID: POLICY-1747
Signed-off-by: Jim Hahn <jrh3@att.com>
5 years agoBump to 2.0.2-SNAPSHOT 12/88412/1
Pamela Dragosh [Thu, 23 May 2019 20:43:33 +0000 (16:43 -0400)]
Bump to 2.0.2-SNAPSHOT

Released 2.0.1

Issue-ID: POLICY-1700
Change-Id: Idc1d8602b276c9ad3199c57723dd053fb1dd48a3
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
5 years agoUpdate INFO.yaml to add Jim and Ram 60/88260/1 2.0.1 4.0.0-ONAP
liamfallon [Wed, 22 May 2019 14:42:24 +0000 (14:42 +0000)]
Update INFO.yaml to add Jim and Ram

Issue-ID: POLICY-1775
Change-Id: Id8da2edad9bbc5e47162b14eaea713ca66accc19
Signed-off-by: liamfallon <liam.fallon@est.tech>
5 years agoMerge "Add SON Handler monitoring policy type"
Jorge Hernandez [Fri, 17 May 2019 13:47:52 +0000 (13:47 +0000)]
Merge "Add SON Handler monitoring policy type"