Merge "Upgrade sanitize for security"
authorChristophe Closset <cc697w@intl.att.com>
Thu, 5 Jul 2018 16:10:51 +0000 (16:10 +0000)
committerGerrit Code Review <gerrit@onap.org>
Thu, 5 Jul 2018 16:10:51 +0000 (16:10 +0000)
extra/docker/clamp/config/org.onap.clamp.keyfile [new file with mode: 0644]
extra/docker/clamp/config/org.onap.clamp.p12 [new file with mode: 0644]
extra/docker/clamp/config/truststoreONAPall.jks [new file with mode: 0644]
extra/docker/clamp/docker-compose.yml
src/main/java/org/onap/clamp/clds/client/req/sdc/SdcCatalogServices.java
src/test/java/org/onap/clamp/clds/it/SdcCatalogServicesItCase.java

diff --git a/extra/docker/clamp/config/org.onap.clamp.keyfile b/extra/docker/clamp/config/org.onap.clamp.keyfile
new file mode 100644 (file)
index 0000000..3e131ee
--- /dev/null
@@ -0,0 +1,32 @@
+Bag Attributes
+    friendlyName: clamp@clamp.onap.org
+    localKeyID: 54 69 6D 65 20 31 35 33 30 36 32 36 36 37 38 32 30 31 
+Key Attributes: <No Attributes>
+-----BEGIN PRIVATE KEY-----
+MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDHXy3ZbCHGPhEe
+hvmv44infMBmJv5UAz4cxI6zUJV4mDXyjJxMy0hbjSZx9x6sZSBDXeiWwz6pQafk
+VKP06BfBmjvJz0d07pRugI5tczLyJIm8umPJ2igTPjAj/+NuO6Dwt0XeGPVF7otx
+0IB96RFFSE8bsTIXrUW9Eg8/oKicjhCbvJnxv49aj6Po23o2+59t2t8SotccRt2A
+bkMpAy1wh2qUcRveSkrXnT8IbvxwwgdYM/07OwcQTVIbKPiSDsdxO4bUdL8cAZ/3
+S4ulB33QzNAII2syzWAl6pY53Mjl8tJEIirt2OvNyKNjFYh3m+UcGuhoquVHm1Ev
+ZH5DLtWJAgMBAAECggEAIxvywggVxohlkV+plrzV8tC4PQT+4qKTjJNcod0+BTeg
+wG7ck3V075Jiw80F3MwOK27dJ7eIUFwcicwR923ryQ81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V9xru1CFJQtWxD7qeIqYlYUPLZuoLVNbgtAXBAFyUjcUeXIAEg4Ti2tlvc
+86nrgb7/kSLXqHV4/Ykg15s=
+-----END PRIVATE KEY-----
diff --git a/extra/docker/clamp/config/org.onap.clamp.p12 b/extra/docker/clamp/config/org.onap.clamp.p12
new file mode 100644 (file)
index 0000000..fd151a9
Binary files /dev/null and b/extra/docker/clamp/config/org.onap.clamp.p12 differ
diff --git a/extra/docker/clamp/config/truststoreONAPall.jks b/extra/docker/clamp/config/truststoreONAPall.jks
new file mode 100644 (file)
index 0000000..910f9b1
Binary files /dev/null and b/extra/docker/clamp/config/truststoreONAPall.jks differ
index 69e4715..0821fff 100644 (file)
@@ -22,6 +22,7 @@ services:
       - clamp.env
     ports:
       - "8080:8080"
+      - "8443:8443"
 
   third_party_proxy:
     image: python:2-slim
index 9c94021..240094e 100644 (file)
@@ -17,6 +17,7 @@
  * See the License for the specific language governing permissions and\r
  * limitations under the License.\r
  * ============LICENSE_END============================================\r
+ * Modifications copyright (c) 2018 Nokia\r
  * ===================================================================\r
  * \r
  */\r
@@ -227,13 +228,12 @@ public class SdcCatalogServices {
      */\r
     public List<SdcResourceBasicInfo> removeDuplicateSdcResourceBasicInfo(\r
             List<SdcResourceBasicInfo> rawCldsSdcResourceListBasicList) {\r
-        List<SdcResourceBasicInfo> cldsSdcResourceBasicInfoList = null;\r
+        List<SdcResourceBasicInfo> cldsSdcResourceBasicInfoList = new ArrayList<>();\r
         if (rawCldsSdcResourceListBasicList != null && !rawCldsSdcResourceListBasicList.isEmpty()) {\r
             // sort list\r
             Collections.sort(rawCldsSdcResourceListBasicList);\r
             // and then take only the resources with the max version (last in\r
             // the list with the same name)\r
-            cldsSdcResourceBasicInfoList = new ArrayList<>();\r
             for (int i = 1; i < rawCldsSdcResourceListBasicList.size(); i++) {\r
                 // compare name with previous - if not equal, then keep the\r
                 // previous (it's the last with that name)\r
index 4a13c62..330ee60 100644 (file)
  * See the License for the specific language governing permissions and 
  * limitations under the License.
  * ============LICENSE_END============================================
+ * Modifications copyright (c) 2018 Nokia
  * ===================================================================
  * 
  */
 
 package org.onap.clamp.clds.it;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertTrue;
 
+import java.util.ArrayList;
 import java.util.LinkedList;
 import java.util.List;
 
@@ -170,6 +173,23 @@ public class SdcCatalogServicesItCase {
         assertTrue("1.0".equals(res2.getVersion()));
     }
 
+
+    @Test
+    public void removeDuplicateSdcFunctionShouldNotReturnNull(){
+        // given
+        SdcCatalogServices catalogServices = new SdcCatalogServices();
+
+        // when
+        List<SdcResourceBasicInfo> firstResult = catalogServices
+            .removeDuplicateSdcResourceBasicInfo(null);
+        List<SdcResourceBasicInfo> secondResult = catalogServices
+            .removeDuplicateSdcResourceBasicInfo(new ArrayList<>());
+
+        // then
+        assertThat(firstResult).isEmpty();
+        assertThat(secondResult).isEmpty();
+    }
+
     @Test
     public void getServiceUuidFromServiceInvariantIdTest() throws Exception {
         SdcCatalogServices spy = Mockito.spy(sdcCatalogWired);