summaryrefslogtreecommitdiffstats
path: root/main/src
AgeCommit message (Collapse)AuthorFilesLines
2021-08-25Revert "Synchronize updates to xacml-pdp state"Jim Hahn2-12/+6
This reverts commit ead43f520102bc6201aadb770b5f289c9dc4691c. Reason for revert: Causing lock-ups in honolulu builds Issue-ID: POLICY-3531 Change-Id: Ia18ac9306ba406f59b3e939a3d4aafefe14407e6 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-08-19Synchronize updates to xacml-pdp stateJim Hahn2-6/+12
Perhaps this will fix the issue wherein xacml-pdp heartbeats continue to say "PASSIVE" even after it's set to "ACTIVE". Issue-ID: POLICY-3531 Change-Id: I6639ed7ca793a899f62e5c80b336408f5e8b2dc6 Signed-off-by: Jim Hahn <jrh3@att.com> (cherry picked from commit d3544f097cf6c67baf66578636d09c1148e01c50)
2021-08-07Leave xacml-pdp REST server always runningJim Hahn4-47/+20
Liveness checks depend on the xacml-pdp REST server being available. However, the REST server is only running when PAP puts it in an active state. Modified the code to always leave it running. In a subsequent review, we should split the healthcheck REST service onto its own port so it can be left running, while the other services are started/stopped in response to PAP active/passive requests. Issue-ID: POLICY-3531 Change-Id: I412064abaf91bb966d40adc46cee771b3a0a5dfc Signed-off-by: Jim Hahn <jrh3@att.com> (cherry picked from commit 031a0fe51dff21445034befc8a6d8732622acd07)
2021-03-16Update policy-keystore with newer certificatesjhh1-0/+0
Issue-ID: POLICY-3139 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: Ia0c86441b1c95b45959be070015ea57f106d7002
2021-02-18Fix sonars and target dirPamela Dragosh2-15/+8
Fix a couple of sonars introduced by the PdpType review. Also creation of a target directory below the xacml-pdp directory. Issue-ID: POLICY-3071 Change-Id: I9fe325d0a75970fbe3d42be36906013c1fc2ecb9 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2021-02-16Make xacml pdpType configurablePamela Dragosh13-24/+81
Adding code to enable the pdp type to be configurable. Issue-ID: POLICY-3071 Change-Id: I51c873f68bff1866c6b2e96958b6c33872aea2c8 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2021-02-11Fix sonars from dependency upgradeJim Hahn6-36/+26
The dependency upgrades in policy-parent caused some new sonars. In particular, initMocks() has been deprecated - replaced with calls to the Mockito Runner. Also removed unnecessary when() calls. Issue-ID: POLICY-2912 Change-Id: If386bd282635067a20045f2626af0cf5be49bc0e Signed-off-by: Jim Hahn <jrh3@att.com>
2021-02-10Upgrade dependenciesJim Hahn1-0/+1
Updated properties to work with the new version of eclipselink. Issue-ID: POLICY-3005 Change-Id: I88091a90387e235ef5c168de7a3275056327d83e Signed-off-by: Jim Hahn <jrh3@att.com>
2021-01-04Changed identifiers to concept identifiersliamfallon2-10/+11
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-09-24update default keystoresjhh1-0/+0
Issue-ID: POLICY-2827 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: Icbe559ceb51f34ec7596516ba0ebe735e086b312
2020-08-25Merge "Add new Match application to XACML"Jim Hahn2-2/+33
2020-08-25Add new Match application to XACMLPamela Dragosh2-2/+33
Add new generic match application to XACML PDP. This app will allow ONAP users to design their own matchable policy types and use StdMatchableTranslator out-of-the box without any modification. Fills the gap left behind since "configure" via the Monitoring can support StdCombinedResultsTranslator, but the Optimization policy types have a specific "closest match" algorithm tied to them. Gives flexibility. removed unused import Issue-ID: POLICY-2596 Change-Id: I0aebae706fb9634e7bb13d78eff0ccc1ae4d752f Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-08-21Changes to make XACML container crash with non zero exitCodea.sreekumar1-2/+7
Change-Id: Id8c18b6888128a3efaa96f05d911fde5e6a92694 Issue-ID: POLICY-2757 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
2020-08-19Remove old cdap policy typePamela Dragosh1-2/+2
Actually, this does not need to have any specific monitoring policy type designated because since Frankfurt we added the feature to support onap.monitoring.* Issue-ID: POLICY-2772 Change-Id: Ief24550c3e90b7a54ad3c1c381330580ca738798 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-08-17Add new guard filter policy type featurePamela Dragosh1-2/+2
* Added new Policy Guard filter Policy type. * Enhanced translator tests to ensure bad filter policies are detected. * Added new filter application test to ensure new guard propertly creates xacml policies. Issue-ID: POLICY-2590 Change-Id: Ifc047a33084ce45b67be98a61f660d7a8c9d8615 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-08-14Cleanup unused imports and deprecated methodsPamela Dragosh2-6/+4
Eclipse reports 2 unused imports and deprecated methods. Does not show up in sonar, but these are simple fixes. Issue-ID: POLICY-2590 Change-Id: I41b4b43e8d1d5e88c66a368b47482ef20297a4c1 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-07-01Replace try/catch blocks with assertj - xacml-pdpwaynedunican2-34/+29
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 Hahn3-6/+4
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 Cho3-7/+6
Issue-ID: POLICY-2188 Change-Id: I64a115240a71e5014db9cfb66747887e156afb50 Signed-off-by: Taka Cho <takamune.cho@att.com>
2020-06-19xcaml-pdp sonar issue fixesTaka Cho3-12/+12
replace with '<>' and assert statements Issue-ID: POLICY-2616 Change-Id: Id999d3299918491c06918caaa28c44e2148574bc Signed-off-by: Taka Cho <takamune.cho@att.com>
2020-06-02Merge "Use OperationsHistory from models"Pamela Dragosh2-8/+8
2020-06-01Use OperationsHistory from modelsJim Hahn2-8/+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 Hahn2-5/+1
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-03-25Point to models 2.2.2Pamela Dragosh1-3/+2
Issue-ID: POLICY-2378 Change-Id: Iecf281253baae6548575890f0c919dedc36a3787 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-03-19Merge "Re-factor matchable to reduce complexity"Jim Hahn3-56/+89
2020-03-19Re-factor matchable to reduce complexityPamela Dragosh3-56/+89
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-18renew policy certs till 03/17/2021jhh1-0/+0
Issue-ID: POLICY-2402 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I111f60b9ef60ee9524808653be020f94ae9db170
2020-03-14Add code coverage XacmlPolicyUtilsPamela Dragosh1-1/+1
Fix spelling error and add code cover >95% for the XacmlPolicyUtils. Issue-ID: POLICY-2242 Change-Id: I21f239e6bd42073ff84883d04f2b8bee1466b8e0 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-03-13Bump XacmlPdpApplicationManager code coveragePamela Dragosh2-3/+213
From under 50% to over 90%. Issue-ID: POLICY-2242 Change-Id: Ie061bddbdd2fcdb37bed608847449e5bc92173b5 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-03-12Better error handling for decisionsPamela Dragosh1-1/+5
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-11Merge "Added support for application/xacml+json in native app"Pamela Dragosh5-25/+115
2020-03-11Added support for application/xacml+json in native appChenfei Gao5-25/+115
Issue-ID: POLICY-2182 Change-Id: I13246e08afdc2f5a380b5737c72851f271211d46 Signed-off-by: Chenfei Gao <cgao@research.att.com>
2020-03-10Misc XACML code coveragePamela Dragosh2-3/+42
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-02-28Build XACML PDP support for native xacml policy typeChenfei Gao19-12/+964
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>
2020-02-13Add missing apps/naming directory for testingPamela Dragosh1-0/+31
Just clears a warning from main JUnit tests. Issue-ID: POLICY-1740 Change-Id: Ie9e5bb0463bf5827085a714a61a5d87021f37860 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-01-14policy/xacml-pdp jdk11 upgradesHOCKLA1-9/+8
Issue-ID: POLICY-1596 Change-Id: I00164ea17eb9d547b45c01e5f46f7aaf0f9a25e2 Signed-off-by: HOCKLA <ah999m@att.com>
2020-01-06Removed supported policy types from Pdp-Status messageHOCKLA2-4/+0
Issue-ID: POLICY-2230 Change-Id: I363dc450b6d7aaf13696c50792cbea5a8d643413 Signed-off-by: HOCKLA <ah999m@att.com>
2019-12-23Add optimization subscriber requestPamela Dragosh1-2/+3
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-02Clear some simple xacml sonarPamela Dragosh5-12/+27
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>
2019-11-15Changed Xacml-pdp to report pdp group defined in XacmlPdpParameters config fileHOCKLA17-35/+140
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>
2019-11-12Added support to return status and error if pdp-x failed to load policyAli Hockla5-31/+87
Issue-ID: POLICY-2175 Change-Id: I32d2fe78846f58d6e700100dd523732817f1f04d Signed-off-by: Ali Hockla <ah999m@att.com>
2019-11-05Added support for 'Active' and 'Passive' states.Ali Hockla7-5/+81
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>
2019-10-28Optimization improvements and test casesPamela Dragosh1-12/+0
* 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 Dragosh1-1/+1
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 ↵HOCKLA4-8/+304
decision results Issue-ID: POLICY-2126 Change-Id: I18d50a8746ede792ec9507ab98125383c5914ba1 Signed-off-by: HOCKLA <ah999m@att.com>
2019-10-09Sonar xacml-pdp issuesPamela Dragosh1-0/+5
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>
2019-09-13Upgrade to Tosca derivedFrom fixPamela Dragosh2-8/+2
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>
2019-09-12Add yaml support to xacml-pdp rest serverJim Hahn1-2/+3
Also modified code to use StandardYamlCoder. Change-Id: I0596c8b054339ac68ef8c4250cd25b9ff88d47e4 Issue-ID: POLICY-2085 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-09-09Integrate using Policy Type to find MatchablePamela Dragosh3-9/+13
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>