policy/common.git
3 years agorefactor slf4j logger to common util 02/123102/1
Taka Cho [Wed, 4 Aug 2021 13:30:11 +0000 (09:30 -0400)]
refactor slf4j logger to common util

avoid EELF lib dependency, was suggested to move
to common util instead

Issue-ID: POLICY-3087
Change-Id: I79a2f5ba32fd3fc496ef3f72a02f4696b766f9c7
Signed-off-by: Taka Cho <takamune.cho@att.com>
3 years agorefactor slf4j Marker to common repo 37/123037/3
Taka Cho [Mon, 2 Aug 2021 16:06:08 +0000 (12:06 -0400)]
refactor slf4j Marker to common repo

slf4j Marker logger is using in drools-pdp
and clamp. was suggested to move to common repo
to reduce duplicated codes. And possibly other
repo would be used also.

Issue-ID: POLICY-3087
Change-Id: If14b89c18e28f517f83a2b9a8dcce201333a919e
Signed-off-by: Taka Cho <takamune.cho@att.com>
3 years agoUpdate Pam's email INFO.yaml 01/122601/1
Dragosh, Pamela (pd1248) [Tue, 13 Jul 2021 14:26:03 +0000 (10:26 -0400)]
Update Pam's email INFO.yaml

Issue-ID: POLICY-3484
Change-Id: I57aa0b25c104acaa5529f95ee2cbf4e5c73195ab
Signed-off-by: Dragosh, Pamela (pd1248) <pd1248@att.com>
3 years agoMerge "Use UUID for topic consumer instance"
Jim Hahn [Fri, 2 Jul 2021 16:48:47 +0000 (16:48 +0000)]
Merge "Use UUID for topic consumer instance"

3 years agoWait after fetch exception on topic 03/122403/2
Jim Hahn [Thu, 1 Jul 2021 15:41:00 +0000 (11:41 -0400)]
Wait after fetch exception on topic

When dmaap is inaccessible for some reason, the topic source frequently
enters a fast fail loop, rapidly filling up the log.  Modified the code
to wait the configured fetchTimeout when this occurs.

With any luck, this will also fix the sporadic kubernetes crash-fail
loops sometimes seen with the xacml-pdp pod.

Modified to limit how long it will sleep after a failure, regardless of
the fetchTimeout that was specified.

Issue-ID: POLICY-3457
Change-Id: I88e360fb1d31197b46f4959e5ea0ea2d741ad25c
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoUse UUID for topic consumer instance 93/122393/2
Jim Hahn [Thu, 1 Jul 2021 14:21:23 +0000 (10:21 -0400)]
Use UUID for topic consumer instance

Modified the code so that if the consumer group is defined, but the
consumer instance is not, then policy-endpoints will generate a UUID for
the consumer instance.
Made the logic a little more straight-forward in response to a review
comment.

Issue-ID: POLICY-3405
Change-Id: If74440bdb01525bc463a28e5b8a9a2eca89a855a
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoAddress sonars in common 49/122349/2
Jim Hahn [Tue, 29 Jun 2021 20:48:07 +0000 (16:48 -0400)]
Address sonars in common

Fixed:
- use "var"
- duplicate code block

Issue-ID: POLICY-3284
Change-Id: I8cd7f2588353a2e7702c90d37d7b9f972634dca9
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoMerge "Add name generator for PAP and PDPs"
Ajith Sreekumar [Tue, 29 Jun 2021 08:28:39 +0000 (08:28 +0000)]
Merge "Add name generator for PAP and PDPs"

3 years agoMerge "Update policy-common for checkstyle 8.43"
Liam Fallon [Mon, 28 Jun 2021 14:44:54 +0000 (14:44 +0000)]
Merge "Update policy-common for checkstyle 8.43"

3 years agoUpdate policy-common for checkstyle 8.43 65/122265/1
liamfallon [Mon, 28 Jun 2021 09:32:06 +0000 (10:32 +0100)]
Update policy-common for checkstyle 8.43

Issue-ID: POLICY-3206
Change-Id: I6d14a62e6619e2162e68846853feb36b95274866
Signed-off-by: liamfallon <liam.fallon@est.tech>
3 years agoAdd name generator for PAP and PDPs 24/122224/1
Jim Hahn [Fri, 25 Jun 2021 21:29:21 +0000 (17:29 -0400)]
Add name generator for PAP and PDPs

Added a method that PAPs and PDPs can use to generate a unique name or
identifier to be used in PAP-PDP messages.

Issue-ID: POLICY-3410
Change-Id: I22b075b123f79ba05e0884f743296c4bc64842b9
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoMove Validators and RestClientParameters in policy-common 71/122071/4
FrancescoFioraEst [Mon, 21 Jun 2021 09:39:22 +0000 (10:39 +0100)]
Move Validators and RestClientParameters in policy-common

