2424
2525__all__ = ("SourceApi" ,)
2626
27- DEFAULT_NIST_NVD_CVES_URL = "https://services.nvd.nist.gov/rest/json/source/2.0"
27+ DEFAULT_NIST_NVD_SOURCE_URL = (
28+ "https://services.nvd.nist.gov/rest/json/source/2.0"
29+ )
2830MAX_SOURCES_PER_PAGE = 1000
2931
3032
@@ -35,7 +37,7 @@ def _result_iterator(data: JSON) -> Iterator[Source]:
3537
3638class SourceApi (NVDApi ):
3739 """
38- API for querying the NIST NVD CVE Change History information .
40+ API for querying the NIST NVD source API .
3941
4042 Should be used as an async context manager.
4143
@@ -58,7 +60,7 @@ def __init__(
5860 request_attempts : int = 1 ,
5961 ) -> None :
6062 """
61- Create a new instance of the CVE API.
63+ Create a new instance of the source API.
6264
6365 Args:
6466 token: The API key to use. Using an API key allows to run more
@@ -73,7 +75,7 @@ def __init__(
7375 request_attempts: The number of attempts per HTTP request. Defaults to 1.
7476 """
7577 super ().__init__ (
76- DEFAULT_NIST_NVD_CVES_URL ,
78+ DEFAULT_NIST_NVD_SOURCE_URL ,
7779 token = token ,
7880 timeout = timeout ,
7981 rate_limit = rate_limit ,
@@ -96,12 +98,14 @@ def sources(
9698 https://nvd.nist.gov/developers/data-sources#divGetSource
9799
98100 Args:
99- last_modified_start_date: Return all CVEs modified after this date.
100- last_modified_end_date: Return all CVEs modified before this date.
101+ last_modified_start_date: Return all sources modified after this date.
102+ last_modified_end_date: Return all sources modified before this date.
101103 If last_modified_start_date is set but no
102104 last_modified_end_date is passed it is set to now.
103- source_identifier: Return all source records where the source identifier matches
104- start_index: Index of the first CVE to be returned. Useful only for
105+ source_identifier: Return all source records where the source identifier matches.
106+ request_results: Number of sources to download. Set to None
107+ (default) to download all available CPEs.
108+ start_index: Index of the first source to be returned. Useful only for
105109 paginated requests that should not start at the first page.
106110 results_per_page: Number of results in a single requests. Mostly
107111 useful for paginated requests.
0 commit comments