aboutsummaryrefslogtreecommitdiffstats
path: root/applications/optimization
AgeCommit message (Collapse)AuthorFilesLines
2021-09-14Bump xacml-pdp to 2.5.1-SNAPSHOTRam Krishna Verma1-1/+1
Issue-ID: POLICY-3587 Change-Id: I4e912da513ba8ecaf4bdc71659b7b273c0aaab05 Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2021-07-21Merge "Include returned attributes in Decision"Jim Hahn1-0/+12
2021-07-20Include returned attributes in DecisionPamela Dragosh1-0/+12
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 Hahn2-12/+5
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 Hahn1-1/+1
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-8/+8
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-05-27Replace validation code with annotationsJim Hahn1-30/+17
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 Hahn3-17/+15
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 Hahn2-8/+8
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-03-11Bump xacml-pdp 2.5.0-SNAPSHOTPamela Dragosh1-1/+1
Issue-ID: POLICY-3105 Change-Id: I9fd03ff6a405b127c1eabbfe301f3b9ea8327aad Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2021-03-09Bump xacml to 2.4.2-SNAPSHOTPamela Dragosh1-1/+1
Issue-ID: POLICY-3127 Change-Id: I586fc25f730b708d047999706fd74d6b965bb130 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2021-02-23bump poms to 2.4.1-SNAPSHOTjhh1-1/+1
Issue-ID: POLICY-3088 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I42c32bbb1ef6e275b8b3a0693492c7e4e61dd6eb
2021-01-04Changed identifiers to concept identifiersliamfallon2-18/+19
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-10-27Bump xacml-pdp master to 2.4.0-SNAPSHOTJim Hahn1-1/+1
Bumping minor version now that guilin branch has been created. Also repointed to snapshot versions for dependencies. Issue-ID: POLICY-2875 Change-Id: I145f638d6409f92cf916b08ace10a159d5e52c73 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-10-20Bump xacml 2.3.4 SNAPSHOTPamela Dragosh1-1/+1
Issue-ID: POLICY-2869 Change-Id: If8e944fce44ca0b613da9f92f4516049994fff86 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-10-07Bump xacml-pdp to 2.3.3 snapshotPamela Dragosh1-1/+1
Issue-ID: POLICY-2839 Change-Id: I78bf1cebb31c3c3c48d214fa755892b9a3a58323 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-10-02Remove duplicated codePamela Dragosh1-18/+5
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-30Fix new sonars in xacml-pdpJim Hahn1-92/+32
Addressed the following sonar issues: - extract common test method - too many assertions in a test method Issue-ID: POLICY-2681 Change-Id: I7438be8286d52cd8479c66542fc785b27448972b Signed-off-by: Jim Hahn <jrh3@att.com>
2020-09-29Fix deployment of frequency limiter policyJim Hahn1-1/+1
Changed the artifact IDs of the xacml-pdp applications so they won't clash with other jar file names. Issue-ID: POLICY-2848 Change-Id: I844aaf6b2c4d81e52716d840b3a784873c6ce121 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-09-09Bump xacml-pdp to 2.3.2Jim Hahn1-1/+1
Issue-ID: POLICY-2789 Change-Id: I3f2c877874e5fbcd0520b811c984fa8d14b05435 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-07-10Bump xacml-pdp to 2.3.1-SNAPSHOTJim Hahn1-1/+1
Issue-ID: POLICY-2695 Change-Id: I7be4fdd72aad0ab794a0d5a6919afec5998dad09 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-07-01Replace try/catch blocks with assertj - xacml-pdpwaynedunican1-9/+4
Replaced try/catch blocks in policy/xacml-pdp with assertj assertions Issue-ID: POLICY-2451 Change-Id: I3e6947a61e0000561c7053a1cdede9ae5825e5ca Signed-off-by: waynedunican <wayne.dunican@est.tech>
2020-06-29Fix issues in xacml-pdp for new sonar rulesJim Hahn1-14/+13
Addressed issues reported due to updates to the sonar rules: - invoke only one method in a junit lambda - complete the assertion - use assertThat().exists(), canRead(), etc. Issue-ID: POLICY-2681 Change-Id: I2935f4d0295244ab3b11a57a3bc401c64b695fd1 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-06-19Changes for Checkstyle 8.32Taka Cho1-14/+14
Issue-ID: POLICY-2188 Change-Id: I64a115240a71e5014db9cfb66747887e156afb50 Signed-off-by: Taka Cho <takamune.cho@att.com>
2020-05-21Bump xacml-pdp master to 2.3.0-SNAPSHOTa.sreekumar1-1/+1
Change-Id: I4e2a3a7a89eb3e59111c0a2bff70624d9f987abb Issue-ID: POLICY-2514 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
2020-05-21Bump xacml to 2.2.3-SNAPSHOTa.sreekumar1-1/+1
Change-Id: I753851b22200de1f69489d13a283832c469fab22 Issue-ID: POLICY-2514 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
2020-04-15Bump xacml-pdp 2.2.2-SNAPSHOTPamela Dragosh1-1/+1
Issue-ID: POLICY-2378 Change-Id: I542884aed2acbef7e1c7e431f209ea61108e2048 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-04-01Fix optimization supported typesPamela Dragosh2-5/+7
To support 5G slicing use cases, we will support any policy type that derives from onap.policies.optimization Similar in functionality to monitoring Issue-ID: POLICY-2460 Change-Id: I48b071a64b917cea44eb64149539875ba33e2ef5 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-03-24Bump xacml-pdp to 2.2.1-SNAPSHOTJim Hahn1-1/+1
Issue-ID: POLICY-2378 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I819c9a356ca09e9baf75662bb6cd574540f41206
2020-03-19Re-factor matchable to reduce complexityPamela Dragosh2-2/+2
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 Dragosh1-3/+4
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 Dragosh1-14/+4
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 Dragosh1-1/+1
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-10Fix optimization bug add coverage plusPamela Dragosh7-69/+338
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-01-14policy/xacml-pdp jdk11 upgradesHOCKLA1-2/+2
Issue-ID: POLICY-1596 Change-Id: I00164ea17eb9d547b45c01e5f46f7aaf0f9a25e2 Signed-off-by: HOCKLA <ah999m@att.com>
2019-12-23Add optimization subscriber requestPamela Dragosh6-25/+494
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-08Changes for optimization refactoringPamela Dragosh3-39/+45
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>
2019-11-12Implement closest match algorithmPamela Dragosh1-9/+9
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-04More examples of optimization policies and cleanupPamela Dragosh2-101/+181
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-11-01Add common Jersey versionliamfallon1-1/+3
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>
2019-10-28Optimization improvements and test casesPamela Dragosh3-14/+302
* 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-23Consolidate common translatable code some sonarPamela Dragosh1-2/+2
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 Dragosh5-256/+15
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>
2019-10-18Modified Decision API to accept query parameters and abbreviate Monitor ↵HOCKLA1-2/+2
decision results Issue-ID: POLICY-2126 Change-Id: I18d50a8746ede792ec9507ab98125383c5914ba1 Signed-off-by: HOCKLA <ah999m@att.com>
2019-10-02Removed TestUtils from common and into a 'xacml-test' projectAli Hockla2-1/+7
Issue-ID: POLICY-2090 Change-Id: Id688e305f878f56e374e6bd9047d9d6c75fbe0c6 Signed-off-by: Ali Hockla <ah999m@att.com>
2019-09-10Bump versions for xacml-pdp masterJim Hahn1-1/+1
Change-Id: I6ca46b3bbc9529c6fef5a332b224a4de69e3cdef Issue-ID: POLICY-2045 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-09-09Integrate using Policy Type to find MatchablePamela Dragosh8-50/+440
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>
2019-08-07Bump version of policy/xacml-pdpJim Hahn1-1/+1
Change-Id: I2770d2803c79b5eb72b69bb6aa4a1da43a0f6a0b Issue-ID: POLICY-1965 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-06-28Bump xacml-pdp to 2.1.1-SNAPSHOTPamela Dragosh1-1/+1
Released 2.1.0 Issue-ID: POLICY-1737 Change-Id: Ieb3015e9373a9a71a71f2811cbc6db9315d58109 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-05-30Bump xacml-pdp to version 2.1.0Jim Hahn1-1/+1
Change-Id: I231fa4c077db75d426278f6f718876bb2c76a8db Issue-ID: POLICY-1747 Signed-off-by: Jim Hahn <jrh3@att.com>