Issue-ID: POLICY-3402
Change-Id: I7479027e3ea1e960266264c2d13cd69e2103710b
Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
3 years agoMerge "Fix new checkstyle issues in policy-common"
Jim Hahn [Fri, 18 Jun 2021 14:12:38 +0000 (14:12 +0000)]
Merge "Fix new checkstyle issues in policy-common"

3 years agoMerge "Use lombok in policy-endpoints"
Jim Hahn [Fri, 18 Jun 2021 13:40:05 +0000 (13:40 +0000)]
Merge "Use lombok in policy-endpoints"

3 years agoFix new checkstyle issues in policy-common 39/122039/1
Jim Hahn [Fri, 18 Jun 2021 13:27:39 +0000 (09:27 -0400)]
Fix new checkstyle issues in policy-common

The new version of checkstyle identified new issues.  Fixed those.

Issue-ID: POLICY-3284
Change-Id: I2a8bf2b460fda7972ce573f14df5af52d46c9993
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoUse lombok in policy-common utils-test 19/122019/3
Jim Hahn [Thu, 17 Jun 2021 17:16:43 +0000 (13:16 -0400)]
Use lombok in policy-common utils-test

Issue-ID: POLICY-3394
Change-Id: I85504848afc268be7419654dc95ed555d870272c
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoMerge "Use lombok in policy-common utils"
Jim Hahn [Fri, 18 Jun 2021 12:41:58 +0000 (12:41 +0000)]
Merge "Use lombok in policy-common utils"

3 years agoMerge "Use lombok annotations in IM and ONAP logging"
Jim Hahn [Thu, 17 Jun 2021 22:22:41 +0000 (22:22 +0000)]
Merge "Use lombok annotations in IM and ONAP logging"

3 years agoUse lombok in policy-common utils 18/122018/2
Jim Hahn [Thu, 17 Jun 2021 17:02:08 +0000 (13:02 -0400)]
Use lombok in policy-common utils

Issue-ID: POLICY-3394
Change-Id: I42a18c115c3ca7110f37fc0ae8aeea3f2bbffb37
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoUse lombok in policy-endpoints 16/122016/1
Jim Hahn [Thu, 17 Jun 2021 15:54:29 +0000 (11:54 -0400)]
Use lombok in policy-endpoints

Issue-ID: POLICY-3394
Change-Id: I8dfb0814d5cc544b2c334dc11a3e69ef407f163f
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoUse lombok annotations in IM and ONAP logging 13/122013/2
Jim Hahn [Thu, 17 Jun 2021 14:32:25 +0000 (10:32 -0400)]
Use lombok annotations in IM and ONAP logging

Issue-ID: POLICY-3394
Change-Id: I25db6b4b13bad8754889eaedb93197cae7d27c4d
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoUse lombok in common params 97/121997/1
Jim Hahn [Wed, 16 Jun 2021 21:45:03 +0000 (17:45 -0400)]
Use lombok in common params

Also condensed some Map calls.

Issue-ID: POLICY-3394
Change-Id: I850fcad5a72d92271da76b0731195e8b93dd4089
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoValidator should report serialized field name 20/121620/1
Jim Hahn [Tue, 1 Jun 2021 14:18:13 +0000 (10:18 -0400)]
Validator should report serialized field name

The validator reports field names as they appear in the class rather
than as they appear on the wire, which may be confusing to the client.
Modified the code to use the serialized name instead.
Note: this will require tweaks to some junits in some of the other
policy repos.

Issue-ID: POLICY-3333
Change-Id: I867dafdc87cd78dec3d3c6fe0236a744284314a3
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoFix sonar issues in common 77/121577/1
Jim Hahn [Thu, 27 May 2021 21:25:07 +0000 (17:25 -0400)]
Fix sonar issues in common

Fixed sonar issue:
- class should not be abstract

Issue-ID: POLICY-3284
Change-Id: I9c4aa149b7321cbcaff8dce5e2999315a06f19b0
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoMerge "Enhance toString methods in factory classes"
Jim Hahn [Mon, 24 May 2021 20:51:53 +0000 (20:51 +0000)]
Merge "Enhance toString methods in factory classes"

3 years agoFix sonar duplicate code issue 07/121507/3
Jim Hahn [Fri, 21 May 2021 21:31:02 +0000 (17:31 -0400)]
Fix sonar duplicate code issue

Issue-ID: POLICY-3284
Change-Id: I78c3a8ac92e18e2b0088eb07e27a4e97866d6182
Signed-off-by: Jim Hahn <jrh3@att.com>
3 years agoEnhance toString methods in factory classes 04/121504/1
Jim Hahn [Fri, 21 May 2021 16:19:44 +0000 (12:19 -0400)]
Enhance toString methods in factory classes

The factory classes in policy-endpoints have toString() methods that
return "[]" for their list contents.  Updated the code to provide a list
of the keys rather than just an empty list.
Also replaced some toString() methods with lombok.
Also replace StringBuilder with concatenation in some cases.

