aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/test/java/org
AgeCommit message (Collapse)AuthorFilesLines
2023-09-14Upgrade Java 17 in xacml-pdpjava-17FrancescoFioraEst9-43/+27
Issue-ID: POLICY-4821 Change-Id: Iec12c5e3073639ccf177558143cafc66537c6985 Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
2023-02-24Fixed sonar issues in xacml-pdpSuresh Charan1-7/+8
Reduced technical debt Issue-ID: POLICY-4536 Change-Id: I2d345cc879dbd267b4a2c0791aae153db994114b Signed-off-by: Suresh Charan <suresh.charan@bell.ca>
2023-01-31Upgrade and clean up dependenciesliamfallon3-10/+11
- Upgrade Hibernate - Upgrade Mockito - Upgrade Mockserver - Remove Powermock (no longer supported) and replace with spring-test ReflectionTestUtils - Upgrade Spring Framework - Add spring-security to allow authentication on unit tests using MockMVC Minor clean-up - Replace deprecated authorization configuraiton on spring boot applications with SecurityFilterChain bean - Change @LocalPort include on tests to use test include rather than runtime include - Remove unused imports - Remove unused constants and variables - Add deprecation annotations where required Issue-ID: POLICY-4482 Change-Id: Ia61e137f7f7b7807f376d894be05d1c357a86bdd Signed-off-by: liamfallon <liam.fallon@est.tech>
2022-08-24Support of onap.policies.monitoring.tcagen2 2.0.0jhh1-4/+2
Issue-ID: POLICY-4317 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I1b1e2d4baa2ec82462e32cb79cc18bb183f7ded6 Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
2022-07-06Fix Raw XACML Decision API Serializationdc443y1-4/+4
Issue-ID: POLICY-4274 Signed-off-by: dc443y <dc443y@att.com> Change-Id: I0d367d35e7ec52c7587ec75194b654cc41303868 Signed-off-by: dc443y <dc443y@att.com>
2022-06-21Adding support for custom application metrics in Xacml-PDP.isaac2-21/+53
Issue-ID: POLICY-3762 Signed-off-by: isaac <isaac.adorno@att.com> Change-Id: I84b43ae3a61702ceaf9f526a1c537caa77802af6
2022-02-23Adding statistics to PDP Heartbeat Messagesisaac2-16/+54
Issue-ID: POLICY-3034 Signed-off-by: isaac <isaac.adorno@att.com> Change-Id: I495da4178b9715ec710fdc790f08faef0fc456d5
2022-02-08Fixing sonar issues in xacml-pdpisaac1-2/+2
Issue-ID: POLICY-3900 Signed-off-by: isaac <isaac.adorno@att.com> Change-Id: I29d22d1c6b690204270d87fff6ce42d9d00cef6a
2021-08-23Add filter to control xacml-pdp rest apiJim Hahn6-13/+174
Added a filter class for the REST server that only allows "API" services (i.e., decision API services) through when the API is enabled, disallowing them otherwise. The filter always allows PDP-wide services (e.g., "healthcheck"). Per review comments: - modified the new class to "implement Filter" rather than "extends AafFilter" Issue-ID: POLICY-3531 Change-Id: I7055e21045eea270e454a47a443b29476d9a85ee Signed-off-by: Jim Hahn <jrh3@att.com>
2021-08-23Merge "Fix junits broken by change in is-alive type"Jim Hahn1-1/+3
2021-08-23Fix junits broken by change in is-alive typeJim Hahn1-1/+3
Issue-ID: POLICY-3531 Change-Id: I5eadaa6dbb0c66940a5af0c552894a3d874d51a1 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-08-20Revert "Leave xacml-pdp REST server always running"Jim Hahn2-15/+20
This reverts commit 031a0fe51dff21445034befc8a6d8732622acd07. Issue-ID: POLICY-3531 Change-Id: I20eddfc11589b6ab4822a93b8c8c3d3f209537c0 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-08-19Wait for pdp-pap topic in xacml-pdpJim Hahn2-9/+99
Added code to use the new topic-checker functionality to verify communication on the PDP-PAP topic before sending the first heartbeat. This functionality can be disabled by setting probeHeartbeatTopicMs to 0 in the xacml config file. Issue-ID: POLICY-3531 Change-Id: I113792c67aa26fbb188767d3e973b21dbe04f570 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-08-06Leave xacml-pdp REST server always runningJim Hahn2-20/+15
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>
2021-07-19Use new RestClientParameters class in xacml-pdpJim Hahn5-37/+33
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-16Add exclusions parameterPamela Dragosh5-4/+101
Adds the exclusions parameter to exclude applications that are in the java classpath. This allows overriding default packaged applications with another that can support new policy types and/or modify existing functionality. Issue-ID: POLICY-3326 Change-Id: Iaad8d26fc4122ad17226ad1e83b72c9f284e6ebd Signed-off-by: Pamela Dragosh <pd1248@att.com>
2021-07-14Use lombok in xacml-pdpJim Hahn1-6/+6
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-07-13Change config to add Application groupPamela Dragosh5-14/+89
First step for configuration which applications should be loaded and mapped to actions is to add a new parameter group for application parameters. Issue-ID: POLICY-3326 Change-Id: I3867b4e927d57e1e81519dee32d10eed3dabc667 Signed-off-by: Pamela Dragosh <pd1248@att.com>
2021-06-28Use unique name in xacml-pdp PdpStatus messagesJim Hahn2-8/+8
Added unique name to PdpStatus and HealthCheckReports. Issue-ID: POLICY-3410 Change-Id: Ife2248ffee9afae76f3eaab7f8b33dba8bdb4019 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-05-25Support delta policy lists in xacml-pdpJim Hahn1-15/+77
Updated xacml-pdp to use the deploy & undeploy lists in the PDP-UPDATE message. Added more code coverage to the junit test class. Per review: - added logging for unexpected cases Issue-ID: POLICY-3188 Change-Id: I0f899abcd497f7eb711d4df358e455fd2d50e904 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-04-29Remove GroupValidationResultJim Hahn2-40/+25
Removed GroupValidationResult, replacing it with BeanValidationResult. Modified the ParameterGroup subclasses to use BeanValidator, adding annotations where needed to trigger the validations that had been automatically performed by GroupValidationResult. Issue-ID: POLICY-2059 Change-Id: I039f761745316fea41d63bdc885584c9a9c2bc6e Signed-off-by: Jim Hahn <jrh3@att.com>
2021-03-19Delete keystores from xacmlJim Hahn1-4/+4
The Keystore is no longer needed in the tarball, as it is supplied externally by the CSITs and Helm charts. Deleted that file. Also modified the junits to use utils-test to generates keystores at runtime, thus deleted the junit keystore file, too. Issue-ID: POLICY-3143 Change-Id: If4966538452a16b22ea3a338eb9656a295641402 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-03-17Change RestServerParameters to BusTopicParamsJim Hahn5-33/+36
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-18Fix sonars and target dirPamela Dragosh1-12/+3
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 Dragosh6-17/+35
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-01-04Changed identifiers to concept identifiersliamfallon1-5/+6
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-08-25Add new Match application to XACMLPamela Dragosh1-2/+2
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-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 Cho2-3/+2
Issue-ID: POLICY-2188 Change-Id: I64a115240a71e5014db9cfb66747887e156afb50 Signed-off-by: Taka Cho <takamune.cho@att.com>
2020-06-19xcaml-pdp sonar issue fixesTaka Cho2-10/+10
replace with '<>' and assert statements Issue-ID: POLICY-2616 Change-Id: Id999d3299918491c06918caaa28c44e2148574bc Signed-off-by: Taka Cho <takamune.cho@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-13Bump XacmlPdpApplicationManager code coveragePamela Dragosh1-0/+200
From under 50% to over 90%. Issue-ID: POLICY-2242 Change-Id: Ie061bddbdd2fcdb37bed608847449e5bc92173b5 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-03-11Merge "Added support for application/xacml+json in native app"Pamela Dragosh2-20/+67
2020-03-11Added support for application/xacml+json in native appChenfei Gao2-20/+67
Issue-ID: POLICY-2182 Change-Id: I13246e08afdc2f5a380b5737c72851f271211d46 Signed-off-by: Chenfei Gao <cgao@research.att.com>
2020-03-10Misc XACML code coveragePamela Dragosh1-0/+37
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 Gao6-3/+389
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-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 messageHOCKLA1-3/+0
Issue-ID: POLICY-2230 Change-Id: I363dc450b6d7aaf13696c50792cbea5a8d643413 Signed-off-by: HOCKLA <ah999m@att.com>
2019-12-02Clear some simple xacml sonarPamela Dragosh4-11/+26
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 fileHOCKLA7-24/+88
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 Hockla2-4/+43
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 Hockla5-0/+28
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-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>