aboutsummaryrefslogtreecommitdiffstats
path: root/controlloop/common/guard
AgeCommit message (Collapse)AuthorFilesLines
2018-10-02Merge "Fix remaining sonar"Pamela Dragosh2-13/+14
2018-10-01Fix remaining sonarPamela Dragosh2-13/+14
Mostly moving variables to their right spot. Issue-ID: POLICY-1129 Change-Id: Iccc084bbb404ffd51bdd0b26b5f8c373c6142fb1 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2018-09-28Merge "Yet more sonar issues in drools-applications"Pamela Dragosh1-15/+16
2018-09-27Fix more sonar issuesPamela Dragosh3-11/+11
Most of these are minor issues along with a few others. They have been bugging me so I thought I would get them done. Some also do not show up on sonarlint. Issue-ID: POLICY-1129 Change-Id: I31f2765f6babdfa80b23f0589daacc98da8d2002 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2018-09-27Yet more sonar issues in drools-applicationsJoshua Reich1-15/+16
removed unused imports and variable definitions moved variable declarations above methods refactored deeply nested if/while removed code smell due to unecessary use of static keyword moved string literals to left side of comparator fixed logging of exceptions immediately return expression instead of assigning it to the temporary variable Change-Id: Idfd2a2bdf3c2f3bbfcb54a06b713d57bc867b3ab Issue-ID: POLICY-1129 Signed-off-by: Joshua Reich <jreich@research.att.com>
2018-09-27Fix for checkstyle declarationsPamela Dragosh2-2/+3
I found the problem with policy-yaml. An exception was occuring due to an extra line between an @return for javadoc vs. just printing a warning. See: https://github.com/checkstyle/checkstyle/issues/2398 I also messed up some of the other declarations in the sub-modules. Copyright Issue-ID: POLICY-1153 Change-Id: I848e0b19340d494775e161bab86ffb60a97d83ab Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2018-09-24Fix checkstyle declarationsPamela Dragosh11-224/+119
I fixed what I thought would be tolerable for this release. Same issue as policy/common I had to defined the checkstyle in each repo where the suppressions were needed. Issue-ID: POLICY-1135 Change-Id: I8f30bee7e9cddc692ddad3cf88acedb2e6b4781b Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2018-09-21new sonar issues in drools-applicationsJim Hahn1-18/+18
Don't return null lists from AAI. Transient TargetLock. Extract aai.url, et. al., constants. Don't allocate extra unneeded variable. Re-order fields in xacml attributes. Extract "vserver" constant from simulator. Replace thread sleep with join. Change-Id: Iee1bd182862632af1f131cca5db5b526f5865b9f Issue-ID: POLICY-1129 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-09-17Add demo for Control Loop Coordination.Joshua Reich4-10/+741
New PipEngine and Junit test added to guard. Also bug in existing Junit test fixed. All other code added to new directory template.demo.clc Change-Id: Ida2267528bcb9404dc59ff391d45797b591814cc Issue-ID: POLICY-1109 Signed-off-by: Joshua Reich <jreich@research.att.com>
2018-09-14Option to disable target locking. Needed by CLC.Joshua Reich1-31/+44
When used, the ControlLoopEventManager will set useTargetLock to false converting TargetLock lock/unlock operations to no-ops. Allows CLC-specified logic to coordinate closed loops instead of hard-coded mutual-exclusion enforced by target locking. Change-Id: Ic067c1e1ce47b12d12742ed4bc04d59aa42751d6 Issue-ID: POLICY-953 Signed-off-by: Joshua Reich <jreich@research.att.com>
2018-08-31pass VF count to guard for scale-outJim Hahn6-45/+145
Also updated license dates. Fixed new checkstyle errors. Change-Id: Ia6153814c4333724185918f76be560aba5a52f96 Issue-ID: POLICY-1084 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-08-29Fix remaining checkstylePamela Dragosh7-138/+238
Lots of formatting, missing javadoc, distance from use, imports must be explicit, ordering of methods. Fixed some abbreviation problems in classes and renamed JUnit tests to fix this. Issue-ID: POLICY-883 Change-Id: I8494f63d88d63c0232aca97f7bcc848816228fb1 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2018-08-28Change parent to policy/parentPamela Dragosh1-3/+0
Should be pointing to policy/parent rather than oparent directly. This will automatically support upgrades more easily. Also removing duplicated managed version override warnings from Maven. This is continuing work to support the integration effort to consolidate common versions of java dependencies across all projects. Issue-ID: INT-619 Change-Id: I37ac20e669262d9ac8fff09fd1ac540190b47a30 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2018-08-14Fix checkstyle issuesPamela Dragosh4-16/+27
Spacing, missing javadoc Issue-ID: POLICY-883 Change-Id: Ice65c6c1baf0bb7c6273411f078bacfe3496b89b Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2018-07-30Copy policy-endpoints from drools-pdp to commonmmis3-2/+8
Replaced references to classes deleted from drools-pdp with references to the corresponding in policy-common Issue-ID: POLICY-967 Change-Id: Ia9d2ac704e6b7c434e5a9e7aee6d7dcf9198e4f2 Signed-off-by: mmis <michael.morris@ericsson.com>
2018-07-16Use refresh() instead of lock() in guardJim Hahn2-43/+28
This is the second step of separating the lock "refresh" operation from the original "lock" operation. Modified PolicyGuard to use refresh() to extend a lock. Also removed the host name from the owner String, as it will no be longer needed (once the final step is done). Change-Id: I3a498e6f81d9dba1bbdfd6f7388087355192bcf5 Issue-ID: POLICY-872 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-07-11Include hostname as part of lock ownerJim Hahn2-29/+35
Because the lock owner string is constructed, using just the target type and request ID, lock requests made by different ONSETs running on different PDP-Ds may both succeed. Added the hostname to the owner string so that locks for ONSETs for the same request ID will be rejected if the request is made on different PDP-Ds. Change-Id: I1d45194cbb1c5b1a1f6000477fe51879a2fecc19 Issue-ID: POLICY-872 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-06-29Add time limit to local guard locking facilityJim Hahn2-68/+58
Modified the local policy guard locking facility to add a time parameter. Modified the control loop event manager to extend the lock when lockCurrentOperation() is re-invoked. Modified the rules to retract the lock if the lock request was denied. Reorder assertions in junit test. Change-Id: Ic9b77acbb4881a5a516f30eb56664bad1a5c4d7e Issue-ID: POLICY-872 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-06-05Update drools-applications to SNAPSHOT-1.3.0liamfallon1-1/+1
Snapshot updated for Casablanca. Issue-ID: POLICY-875 Change-Id: I0307282c4eabdb9ccd03282f918f4cd727ac4f86 Signed-off-by: liamfallon <liam.fallon@ericsson.com>
2018-05-21Update Drools Applcations to 1.2.3-SNAPSHOTliamfallon1-1/+1
These reviews must be merged in order because of layering. This review should be merged THIRD. Issue-ID: POLICY-844 Change-Id: I61d128f3244cd420abab15ab70c5c0e9d9afa625 Signed-off-by: liamfallon <liam.fallon@ericsson.com>
2018-05-16Upgrade SNAPSHOT to 1.2.2liamfallon1-1/+1
These reviews must be merged in order because of layering. This review should be merged FOURTH PLD added version.properties Change-Id: If7af7b3ae37166e88af92c0d1f1c558e5b60ab8e Issue-ID: POLICY-798 Signed-off-by: liamfallon <liam.fallon@ericsson.com> Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2018-04-30Merge "Modify PolicyGuard to use new locking API"Jorge Hernandez2-83/+256
2018-04-27Modify PolicyGuard to use new locking APIJim Hahn2-83/+256
Modified PolicyGuard to use the locking API from policy-core instead of its own internal map. Initialized PolicyGuard.factory. Fixed bug in eventmanager junit test uncovered due to changes to PolicyGuard. Change-Id: I853ee5f146f3bde16b3f6e65bc188ca7c0cc4f73 Issue-ID: POLICY-577 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-04-27Fix failure in PIPEngineGetHistoryTestJim Hahn2-28/+43
Turns out that the getAttributesTest() method depends on testGetCountFromDb() being executed first, but junit does not guarantee this. Modified the code so that it is independent of the order in which the tests are executed. Change-Id: Ie081061e4e83895f4ac89242cf00d843b6e069d4 Issue-ID: POLICY-765 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-04-16Add missing license headersPamela Dragosh6-2/+95
I removed a couple of empty README and added licenses. Issue-ID: POLICY-741 Change-Id: I10aad3536d02b738a1dc606f7311de6b3a2777cd Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2018-04-13Update to SNAPSHOT 1.2.1Pamela Dragosh1-1/+1
Issue-ID: POLICY-736 Change-Id: I2bc455510e925764d18a1d8e96e072bdadb251c6 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2018-03-26Fix path to logging classliamfallon1-1/+1
The package path of LoggerUtil changed as below: From: import org.onap.policy.drools.utils.LoggerUtil; To: import org.onap.policy.drools.utils.logging.LoggerUtil; Change-Id: I8187d97de5eeab92268baab155fb4de37f4df3ad Issue-ID: POLICY-448 Signed-off-by: liamfallon <liam.fallon@ericsson.com>
2018-03-22Removed checkstyle warningsmmis26-2646/+2796
Removed checkstyle warnings in: policy/controlloop/common/guard policy/controlloop/common/msb policy/controlloop/simulators including renaming of the following classes: MSBServiceFactory -> MsbServiceFactory MSBServiceManager -> MsbServiceManager MSBServiceException -> MsbServiceException Issue-ID: POLICY-705 Change-Id: I11d62a74fcb77e764121df119cb0bd9b844b485b Signed-off-by: mmis <michael.morris@ericsson.com>
2018-03-01Remove CLM issues with commons-collectionsPamela Dragosh1-0/+9
We know that we are not configuring an LDAP PIP in our use of the XACML open source. The LDAP implementation uses Apache Velocity, which uses a very old version of commons-collections that has security issues. So we can exclude commons-collections from the build. Issue-ID: POLICY-504 Change-Id: I6d90731e601f58c8edaca6fe02df30ee2a090c2f Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2018-02-19Rename maven modules to mirror directory structureliamfallon1-70/+73
The naming of Maven modules in drools-applications was not aligned with the directory structure in the git repository of drools-applications. Therefore it was difficult to see the strucutre of the repository in Eclipse and other IDEs. This change amends the Maven module IDs to reflect the repository directory structure. This patch reset fixes the previos patch set, where many references to maven modules internally in drools-applciations were missed. See also changes in engine and docker repos. Updated to reflect repo directory structure in maven artifact groups. Issue-ID: POLICY-238 Change-Id: I8ab1a7ecdb664045222bbbfda269135e3e449109 Signed-off-by: liamfallon <liam.fallon@ericsson.com>
2018-02-09Upgrade XACML jarPamela Dragosh1-1/+1
XACML was released with minor fixes for XML files with comments. Mainly it contained upgrade to dependencies that had fixed security issues. One still remains but will not be able to be fixed. Issue-ID: POLICY-616 Change-Id: Ifaf4f92d8da878a1c49dff5fd028744d01999ff5 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2018-02-07Merge "Resolve security issues SONATYPE-2017-0359"Jorge Hernandez1-1/+1
2018-02-07Resolve security issues SONATYPE-2017-0359Pamela Dragosh1-1/+1
Upgrade httpclient to 4.5.5 - the latest version. Issue-ID: POLICY-612 Change-Id: I5e79918bc447889b1dbcd1bf897c3324f6a0cc0d Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2018-02-07Log thrown exception in PIPEngineGetHistoryliamfallon1-1/+1
Sonar Critical error highlighted, with thrown execption not logged. The exception is now logged. Issue-ID: POLICY-455 Change-Id: If2969a4fe118d22dbd1fb11879ba028487848eb8 Signed-off-by: liamfallon <liam.fallon@ericsson.com>
2018-02-06Add JUnit and Remove Technical Debt in Guardliamfallon24-757/+1783
Unit test for guard added and technical debt removed. Issue-ID: POLICY-455 Change-Id: I440766660ddae078013e21b1991ee49c8e488bb3 Signed-off-by: liamfallon <liam.fallon@ericsson.com>
2017-12-15Add guard junitsTemoc Rodriguez11-14/+550
Added a few junit files which test most functionality in the guard submodule. Some minor bugs were found by the junits and fixed those newly found bugs. Added persistence.xml for use by junits in guard. Issue-ID: POLICY-490 Change-Id: Ied7e276cfd417e1f396b5a6685a2e9acc9efd109 Signed-off-by: Temoc Rodriguez <cr056n@att.com>
2017-11-21Bump minor versionJessica Wagantall1-1/+1
Bump minor version in preparation for Amsterdam branching. Change-Id: Ia7e97a72053a2d1cd10c0b9d5c179817c3ac7e23 Issue-ID: CIMAN-120 Signed-off-by: Jessica Wagantall <jwagantall@linuxfoundation.org>
2017-11-15Upgrade to 1.1.2-SNAPSHOTPamela Dragosh1-1/+1
Released 1.1.1, now must bump patch by 1 Issue-ID: POLICY-436 Change-Id: I3f5e4c369575f6fe1fa06cabb96a5bd43cb11087 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2017-11-08Update SNAPSHOT versionPamela Dragosh1-1/+1
Releasing v1.1.0 so need to update version to 1.1.1 Issue-ID: POLICY-436 Change-Id: I8b85de39bb3a32f5f4faeeb4fcdfb5d95291ae31 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2017-11-07SNAPSHOT present in policy core and msb depsv1.1.0Jorge Hernandez1-2/+2
Change-Id: I61c8d698f8cf984c648e510997498d41e7d9744a Issue-ID: POLICY-433 Signed-off-by: Jorge Hernandez <jh1730@att.com>
2017-11-03Made network.log output more verbose.Magnusen, Drew (dm741q)1-1/+1
Incoming values were not expanded in network logs for several drools-applications. Current patch makes them more verbose. Issue-ID: POLICY-410 Change-Id: I64bf88a3b39ea58dceaf24de698c8ae6a9a3f8b2 Signed-off-by: Magnusen, Drew (dm741q) <dm741q@att.com>
2017-10-20Added log output to multiple drools applications.Magnusen, Drew (dm741q)1-0/+4
Added logger statments to network.log for AAI, SO, PDPX Guard, and VFC for all inbound/outbound traffic. Issue-Id: POLICY-356 Change-Id: I802d45d8136f987b4304baa8f17e166b1c8df165 Signed-off-by: Magnusen, Drew (dm741q) <dm741q@att.com>
2017-10-18Removed useless imports to clear Sonar IssuesHockla, Ali (ah999m)1-2/+0
Issue-ID: POLICY-292 Change-Id: Ia4d4fae4150ea12e46079aabb4bbf4e3c92c8d00 Signed-off-by: Hockla, Ali (ah999m) <ah999m@att.com>
2017-10-17Fix operation history DB properties for JunitsTemoc Rodriguez3-33/+19
Removed operation_history.properties / operations-history.properties. Changed the properties in persistence.xml so that it uses the correct values. Previously junit would never write to db because the "guard.disabled" property was not set. Set this property. Additionally the operationshistory10 table was trying to be created even though it exists. These values work in junit code. Not tested on rackspace yet. Issue-ID: POLICY-345 Change-Id: Id755b3152ae6ac4991ea9c314154592ea0105070 Signed-off-by: Temoc Rodriguez <cr056n@att.com>
2017-10-11Fix nullPointerException non-200 guard response.Temoc Rodriguez1-6/+7
Added a check for when the guard response from pdp-x is not 200. When the response is unauthorized or forbidden, it will have an empty body, try to convert to json, and throw an exception. Added a null check on the response and returns indeterminate in the case of an empty body. Issue-ID: POLICY-280 Change-Id: I9d384472e230495130bd41d377e25b74fe9ea9bd Signed-off-by: Temoc Rodriguez <cr056n@att.com>
2017-10-04Fixed Sonar blockers/criticalsHockla, Ali (ah999m)2-5/+5
Issue-ID: POLICY-292 Change-Id: Id53e9d3b6ba23b20d7e45d4d3b39f8092f126333 Signed-off-by: Hockla, Ali (ah999m) <ah999m@att.com>
2017-09-28Merge "Add missing auth headers to guard request"Jorge Hernandez3-117/+386
2017-09-28Add missing auth headers to guard requestTemoc Rodriguez3-117/+386
Added guard authentication, client authentication, and environment http headers to the pdp-x guard restful request. Properties are set to PolicyEngine.manager. Property getter, setter, and properties in guard/.../Util.java. Test properties defined in junits themselves. Added code from GuardContext.java to grab the properties and make restful request. PolicyGuardXacmlHelper now closely resembles GuardContext in order to mimic functionality. Guard url no longer is passed into CallGuardTask, it is now a property. Issue-ID: POLICY-260 Change-Id: I5b144764828b6da0e7b738a578e4f6596a0f4f36 Signed-off-by: Temoc Rodriguez <cr056n@att.com>
2017-09-27Fix major sonar issuesshashikanth1-0/+2
Fix major sonar issues in policy/drools-applications module https://sonar.onap.org/component_issues?id=org.onap.policy.drools-applications%3Adrools-pdp-apps#resolved=false|severities=MAJOR|rules=squid%3AS1161 Added "@Override" annotation above this method signature. Issue-Id:POLICY-239 Change-Id: I578d0e740a6c04ba02df400a3abc99f9b774908a Signed-off-by: shashikanth.vh <shashikanth.vh@huawei.com>
2017-09-21Add guard simulator and multiple AAI responsesCharles Cole1-1/+1
Added a guard simulator that can permit or deny (it sends a deny if the clname is denyGuard). Added responses to the AAI simulator to set the is-closed-loop-disabled to true (use a get query with a key of disableClosedLoop). Changed the content-type of all responses to application/json. Issue-ID: POLICY-256 Change-Id: If84813968d3ea59d9ebe029caa69f444a1f413c8 Signed-off-by: Charles Cole <cc847m@att.com>