Issue-ID: POLICY-3298
Change-Id: I64fca21a4b009f7e09fcc482b5d156753fb7e680
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoChange java.util.regex to re2j 96/121196/2
Jim Hahn [Fri, 7 May 2021 19:35:55 +0000 (15:35 -0400)]
Change java.util.regex to re2j

Sonar complains about java.util.regex.  Thought I used re2j when
creating all of the patterns, but apparently not.  Fixed that oversight.

Issue-ID: POLICY-3284
Change-Id: Idbec112ab0d4c3b477ce357f8a556d95e4dea083
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoFix sonars in policy-common 36/121136/3
Jim Hahn [Thu, 6 May 2021 15:28:53 +0000 (11:28 -0400)]
Fix sonars in policy-common

Fixed sonars:
- use "var" instead of actual type name
- re-interrupt threads
- use rej2 split() instead of String split()

Issue-ID: POLICY-3285
Change-Id: I82261e0b8a53ee5c5264556fbf5cec37454f014e
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoRemove GroupValidationResult 15/120915/5
Jim Hahn [Mon, 26 Apr 2021 21:41:25 +0000 (17:41 -0400)]
Remove GroupValidationResult

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.
Added Size annotation, used to verify minimum lengths of maps and
collections.
Added ClassName annotation, used to verify that a property contains the
name of a class that is actually in the classpath.
Added another addResult() method to make it easier when replacing calls
to GroupValidationResult setResult() method with BeanValidationResult.

Issue-ID: POLICY-2059
Change-Id: Id4da24886908723006624c5d53edeb034102299d
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoMerge "Revert "Modify StandardCoder to handle empty source""
Pamela Dragosh [Tue, 13 Apr 2021 17:16:58 +0000 (17:16 +0000)]
Merge "Revert "Modify StandardCoder to handle empty source""

4 years agoRevert "Modify StandardCoder to handle empty source" 00/120500/1
Jim Hahn [Tue, 13 Apr 2021 15:31:48 +0000 (15:31 +0000)]
Revert "Modify StandardCoder to handle empty source"

This reverts commit 04623fef95f2b164d79ad48de2ef3708d02eda80.

Reason for revert: prefer consistency with gson

Issue-ID: POLICY-3172
Change-Id: Ic2501abcc68ec1186142a7e520e7985c43fd3315
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoAdd command line handler 23/120423/3
adheli.tavares [Fri, 9 Apr 2021 10:51:05 +0000 (11:51 +0100)]
Add command line handler

Added a Handler for command line classes to share common strucutures.

Issue-ID: POLICY-3128
Change-Id: I662911c467faf5c39b8db018bb1a564fba7587a6
Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
4 years agoModify StandardCoder to handle empty source 35/120335/1
Jim Hahn [Wed, 7 Apr 2021 20:23:10 +0000 (16:23 -0400)]
Modify StandardCoder to handle empty source

Currently, if the source string or source file is empty, the
StandardCoder just returns null.  Modified it to throw an exception in
those cases.  However, if the string reference is null, it will still
return null.

Issue-ID: POLICY-3172
Change-Id: Ie7d5e1b0328a24d94a75af8d18a341faebbe5d5f
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoUse self-signed-cert property for HTTP clients 66/119866/2
Jim Hahn [Thu, 25 Mar 2021 17:52:02 +0000 (13:52 -0400)]
Use self-signed-cert property for HTTP clients

Currently, the HttpClient code sets self-signed-certs to true whenever
https is specified.  This is insecure.  Modified the code to set the
value based on the property, defaulting to false.

Issue-ID: POLICY-3145
Change-Id: Ie88cf2411ae44a7c53bc8943f615a74c5b87d1aa
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoAdd utility to generate keystore for testing 57/119457/4
Jim Hahn [Wed, 17 Mar 2021 22:55:15 +0000 (18:55 -0400)]
Add utility to generate keystore for testing

Added a class that will generate a keystore containing a self-signed
certificate.

Issue-ID: POLICY-3147
Change-Id: I25e7307c2e73dbacae24c8fce616bf2ada93df9f
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoRemove more unnecessary plugins from common 75/119275/1
Jim Hahn [Fri, 12 Mar 2021 22:07:34 +0000 (17:07 -0500)]
Remove more unnecessary plugins from common

Issue-ID: POLICY-3126
Change-Id: I2f39e14c9cea0ec58709e24995aab536f2df7990
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoAddress plugin-not-found issues 86/119186/3
Jim Hahn [Mon, 8 Mar 2021 19:28:10 +0000 (14:28 -0500)]
Address plugin-not-found issues

Removed references to archetype-packaging and lifecycle-mapping, where
unnecessary due to pom inheritance.

