Skip to content

Commit 1f718d8

Browse files
n-thumanngreenbonebot
authored andcommitted
Change: Fix docstrings / variable names
1 parent 4b8a3e5 commit 1f718d8

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

pontos/nvd/source/api.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
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+
)
2830
MAX_SOURCES_PER_PAGE = 1000
2931

3032

@@ -35,7 +37,7 @@ def _result_iterator(data: JSON) -> Iterator[Source]:
3537

3638
class 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.

tests/nvd/source/test_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ async def test_sources(self):
108108
with self.assertRaises(StopAsyncIteration):
109109
await anext(it)
110110

111-
async def test_cve_changes_change_dates(self):
111+
async def test_sources_change_dates(self):
112112
self.http_client.get.side_effect = create_source_responses()
113113

114114
it = aiter(

0 commit comments

Comments
 (0)