Re-encrypt drools-pdp properties 02/114402/1
authorJim Hahn <jrh3@att.com>
Wed, 28 Oct 2020 20:28:41 +0000 (16:28 -0400)
committerJim Hahn <jrh3@att.com>
Thu, 29 Oct 2020 17:57:40 +0000 (13:57 -0400)
To satisfy sonar, the algorithm for policy/common CryptoUtils has been
changed, necessitating the properties be re-encrypted.

Issue-ID: POLICY-2801
Change-Id: I59e63d68c1c7f62e321aa729e11fe41e13efd396
Signed-off-by: Jim Hahn <jrh3@att.com>
policy-utils/src/test/java/org/onap/policy/drools/utils/PropertyUtilTest.java
policy-utils/src/test/resources/interpolation.properties

index 006d709..4b4b9d6 100644 (file)
@@ -2,14 +2,14 @@
  * ============LICENSE_START=======================================================
  * ONAP
  * ================================================================================
- * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -40,12 +40,28 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class PropertyUtilTest {
+    /*
+     * Note: to generate the encrypted values, invoke CryptoUtils passing both the value
+     * to be encrypted and the crypto key.
+     *
+     * The INTERPOLATION_CRYPTO_KEY is a 16 or 32 character string, base-64 encoded.
+     *
+     * For "INTERPOLATION_ENC_HELLOWORLD", the encrypted value was generated via:
+     *  java org.onap.policy.common.utils.security.CryptoUtils enc HelloWorld MTIzNDU2Nzg5MDEyMzQ1Ng==
+     *
+     * The generated value should also be placed into the following properties within
+     * the file, interpolation.properties:
+     *  interpolation.enc
+     *  interpolation.enc2
+     *  interpolation.envenc
+     */
 
     private static final String INTERPOLATION_PROPERTIES = "src/test/resources/interpolation.properties";
     private static final String INTERPOLATION_CRYPTO_KEY = "MTIzNDU2Nzg5MDEyMzQ1Ng==";
     private static final String INTERPOLATION_PLAINTEXT = "HelloWorld";
     private static final String INTERPOLATION_ENVD_DEFAULT_VALUE = "default";
-    private static final String INTERPOLATION_ENC_HELLOWORLD = "enc:hcI2XVX+cxPz/6rlbebkWpCFF6WPbBtT7iJRr2VHUkA=";
+    private static final String INTERPOLATION_ENC_HELLOWORLD =
+                    "enc:MjGhDZTTIx1ihB7KvxLnOJcvb0WN/CSgpw7sY1hDnvL1VHa8wGRzOX3X";
     private static final String INTERPOLATION_ENC_HELLOWORLD_VAR = "${" + INTERPOLATION_ENC_HELLOWORLD + "}";
 
     private static final String INTERPOLATION_NO = "interpolation.no";
index 2145fb6..78ec546 100644 (file)
@@ -1,3 +1,23 @@
+#
+# ============LICENSE_START=======================================================
+# ONAP
+# ================================================================================
+# Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
+# ================================================================================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ============LICENSE_END=========================================================
+#
+
 interpolation.no=no
 interpolation.env=${env:HOME}
 interpolation.const=${const:org.onap.policy.drools.utils.logging.LoggerUtil.ROOT_LOGGER}
@@ -6,6 +26,6 @@ interpolation.envd=${envd:HOME}
 interpolation.envd.default=${envd:BLAH:default}
 interpolation.envd.none=${envd:BLAH}
 interpolation.envd.nodefault=${envd:BLAH:}
-interpolation.enc=${enc:hcI2XVX+cxPz/6rlbebkWpCFF6WPbBtT7iJRr2VHUkA=}
-interpolation.enc2=enc:hcI2XVX+cxPz/6rlbebkWpCFF6WPbBtT7iJRr2VHUkA=
-interpolation.envenc=${envd:HELLOWORLD:enc:hcI2XVX+cxPz/6rlbebkWpCFF6WPbBtT7iJRr2VHUkA=}
\ No newline at end of file
+interpolation.enc=${enc:MjGhDZTTIx1ihB7KvxLnOJcvb0WN/CSgpw7sY1hDnvL1VHa8wGRzOX3X}
+interpolation.enc2=enc:MjGhDZTTIx1ihB7KvxLnOJcvb0WN/CSgpw7sY1hDnvL1VHa8wGRzOX3X
+interpolation.envenc=${envd:HELLOWORLD:enc:MjGhDZTTIx1ihB7KvxLnOJcvb0WN/CSgpw7sY1hDnvL1VHa8wGRzOX3X}