Issue-ID: POLICY-3126
Change-Id: Ie31edcb7ae31e1bb495904fce2c8ed56d9bf10f5
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoBump version to 1.9.0 in common 06/119106/2
Jim Hahn [Wed, 10 Mar 2021 19:27:32 +0000 (14:27 -0500)]
Bump version to 1.9.0 in common

Issue-ID: POLICY-3105
Change-Id: I1fd654fef96a1e41f150ea13baf39acc882f6bb2
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoUpdate info.yaml in common 85/118385/1
Ram Krishna Verma [Wed, 24 Feb 2021 14:52:26 +0000 (09:52 -0500)]
Update info.yaml in common

Issue-ID: POLICY-3028
Change-Id: Id67f1f5205fe0522b8f909015a7cf503d82a585c
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
4 years agoBump version to 1.8.1-SNAPSHOT in common 38/118238/2
Jim Hahn [Tue, 23 Feb 2021 13:30:23 +0000 (08:30 -0500)]
Bump version to 1.8.1-SNAPSHOT in common

Issue-ID: POLICY-3088
Change-Id: I1cc2d1d26c337d67b0ecadd852e43b603902415e
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoRelease artifacts 1.8.0 of common 09/118209/1 8.0.0-ONAP
Jim Hahn [Mon, 22 Feb 2021 22:30:54 +0000 (17:30 -0500)]
Release artifacts 1.8.0 of common

Issue-ID: POLICY-3088
Change-Id: I2419754fc055bb350ebb9299a69c5e2d81fac173
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoPoint to non-snapshots in common 04/118204/2
Jim Hahn [Mon, 22 Feb 2021 21:03:13 +0000 (16:03 -0500)]
Point to non-snapshots in common

Issue-ID: POLICY-3088
Change-Id: I3b3afdc15fb006c6b5fc6b223aa4d3ff6f112f31
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoRemove duplicate code from type adapters 85/118085/2
Jim Hahn [Thu, 18 Feb 2021 22:15:07 +0000 (17:15 -0500)]
Remove duplicate code from type adapters

Extracted a common superclass, StringTypeAdapter, out of the gson type
adapter classes.

Issue-ID: POLICY-2914
Change-Id: I4bbd2a6e8372e7f42c4952ba9ff03eed97473fb2
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoAdd more java.time adapters 55/118055/4
Pamela Dragosh [Thu, 18 Feb 2021 15:57:23 +0000 (09:57 -0600)]
Add more java.time adapters

The time extensions require these adapters for anyone using our
gson adapter to serialize/deserialize the DecisionRequest.

Issue-ID: POLICY-2810
Change-Id: I64a7e4a5a256c77bd67dab867664e41b61cd0050
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agoMake gson type adapters more generic 01/117801/1
Jim Hahn [Fri, 12 Feb 2021 15:06:27 +0000 (10:06 -0500)]
Make gson type adapters more generic

Enhanced ZonedDateTime adapter so a date format string can be provided.
Simplified InstantAsMillis adapter.

Issue-ID: POLICY-2905
Change-Id: Ic4ddba19391b165d6a7528ce18c22541d12324c7
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoFix sonars from depeendency upgrade 63/117763/1
Jim Hahn [Thu, 11 Feb 2021 21:13:32 +0000 (16:13 -0500)]
Fix sonars from depeendency upgrade

The dependency upgrades in policy-parent caused some new sonars.  In
particular, initMocks() has been deprecated - replaced with calls to the
Mockito Runner.

Issue-ID: POLICY-2914
Change-Id: Iaf10f676c380adb9785e836cb15792596b378e4e
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoMore sonar issues in common 97/117697/1
Jim Hahn [Wed, 10 Feb 2021 19:23:02 +0000 (14:23 -0500)]
More sonar issues in common

Addressed the issues:
- use of eq() in verify()
- remove @NamedQueries
- use computeIfAbsent()

Issue-ID: POLICY-2914
Change-Id: I265bc98f0f326e7b4ce86c25e68fc4859bd7fb02
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoRemove javax.persistence dependency 08/117608/2
Jim Hahn [Thu, 4 Feb 2021 22:12:46 +0000 (17:12 -0500)]
Remove javax.persistence dependency

Running into a dependency collision between two eclipselink jars.  Turns
out, we don't actually need to include the javax.persistence dependency,
so removed it altogether.

Issue-ID: POLICY-3005
Change-Id: I5f09ddc27cdaa329b4604e6c715879d52335f870
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoAdd policy-clamp to policy Message constants 29/116929/1
liamfallon [Sat, 16 Jan 2021 09:06:21 +0000 (09:06 +0000)]
Add policy-clamp to policy Message constants

policy-clamp is now a valid component inthe policy framework and should
be added to the message constants in policy common.

Issue-ID: POLICY-2971
Change-Id: Iead3d4f854057c8e968d62928026b74c41bc1346
Signed-off-by: liamfallon <liam.fallon@est.tech>
4 years agoDeprecate old validation annotations 81/116681/1
Jim Hahn [Thu, 7 Jan 2021 15:03:30 +0000 (10:03 -0500)]
Deprecate old validation annotations

