Personalized client certificate authentication via FTPes in 5G Bulk PM usecase doesn... 31/95731/5
authorburdziak <olaf.burdziakowski@nokia.com>
Mon, 16 Sep 2019 10:56:44 +0000 (12:56 +0200)
committerburdziak <olaf.burdziakowski@nokia.com>
Wed, 18 Sep 2019 13:47:56 +0000 (15:47 +0200)
Issue-ID: DCAEGEN2-1754
Signed-off-by: burdziak <olaf.burdziakowski@nokia.com>
Change-Id: Idec3efce8412dd175ecf75f55790a24cec651104

datafile-app-server/pom.xml
datafile-app-server/src/main/java/org/onap/dcaegen2/collectors/datafile/model/FileData.java
datafile-app-server/src/test/java/org/onap/dcaegen2/collectors/datafile/model/FileDataTest.java
pom.xml
version.properties

index 6b0ebe4..5f9474a 100644 (file)
@@ -25,7 +25,7 @@
   <parent>
     <groupId>org.onap.dcaegen2.collectors</groupId>
     <artifactId>datafile</artifactId>
-    <version>1.2.2-SNAPSHOT</version>
+    <version>1.3.0-SNAPSHOT</version>
   </parent>
 
   <groupId>org.onap.dcaegen2.collectors.datafile</groupId>
index 8cafd0c..4805cb4 100644 (file)
@@ -130,6 +130,12 @@ public abstract class FileData {
             String[] userAndPassword = userInfoString.split(":");
             if (userAndPassword.length == 2) {
                 return Optional.of(userAndPassword);
+            }else if(userAndPassword.length == 1)//if just user
+            {
+              String[] tab = new String[2];
+              tab[0] = userAndPassword[0];
+              tab[1] = "";//add empty password
+              return Optional.of(tab);
             }
         }
         return Optional.empty();
index 35894f9..10a84e7 100644 (file)
@@ -37,6 +37,8 @@ public class FileDataTest {
     private static final int PORT_22 = 22;
     private static final String LOCATION_WITH_USER =
         FTPES_SCHEME + USER + ":" + PWD + "@" + SERVER_ADDRESS + ":" + PORT_22 + REMOTE_FILE_LOCATION;
+    private static final String LOCATION_WITH_USER_NO_PASSWORD =
+      FTPES_SCHEME + USER + "@" + SERVER_ADDRESS + ":" + PORT_22 + REMOTE_FILE_LOCATION;
     private static final String LOCATION_WITHOUT_USER =
         FTPES_SCHEME + SERVER_ADDRESS + ":" + PORT_22 + REMOTE_FILE_LOCATION;
 
@@ -65,6 +67,18 @@ public class FileDataTest {
             .build();
     }
 
+  private FileData properFileDataWithUserNoPassword() {
+    return ImmutableFileData.builder() //
+        .name("name") //
+        .location(LOCATION_WITH_USER_NO_PASSWORD) //
+        .compression("comp") //
+        .fileFormatType("type") //
+        .fileFormatVersion("version") //
+        .scheme(Scheme.FTPS) //
+        .messageMetaData(messageMetaData()) //
+        .build();
+  }
+
     private FileData properFileDataWithoutUser() {
         return ImmutableFileData.builder() //
             .name("name") //
@@ -90,6 +104,19 @@ public class FileDataTest {
         assertEquals(expectedFileServerData, actualFileServerData);
     }
 
+    @Test
+    public void fileServerData_properLocationWithUserNoPassword() {
+        ImmutableFileServerData expectedFileServerData = ImmutableFileServerData.builder() //
+            .serverAddress(SERVER_ADDRESS) //
+            .port(PORT_22) //
+            .userId(USER) //
+            .password("") //
+            .build();
+
+        FileServerData actualFileServerData = properFileDataWithUserNoPassword().fileServerData();
+        assertEquals(expectedFileServerData, actualFileServerData);
+    }
+
     @Test
     public void fileServerData_properLocationWithoutUser() {
         ImmutableFileServerData expectedFileServerData = ImmutableFileServerData.builder() //
diff --git a/pom.xml b/pom.xml
index 31d2df3..50d2de9 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -30,7 +30,7 @@
 
   <groupId>org.onap.dcaegen2.collectors</groupId>
   <artifactId>datafile</artifactId>
-  <version>1.2.2-SNAPSHOT</version>
+  <version>1.3.0-SNAPSHOT</version>
 
   <name>dcaegen2-collectors.datafile</name>
   <description>datafile collector</description>
index e562846..f520c97 100644 (file)
@@ -1,6 +1,6 @@
 major=1\r
-minor=2\r
-patch=2\r
+minor=3\r
+patch=0\r
 base_version=${major}.${minor}.${patch}\r
 release_version=${base_version}\r
 snapshot_version=${base_version}-SNAPSHOT\r