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 authored and y0urself committed Dec 2, 2024
1 parent 8cea952 commit 1195c28
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
if match_string_search:
params["matchStringSearch"] = match_string_search

results_per_page = min(
results_per_page or MAX_CPE_MATCHES_PER_PAGE,
Expand Down

0 comments on commit 1195c28

Please sign in to comment.