summaryrefslogtreecommitdiffstats
path: root/applications/common/src/main
AgeCommit message (Collapse)AuthorFilesLines
2023-10-04Remove AAF from xacml-pdpadheli.tavares2-51/+54
Issue-ID: POLICY-4592 Change-Id: I5b23b31df436c64f15d98a6f6731ec842d4df86d Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
2023-09-22Upgrade Java 17 in xacml-pdpadheli.tavares4-7/+9
Issue-ID: POLICY-4821 Change-Id: I96843c7be9f0ef93ca76c85d682fffb2bdfaff13 Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
2023-02-02Replace Eclipselink with Hibernateliamfallon1-5/+4
Issue-ID: POLICY-4533 Change-Id: I56cfd55cd66e228e3012152a8fcc11e3011c8a3c Signed-off-by: liamfallon <liam.fallon@est.tech>
2022-02-11Fix xacml pdp to accommodate Object values in policy metadatarameshiyer273-4/+4
Issue-ID: POLICY-3832 Signed-off-by: zrrmmua <ramesh.murugan.iyer@est.tech> Change-Id: I276bf28d3fdaad6e1d7cde315cdb049343cbde3f
2022-02-08Fixing sonar issues in xacml-pdpisaac2-4/+5
Issue-ID: POLICY-3900 Signed-off-by: isaac <isaac.adorno@att.com> Change-Id: I29d22d1c6b690204270d87fff6ce42d9d00cef6a
2021-07-21Merge "Include returned attributes in Decision"Jim Hahn1-0/+50
2021-07-20Include returned attributes in DecisionPamela Dragosh1-0/+50
Adds new method to return attributes in a decision, which can be configurable. By default it is turned off which ensures that the current functionality is maintained for our client applications. Enhanced the JUnits for the applications to ensure that no extra information is passed, thus maintaining backward compatibility. Issue-ID: POLICY-2865 Change-Id: Ia533e5462c0cb475cb1f72f34e95f128d6c52678 Signed-off-by: Pamela Dragosh <pd1248@att.com>
2021-07-19Use new RestClientParameters class in xacml-pdpJim Hahn4-28/+13
Replaced generic BusTopicParams with more specific RestClientParameters. Also modified code to pass the HttpClient around instead of passing the client parameters around. Issue-ID: POLICY-3456 Change-Id: Ic07b710645eeab696e6df0a015171578ad08ca83 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-07-14Use lombok in xacml-pdpJim Hahn12-44/+23
Also: - changed a few fields to private/protected. - swwapped out gson for coder Issue-ID: POLICY-3400 Change-Id: I9a4dba939b77078f78583ada00af182b1a7d95c5 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-06-24Use protected methods vs privatePamela Dragosh2-6/+7
Application and common code in xacml-pdp is meant to be available for developers to re-use and/or extend as desired. Private methods are unnecessary at this time, but could be re-visited in a later release. For Honolulu, simply moving to protected to keep functionality the same. Possibly for Istanbul we can make more changes to support mixing of ONAP application with custom applications during runtime. Issue-ID: POLICY-3305 Change-Id: I6db23bda3c81fdbbf86e39cc2cd2e706d8bee63d Signed-off-by: Pamela Dragosh <pdragosh@research.att.com> (cherry picked from commit 8e0aa0ffa5cef537de1c841acf38300832c52a56) Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2021-06-18Fix new checkstyle issues in xacml-pdpJim Hahn2-4/+4
The new version of checkstyle identified new issues. Fixed those. Issue-ID: POLICY-3288 Change-Id: I334e9eb67c9270c4e53b2fb34e576b8bfbf8ec8b Signed-off-by: Jim Hahn <jrh3@att.com>
2021-06-10Fix sonars in xacml-pdpJim Hahn1-1/+1
Fixed sonars: - use "var" Issue-ID: POLICY-3288 Change-Id: If4f685e0d645f6d6fbdd2cdb86c6b67336f6839a Signed-off-by: Jim Hahn <jrh3@att.com>
2021-05-27Replace validation code with annotationsJim Hahn1-0/+36
Instead of having code to validate various values, created POJOs to represent the decoded data so that bean validation annotations could be used instead. Didn't see any obvious ways to use annotations in the Optimization code, but did notice a bug (passed role instead of provisions). Extracted a common method which fixed the bug as a side-effect. Issue-ID: POLICY-2418 Change-Id: I9ef589086fc8f7f66810b66405fbf302d7570e5a Signed-off-by: Jim Hahn <jrh3@att.com>
2021-05-06Fix sonars in xacml-pdpJim Hahn15-113/+109
Fixed: - use "var" instead of actual type Issue-ID: POLICY-3285 Change-Id: Id17142d1f2e3e5f9dfbffcb96aff7fe76321a56b Signed-off-by: Jim Hahn <jrh3@att.com>
2021-03-17Change RestServerParameters to BusTopicParamsJim Hahn4-26/+16
HTTP client parameters should be based on BusTopicParams instead of RestServerParameters, modified the policyApiParameters. Issue-ID: POLICY-3147 Change-Id: I73aa34bec3ab7e27e7a3474260f411ed55b6f933 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-02-19Fix junit for "native" on WindowsJim Hahn1-2/+12
Windows doesn't like file names containing ":". Added code to replace ":" with "_", but only when the JVM is run on a Windows OS. Issue-ID: POLICY-3085 Change-Id: I1d3b6819bf564571eddda69e4c5fbd2bb807a3aa Signed-off-by: Jim Hahn <jrh3@att.com>
2021-02-18Utilize time extensionsPamela Dragosh1-3/+29
Switched to using the new Time Extensions released in XACML from github v3.0. Added more thorough tests for it as well as the flexibility of specifying the current time etc. More syntax checking on the inputs from the policy. Issue-ID: POLICY-2810 Change-Id: I1b4ec885c706e37949e5dabe14c63b0d7456cd4f Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2021-01-04Changed identifiers to concept identifiersliamfallon5-28/+32
The policy models tosca classes ToscaPolicyIdentifier and ToscaPolicyIdentifierOptVersion can be used to identify any TOSCA concept, not just TOSCA policies so they are renamed to ToscaConceptIdentifier and ToscaCinceptIdentifierOptVersion respectively. The class ToscaPolicyTypeIdentifier is redundant and is replaced by ToscaConceptIdentifier. Issue-ID: POLICY-2900 Change-Id: Id614bbed34ed8897e7e882b70147b98ffe90bf57 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-12-04Fix sonar issues with visibilityPamela Dragosh3-4/+4
S5993 Change the visibility of this constructor to "protected". Issue-ID: POLICY-2912 Change-Id: I2fd9fcd3162c8bf28ba0315939ef259356f442db Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-11-30ToscaEntityType renamed ToscaSchemaDefinitionliamfallon9-42/+55
The TOSCA class ToscaEntityType is renamed to ToscaSchemaDefinition becasue keys as well as entities can have schemas, so the class has more usages than just for entity schemas. Issue-ID: POLICY-2900 Change-Id: I7a1a3a1262078c47eeea1820538ecb6153f5e652 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-10-02Remove duplicated codePamela Dragosh1-3/+9
Initially, just moving the applicationName and actions as protected fields got rid of the sonar issue. I included also the supportedPolicyTypes also. But that triggered another sonar duplicate code, so I had to rename a few private fields to rid that. Seems like a very sensitive sonar detection that results in kludgy code. Issue-ID: POLICY-2681 Change-Id: Ie79a95786cdb80381cbce4b182e9e66a2776e0dd Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-09-16Remove base64 encoding of password from xacmlRam Krishna Verma1-8/+1
Issue-ID: POLICY-2550 Change-Id: I05d9af99401991ea867e7ab8d697692c9020b3b7 Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2020-06-19Changes for Checkstyle 8.32Taka Cho4-9/+2
Issue-ID: POLICY-2188 Change-Id: I64a115240a71e5014db9cfb66747887e156afb50 Signed-off-by: Taka Cho <takamune.cho@att.com>
2020-06-02Merge "Use OperationsHistory from models"Pamela Dragosh4-88/+8
2020-06-01Use OperationsHistory from modelsJim Hahn4-88/+8
Deleted Dbao and replaced it with the shared class in policy-models. Also had to update the queries and the persistence.xml accordingly. Issue-ID: POLICY-2581 Change-Id: I59dfa2f37c272796ccebc0f578c9f4e8e1b9c8ab Signed-off-by: Jim Hahn <jrh3@att.com>
2020-05-29Use default serialization providerJim Hahn1-2/+0
The default provider has been changed to gson, so the provider property no longer has to be set. Issue-ID: POLICY-1527 Change-Id: I21f5a3af2bc1d7fc10dc41f58e6e62a04f4bda77 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-05-27Merge "Change CLC logic for updated OPHist DB entries."Pamela Dragosh1-17/+19
2020-05-26Change CLC logic for updated OPHist DB entries.pramod.jamkhedkar1-17/+19
Change the CLC policy logic to match the udpate Operations History DB rules. Now if a record has outcome = Started, it is considered to be in progress. Else it is considered to be complete. Issue-ID: POLICY-2583 Change-Id: If3f626bfec2d0656e43a26929107f68ff27af020 Signed-off-by: pramod.jamkhedkar <pramod@research.att.com>
2020-05-21Add secondary indices to operationshistory tableJim Hahn1-4/+5
Queries to the operationshistory table will degrade substantially as more records are added to the DB. The Dbao class should be moved to policy-models, but for now we'll just update it in both places (i.e., drools-apps and xacml-pdp). Issue-ID: POLICY-2581 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: Icc4529e56968ceda4d9b63a8ccea6ba219250506 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-05-19Change CLC granularity to CL level.pramod.jamkhedkar1-5/+3
Change CLC granularity from target level to CL level. Remove the target matching for the db query at PIP level. Issue-ID: POLICY-2573 Change-Id: If9ba1a4d22c3b8bc5dfce0632f7037ad085f6ea6 Signed-off-by: pramod.jamkhedkar <pramod@research.att.com>
2020-04-13Fix integer converted to doublePamela Dragosh1-2/+5
Use policy/common map double converter to ensure integers saved in policy content do not get converted to doubles. Issue-ID: POLICY-2486 Change-Id: I887c6b5c337e2594c425b645af4b2668d06715bd Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-03-20use shutdown to clear handle leakPamela Dragosh6-4/+47
The XACML github was released with a new method to allow context factories and PIP engines to release any handles before releasing the PDP engine. This review includes that artifact and adds tests to support it. In addition, added more tests to get code coverage over 90% for both PIPs in ONAP. Some cleanup in the Matchable types based on last review. Issue-ID: POLICY-2242 Change-Id: I312f06380ff4d2e16bcfd25b6d1f36ce5dd030e6 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-03-19Re-factor matchable to reduce complexityPamela Dragosh14-457/+1116
This solution is much cleaner than what is in StdMatchableTranslator. Over 90% code coverage on it - utilizes a callback to retrieve DataType and PolicyTypes. Support for missing timestamp TOSCA type. Also can do a better job differentiating between a property contained in the policy vs a schema. Changed StdMatchableTranslator to utilize these classes. And removed the old spaghetti. Added some JUnit coverage for ToscaPolicyTranslatorUtils. Removed duplicate code in the XACML Native Exception classes. Issue-ID: POLICY-2242 Change-Id: I18f898d9e65f6da28e3b27517d40f8d389de18a0 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-03-16Missing support for PolicySetTypePamela Dragosh6-15/+42
Adds support for PolicySetType specifically for Native policies. When/If the other applications change to support they can easily do so. Adding some more code coverage for Native application and translator. Issue-ID: POLICY-2433 Change-Id: I463ca9f04928d759624a2176598b463057d386bd Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-03-12Better error handling for decisionsPamela Dragosh5-18/+20
Throw exceptions when requests cannot be created and return error information back. Consolidated some code to avoid sonar duplication issues. Companion review to https://gerrit.onap.org/r/c/policy/models/+/103548 Issue-ID: POLICY-2242 Change-Id: Ic873af933dab82e3aeef6335f55939666be20385 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-03-11Fix sonar logging bugsPamela Dragosh6-12/+12
These did not show up locally - sonarqube must have a new version or rules to pick these up. Issue-ID: POLICY-2242 Change-Id: I3df5aee84f696cde6b07c68913bbd55e95c8ba3b Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-03-10Misc XACML code coveragePamela Dragosh4-127/+35
Removed duplicate code from operations history classes. added code coverage to other classes. cleared sonar in main for args Issue-ID: POLICY-2242 Change-Id: Ief548c96a180c132a3f17681d9cbc018c62e42ac Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-03-10Fix optimization bug add coverage plusPamela Dragosh4-14/+55
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>
2020-03-09Updates to support fixed guard policy typesPamela Dragosh3-8/+81
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>
2020-02-19Use datatype in matchable translatorPamela Dragosh2-177/+372
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>
2019-12-23Add optimization subscriber requestPamela Dragosh3-3/+18
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>
2019-12-17Add SDNC naming applicationPamela Dragosh1-3/+61
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>
2019-11-13Merge "Implement closest match algorithm"Jorge Hernandez5-98/+533
2019-11-12Implement closest match algorithmPamela Dragosh5-98/+533
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>
2019-11-12Added support to return status and error if pdp-x failed to load policyAli Hockla2-5/+3
Issue-ID: POLICY-2175 Change-Id: I32d2fe78846f58d6e700100dd523732817f1f04d Signed-off-by: Ali Hockla <ah999m@att.com>
2019-11-04More examples of optimization policies and cleanupPamela Dragosh1-28/+33
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>
2019-10-28Optimization improvements and test casesPamela Dragosh3-46/+284
* 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>
2019-10-24Fix sonar and coveragePamela Dragosh1-30/+36
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>
2019-10-23Consolidate common translatable code some sonarPamela Dragosh5-319/+210
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>
2019-10-21Use yaml policies in models-examplesPamela Dragosh1-4/+5
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>