Skip to content

Commit

Permalink
Add elif for "component" in content for list of Findings
Browse files Browse the repository at this point in the history
"vulnerabilities" is replaced with "response" since it is an API 3.0 Platform call to retrieve a project SCA dependency vulns.  Furthermore, "libraries" is replaced with "component" in the updated 3.0 Platform output
  • Loading branch information
testaccount90009 committed Nov 14, 2024
1 parent 5a9f279 commit 52776b1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dojo/tools/mend/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,12 @@ def _build_common_output(node, lib_name=None):
tree_node = content["vulnerabilities"]
for node in tree_node:
findings.append(_build_common_output(node))

Check failure on line 199 in dojo/tools/mend/parser.py

View workflow job for this annotation

GitHub Actions / ruff-linting

Ruff (W293)

dojo/tools/mend/parser.py:199:1: W293 Blank line contains whitespace
elif "component" in content:
# likely a Mend Platform or 3.0 API SCA output - "library" is replaced as "component"
tree_node = content["response"]
for node in tree_node:
findings.append(_build_common_output(node))

def create_finding_key(f: Finding) -> str:
"""Hashes the finding's description and title to retrieve a key for deduplication."""
Expand Down

0 comments on commit 52776b1

Please sign in to comment.