Removed @Items and @Entries validation annotations, as they are no
longer needed.

Issue-ID: POLICY-2648
Change-Id: I68b78738d520ad96175567572e3c2f4a845dae44
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoSupport annotations on parameterized types 35/116635/2
Jim Hahn [Wed, 6 Jan 2021 16:15:45 +0000 (11:15 -0500)]
Support annotations on parameterized types

It appears that java.validation allows validation annotations to be used
on the type parameters of Collection and Map classes.  Updated the
validation code to support that.  Once policy-models has been updated to
use this approach, the original @Items and @Entries annotations will be
deprecated.

Issue-ID: POLICY-2648
Change-Id: Ic953be485ebafc9869f72407518f6549585353c9
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoUpdate junits for Validation 76/116576/4
Jim Hahn [Mon, 4 Jan 2021 17:11:32 +0000 (12:11 -0500)]
Update junits for Validation

The Validation code was previously refactored.  Added/updated junits
correspondingly.

Issue-ID: POLICY-2648
Change-Id: I570c0ec692ecfcb6e69ada45f7997f6e63735ea0
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoMake validators extensible 89/116489/1
Jim Hahn [Fri, 18 Dec 2020 20:53:20 +0000 (15:53 -0500)]
Make validators extensible

Modified the validator to make it extensible.  Also added annotations
to:
- cascade a validation to a sub-object
- perform regex
- examine items in a list
- examine entries in a map

Still need more junit tests.

Issue-ID: POLICY-2648
Change-Id: I94f1b9e8fbf7a6b9b002d0b05cc9119bdfcf8bf2
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoConvert YAML Double to Integer/Long 47/116347/1
Jim Hahn [Mon, 14 Dec 2020 16:36:50 +0000 (11:36 -0500)]
Convert YAML Double to Integer/Long

When a YAML number is decoded directly to type Object.class using the
decode() or fromJson() methods of the StandardYamlCoder, the number is
left as a Double.  It should be converted to an Integer or Long, where
possible.

Issue-ID: POLICY-2900
Change-Id: I7707ac5c54167cbc3a4b23985c6e5fa1a507324e
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoFixing sonar issues in policy-common 24/116124/2
a.sreekumar [Fri, 4 Dec 2020 11:04:10 +0000 (11:04 +0000)]
Fixing sonar issues in policy-common

Change-Id: I4dce0dbdf71d01fbb59e9bf861d1af1ab49e5ae7
Issue-ID: POLICY-2914
Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
4 years agoGeneralize LocalDateTimeTypeAdapter 62/115562/1
Jim Hahn [Mon, 30 Nov 2020 19:34:29 +0000 (14:34 -0500)]
Generalize LocalDateTimeTypeAdapter

The GSON DateTime type adapter uses a hard-coded formatter.  Generalized
it to allow a different formatter to be provided to the constructor.

Issue-ID: POLICY-2903
Change-Id: Icdd51190f465bc4c73cd593d6d1b2003165a4b60
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoFix upcoming checkstyle issues 58/114658/1
Pamela Dragosh [Fri, 6 Nov 2020 13:14:51 +0000 (08:14 -0500)]
Fix upcoming checkstyle issues

When we upgrade to oparent, these will fail as oparent upgrades
to 8.37 of puppycrawl which fixes a few bugs that should have
flagged these previously.

Issue-ID: POLICY-2887
Change-Id: I5618ce67d84e94321f884ed6d929c05fc33a0b3d
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agoRemove server-side filtering from policy-endpoints 02/114502/1
Jim Hahn [Thu, 29 Oct 2020 20:07:19 +0000 (16:07 -0400)]
Remove server-side filtering from policy-endpoints

ONAP DMaaP Message Router no longer supports server-side filtering.
Removed it from policy-endpoints.

Issue-ID: POLICY-2881
Change-Id: I08157f7699608af63992dec78a61c5f9c55037b9
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoInclude jackson jar in policy-endpoints 13/114413/1
Jim Hahn [Thu, 29 Oct 2020 19:12:23 +0000 (15:12 -0400)]
Include jackson jar in policy-endpoints

Issue-ID: POLICY-2878
Change-Id: Ibfe4c220c7b15bb0b752537d080481350a1332e4
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoFix sonar security issue in CryptoUtils 74/114374/3
Jim Hahn [Wed, 28 Oct 2020 20:22:01 +0000 (16:22 -0400)]
Fix sonar security issue in CryptoUtils

Sonar reports that CryptoUtils is using AES with CBC, which is known
to be insecure.  Switched to "AES/GCM/NoPadding".
Note: values in any property files using encryption or the "enc:"
prefix will have to be re-encrypted.

