Skip to content

Commit

Permalink
Add matchStringSearch parameter for CPE match API
Browse files Browse the repository at this point in the history
  • Loading branch information
timopollmeier committed Nov 15, 2024
1 parent 69e4029 commit 83ef84a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pontos/nvd/cpe_match/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def cpe_matches(
last_modified_start_date: Optional[datetime] = None,
last_modified_end_date: Optional[datetime] = None,
cve_id: Optional[str] = None,
match_string_search: Optional[str] = None,
request_results: Optional[int] = None,
start_index: int = 0,
results_per_page: Optional[int] = None,
Expand All @@ -102,6 +103,7 @@ def cpe_matches(
last_modified_start_date: Return all CPE matches last modified after this date.
last_modified_end_date: Return all CPE matches last modified before this date.
cve_id: Return all CPE matches for this Common Vulnerabilities and Exposures identifier.
match_string_search: Return all CPE matches that conform to the given pattern
request_results: Number of CPE matches to download. Set to None
(default) to download all available matches.
start_index: Index of the first CPE match to be returned. Useful
Expand Down Expand Up @@ -141,6 +143,8 @@ def cpe_matches(

if cve_id:
params["cveId"] = cve_id

Check warning on line 145 in pontos/nvd/cpe_match/api.py

View check run for this annotation

Codecov / codecov/patch

pontos/nvd/cpe_match/api.py#L145

Added line #L145 was not covered by tests
if match_string_search:
params["matchStringSearch"] = match_string_search

Check warning on line 147 in pontos/nvd/cpe_match/api.py

View check run for this annotation

Codecov / codecov/patch

pontos/nvd/cpe_match/api.py#L147

Added line #L147 was not covered by tests

results_per_page = min(

Check warning on line 149 in pontos/nvd/cpe_match/api.py

View check run for this annotation

Codecov / codecov/patch

pontos/nvd/cpe_match/api.py#L149

Added line #L149 was not covered by tests
results_per_page or MAX_CPE_MATCHES_PER_PAGE,
Expand Down

0 comments on commit 83ef84a

Please sign in to comment.