diff --git a/pom.xml b/pom.xml index b3d4e302..4dd56eb4 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ api jar ${project.groupId}:${project.artifactId} - 3.4.44 + 3.4.45 Hygieia Rest API Layer https://github.com/Hygieia/api diff --git a/src/main/java/com/capitalone/dashboard/request/DashboardRemoteRequest.java b/src/main/java/com/capitalone/dashboard/request/DashboardRemoteRequest.java index 445f2fd4..f58da422 100644 --- a/src/main/java/com/capitalone/dashboard/request/DashboardRemoteRequest.java +++ b/src/main/java/com/capitalone/dashboard/request/DashboardRemoteRequest.java @@ -6,6 +6,7 @@ import com.capitalone.dashboard.model.CollectorItem; import com.capitalone.dashboard.model.CollectorType; import com.capitalone.dashboard.model.Owner; +import com.capitalone.dashboard.model.WhiteSourceComponent; import com.capitalone.dashboard.util.GitHubParsedUrl; import org.hibernate.validator.constraints.NotEmpty; @@ -17,6 +18,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Arrays; public class DashboardRemoteRequest extends BaseRequest { @Valid @@ -237,6 +239,18 @@ public CollectorItem toCollectorItem(Collector collector) throws HygieiaExceptio throw new HygieiaException(toolName + " collector does not support field: " + key, HygieiaException.COLLECTOR_ITEM_CREATE_ERROR); } } + // set options with defaults + if (collector.getName().equals("WhiteSource") && !options.keySet().contains("localConfig")){ + collectorItem.getOptions().put("localConfig", false); + } + else if(collector.getName().equals("Checkmarx")){ + if(!options.keySet().contains("fileExclusions") || options.get("fileExclusions").equals("")){ + collectorItem.getOptions().put("fileExclusions", " "); + } + if(!options.keySet().contains("folderExclusions") || options.get("folderExclusions").equals("")){ + collectorItem.getOptions().put("folderExclusions", " "); + } + } return collectorItem; } else { throw new HygieiaException("Missing required fields. " + toolName + " collector required fields are: " + String.join(", ", collector.getUniqueFields().keySet()), HygieiaException.COLLECTOR_ITEM_CREATE_ERROR);