Issue-ID: POLICY-2801
Change-Id: I41f00d4f3ee67a00b92135150120d1faa621655a
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoBump common master to 1.8.0 SNAPSHOT 85/114285/2
Jim Hahn [Tue, 27 Oct 2020 17:26:59 +0000 (13:26 -0400)]
Bump common master to 1.8.0 SNAPSHOT

Bumping minor version now that guilin branch has been created.

Issue-ID: POLICY-2875
Change-Id: Id812dfd1406f8567a17ce4037eaa8cf8e7e4be26
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoFix more sonars in policy/common 04/113404/1
Jim Hahn [Wed, 30 Sep 2020 21:31:34 +0000 (17:31 -0400)]
Fix more sonars in policy/common

Addressed the following sonar issues:
- extract common test methods

Issue-ID: POLICY-2650
Change-Id: I0b27c83d7bbe3d5fe83859b189c37507aabe7489
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoSkip sonar in common utils-test 90/113390/1
Jim Hahn [Wed, 30 Sep 2020 16:41:42 +0000 (12:41 -0400)]
Skip sonar in common utils-test

sonar.tests didn't work, so just switching to sonar.skip, because
utils-test is not used in production code.

Issue-ID: POLICY-2650
Change-Id: I67bf9abda724944e080bbbf3a9bdc108dbd629c8
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoNew sonars in policy-common 78/113278/2
Jim Hahn [Mon, 28 Sep 2020 18:37:44 +0000 (14:37 -0400)]
New sonars in policy-common

Addressed the following sonars:
- too many assertions in a test case
- use parameterized test method

Disabled production sonars for util-test, as the entire module is only
used for testing other modules.

Issue-ID: POLICY-2650-sonar
Change-Id: If49775a6c95855dcd9601ee0d833bb00741b1550
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoBump common to 1.7.2 84/112284/1
Jim Hahn [Tue, 8 Sep 2020 15:08:56 +0000 (11:08 -0400)]
Bump common to 1.7.2

Issue-ID: POLICY-2789
Change-Id: Ia29c63d215facba9796a9dabdd4e9ea6792a852a
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoRelease common 1.7.1 77/112277/2 7.0.0-ONAP
Jim Hahn [Tue, 8 Sep 2020 13:46:53 +0000 (09:46 -0400)]
Release common 1.7.1

Issue-ID: POLICY-2789
Change-Id: Ifbbf7eadca68892254acabcecbb3710a0de41aff
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoAdding common success/failure messages for policy components 71/111271/3
a.sreekumar [Fri, 14 Aug 2020 10:24:10 +0000 (11:24 +0100)]
Adding common success/failure messages for policy components

Change-Id: Ic1b0a3b467fd9e4f65b2e12d9f6ed33e38e4f44d
Issue-ID: POLICY-2755
Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
4 years agoUpdate INFO.yaml in policy-common 70/110670/2
Jim Hahn [Tue, 28 Jul 2020 18:04:18 +0000 (14:04 -0400)]
Update INFO.yaml in policy-common

Verified with Jessica W that the "type" should still be "Addition",
even when updating the PTL.
Updated to Mature, per TSC.

Issue-ID: POLICY-2738
Change-Id: I9fd1adf4986edfe0b87b337a3e913608084da04d
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoAdd Ajith to policy-common info 34/110534/5
Jim Hahn [Thu, 23 Jul 2020 22:57:30 +0000 (18:57 -0400)]
Add Ajith to policy-common info

Issue-ID: POLICY-2738
Change-Id: I368308548f5f7d97db774ea27677171181d217b5
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoRemove jackson from policy-common 88/110388/2
Jim Hahn [Mon, 20 Jul 2020 20:33:10 +0000 (16:33 -0400)]
Remove jackson from policy-common

Issue-ID: POLICY-1528
Change-Id: Ic4b9314a770e53cefb93776bfede35591363690e
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoBump policy/common to 1.7.1-SNAPSHOT 23/110023/1
Ram Krishna Verma [Thu, 9 Jul 2020 17:26:45 +0000 (13:26 -0400)]
Bump policy/common to 1.7.1-SNAPSHOT

Issue-ID: POLICY-2695
Change-Id: I75fef54eb4bad2cb4b1430618d0ac3de4ecb9493
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
4 years agoRelease policy/common 1.7.0 17/110017/1
Ram Krishna Verma [Thu, 9 Jul 2020 15:57:36 +0000 (11:57 -0400)]
Release policy/common 1.7.0

Issue-ID: POLICY-2695
Change-Id: I3605de083efbaeae276a09da409ce44c982bc173
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
4 years agoRefer to released parent in policy/common 15/110015/1
Ram Krishna Verma [Thu, 9 Jul 2020 15:36:24 +0000 (11:36 -0400)]
Refer to released parent in policy/common

