Skip to content
This repository was archived by the owner on Feb 26, 2021. It is now read-only.

Commit 71e2767

Browse files
authored
Merge pull request #186 from secureCodeBox/feat/fetchProdFinding
feature: add fetch findings by product
2 parents 7ae01f4 + 8c68c20 commit 71e2767

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

  • scb-persistenceproviders/defectdojo-persistenceprovider/src/main/java/io/securecodebox/persistence

scb-persistenceproviders/defectdojo-persistenceprovider/src/main/java/io/securecodebox/persistence/DefectDojoService.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,6 @@ public void deleteUnusedBranches(List<String> existingBranches, long productId)
521521
if(existingBranches == null) {
522522
LOG.error("No existing branches given, this will lead to nullpointer");
523523
}
524-
RestTemplate restTemplate = new RestTemplate();
525524

526525
//get existing branches
527526
List<EngagementResponse> engagementPayloads = getEngagementsForProduct(productId, 0);
@@ -627,4 +626,20 @@ public List<Finding> receiveNonHandledFindings(String productName, String engage
627626
}
628627
return findings;
629628
}
629+
public List<Finding> receiveNonHandledProductFindings(String productName, String minimumSeverity, LinkedMultiValueMap<String, String> options){
630+
List<Finding> findings = new LinkedList<>();
631+
long productId = retrieveProductId(productName);
632+
633+
List<EngagementResponse> engagementPayloads = getEngagementsForProduct(productId, 0);
634+
for(EngagementResponse engagementPayload : engagementPayloads) {
635+
long engagementId = engagementPayload.getId();
636+
for(String severity : Finding.getServeritiesAndHigherServerities(minimumSeverity)) {
637+
options.remove("severity");
638+
options.add("severity", severity);
639+
findings.addAll(getCurrentFindings(engagementId, options));
640+
}
641+
}
642+
643+
return findings;
644+
}
630645
}

0 commit comments

Comments
 (0)