Issue-ID: POLICY-2695
Change-Id: Ife7a14cbc1197dd45281f1e846a906310496bf3a
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
4 years agoMerge "Removing hamcrest and openpojo from utils pom"
Jorge Hernandez [Thu, 2 Jul 2020 16:10:55 +0000 (16:10 +0000)]
Merge "Removing hamcrest and openpojo from utils pom"

4 years agoRemoving hamcrest and openpojo from utils pom 79/109779/1
RossC [Thu, 2 Jul 2020 15:35:08 +0000 (16:35 +0100)]
Removing hamcrest and openpojo from utils pom

Issue-ID: POLICY-2387
Change-Id: I43916ce97c43892fed4ed3a78f972f6b97e3237f
Signed-off-by: RossC <ross.carter@est.tech>
4 years agoMerge "Updating common dependencies"
Jorge Hernandez [Thu, 2 Jul 2020 14:50:16 +0000 (14:50 +0000)]
Merge "Updating common dependencies"

4 years agoUpdating common dependencies 64/109764/1
RossC [Wed, 1 Jul 2020 15:45:01 +0000 (16:45 +0100)]
Updating common dependencies

Issue-ID: POLICY-2387
Change-Id: Ib2b14f66f6416ca3b8d6353bb6aa19fa2f41ebbb
Signed-off-by: RossC <ross.carter@est.tech>
4 years agoFix build breakage in policy-common 42/109742/1
Jim Hahn [Wed, 1 Jul 2020 14:36:31 +0000 (10:36 -0400)]
Fix build breakage in policy-common

When the commit for https://gerrit.onap.org/r/c/policy/parent/+/109705
was applied, it broke the changes to common to fix new sonar issues.
Backed out some of those changes.

Issue-ID: POLICY-2650
Change-Id: Id498392ff798e49c281296575223298c0b6e5143
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoFix sonars in common due to dependency upgrades 02/109702/1
Jim Hahn [Tue, 30 Jun 2020 17:01:09 +0000 (13:01 -0400)]
Fix sonars in common due to dependency upgrades

Fixed the following issues:
- don't use annotation wrappers
- version overridden in pom

Issue-ID: POLICY-2650
Change-Id: Ia520037529861f8ace160c172ed70a5671b740d9
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoFix sonar about always-trust-manager 82/109682/1
Jim Hahn [Tue, 30 Jun 2020 13:14:51 +0000 (09:14 -0400)]
Fix sonar about always-trust-manager

This trust manager is not secure and should be avoided.  However,
it is only used when the configuration explicitly says to allow
self-signed certificates.  Modified the code to use an apache trust
manager, thus avoid the sonar complaint.

Issue-ID: POLICY-2650
Change-Id: Iaf4c72689916ed5ed5e6864666f3f54b2c5e0f12
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoFix new logger sonars in policy-common 61/109661/2
Jim Hahn [Mon, 29 Jun 2020 18:55:27 +0000 (14:55 -0400)]
Fix new logger sonars in policy-common

Not sure if this was introduced with the new logger version, but
now seeing a number of new sonars about using "{}".  Fixed those.

Issue-ID: POLICY-2650
Change-Id: If36b2e89aa9151700bb9cea2906b6afaad5c4c72
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoMerge "upgrade eelf-core dependency: 1.0.0 -> 2.0.0-oss"
Ram Krishna Verma [Mon, 29 Jun 2020 18:07:50 +0000 (18:07 +0000)]
Merge "upgrade eelf-core dependency: 1.0.0 -> 2.0.0-oss"

4 years agoFix issues in common for new sonar rules 54/109654/2
Jim Hahn [Mon, 29 Jun 2020 14:16:44 +0000 (10:16 -0400)]
Fix issues in common for new sonar rules

Addressed issues reported due to updates to the sonar rules:
- invoke only one method in a junit lambda
- complete the assertion
- add DOCTYPE to html

Issue-ID: POLICY-2650
Change-Id: Ib8b8a2e4736cc23849c0f7aef972ffa3365a3e00
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoupgrade eelf-core dependency: 1.0.0 -> 2.0.0-oss 53/109653/1
jhh [Mon, 29 Jun 2020 14:54:06 +0000 (09:54 -0500)]
upgrade eelf-core dependency: 1.0.0 -> 2.0.0-oss

Issue-ID: POLICY-2387
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: I837c2e958a388e8b6f2df2aff9f995359e44ad62

4 years agoMerge "Fix deprecated method in policy-common"
Pamela Dragosh [Thu, 25 Jun 2020 16:13:37 +0000 (16:13 +0000)]
Merge "Fix deprecated method in policy-common"

4 years agoFix Junit failed after AAF version change 2.1.21 32/109532/3
Utkarsh Jauhari [Wed, 24 Jun 2020 20:49:50 +0000 (20:49 +0000)]
Fix Junit failed after AAF version change 2.1.21

Issue-ID: POLICY-2623
Signed-off-by: Utkarsh Jauhari <uj426b@att.com>
Change-Id: I86c5b6efac8f62dd0d4ba576d8ec49cfa63a58bb

4 years agoFix deprecated method in policy-common 29/109529/1
Jim Hahn [Wed, 24 Jun 2020 19:07:23 +0000 (15:07 -0400)]
Fix deprecated method in policy-common

Probably due to a jar update, some methods are now deprecated.
Fixed them.

Issue-ID: POLICY-2650
Change-Id: I48aabd4552faaf88671dfbe6556dc739a8c94809
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoMerge "More sonar issues in policy-common"
Pamela Dragosh [Fri, 19 Jun 2020 11:05:39 +0000 (11:05 +0000)]
Merge "More sonar issues in policy-common"

4 years agoMore sonar issues in policy-common 19/109319/2
Jim Hahn [Thu, 18 Jun 2020 14:42:08 +0000 (10:42 -0400)]
More sonar issues in policy-common

Addressed the following sonar issues:
- add parameters to types
- ObjectInputStream.readObject() is unsafe

Issue-ID: POLICY-2650
Change-Id: I41e1bd08643b04f409ce87c884cb0c28995e431b
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoChanges for checkstyle 8.32 07/109307/1
liamfallon [Thu, 18 Jun 2020 12:49:01 +0000 (13:49 +0100)]
Changes for checkstyle 8.32

Issue-ID: POLICY-2188
Change-Id: I00843c61a6567001fc35c3ebb77b6843a1eb7da2
Signed-off-by: liamfallon <liam.fallon@est.tech>
4 years agoCleanup various sonar issues in policy-common 69/109269/1
Jim Hahn [Wed, 17 Jun 2020 12:37:15 +0000 (08:37 -0400)]
Cleanup various sonar issues in policy-common

Addressed the following issues:
- unused imports
- unused method parameters
- use assertEquals, assertSame instead of assertTrue
- provide the parametrized type for this generic

Also fixed some checkstyle issues:
- removed blank lines between "import" groups

Issue-ID: POLICY-2650
Change-Id: I004bb650ac10c49ccd0fc405f6959896fec39f9b
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoMerge "Remove logback.xml files bundled as part of jar"
Ram Krishna Verma [Fri, 12 Jun 2020 14:48:20 +0000 (14:48 +0000)]
Merge "Remove logback.xml files bundled as part of jar"

4 years agoRemove logback.xml files bundled as part of jar 94/109094/1
a.sreekumar [Fri, 12 Jun 2020 09:42:01 +0000 (10:42 +0100)]
Remove logback.xml files bundled as part of jar

Change-Id: Ia98493a3ec6ad91a46c88ab71998eb039da44842
Issue-ID: POLICY-2627
Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
4 years agoRemoving log4j from policy/common 70/109070/4
uj426b [Thu, 11 Jun 2020 17:32:53 +0000 (13:32 -0400)]
Removing log4j from policy/common

Change-Id: Ib662556533f72c99180b611d0a1933f20e231b2c
Issue-ID: POLICY-2623
Signed-off-by: uj426b <uj426b@att.com>
4 years agoCode changes for dmaap-client upgrade 70/108670/1
Jim Hahn [Tue, 2 Jun 2020 13:55:34 +0000 (09:55 -0400)]
Code changes for dmaap-client upgrade

Issue-ID: POLICY-1996
Change-Id: Id8a3acf9406c6acada4c3ffee679f2baf819cded
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agojetty-servlets now defined in oparent 41/108541/1
Pamela Dragosh [Thu, 28 May 2020 21:52:46 +0000 (17:52 -0400)]
jetty-servlets now defined in oparent

latest oparent has this new dependency in it.

Issue-ID: POLICY-2319
Change-Id: If3b9f64caa41923da1fabc6183434fc21ec00548
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agoPoint to parent SNAPSHOT 30/108430/1
Pamela Dragosh [Thu, 28 May 2020 18:31:31 +0000 (14:31 -0400)]
Point to parent SNAPSHOT

So we can tackle security dependency upgrades

Issue-ID: POLICY-2391
Change-Id: Iffbcc045d487045a982035e1f832f8eede59c919
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
4 years agoMake GSON the default serializer 24/108324/2
Jim Hahn [Tue, 26 May 2020 20:25:59 +0000 (16:25 -0400)]
Make GSON the default serializer

The default serialization provider for HttpClient and
HttpServletServer was Jackson.  Modified to use GSON instead.

Issue-ID: POLICY-1526
Change-Id: Ic6282d119fa63d12470903a4f1eb4da3afd6efe7
Signed-off-by: Jim Hahn <jrh3@att.com>
4 years agoBump common master to 1.7.0 03/107903/1
Pamela Dragosh [Tue, 19 May 2020 17:34:34 +0000 (13:34 -0400)]
Bump common master to 1.7.0

Issue-ID: POLICY-2514
Change-Id: Ic7bcf44a9f0c887d6c99edb8609725a15c4aa9a7
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>