Skip to content

Commit b2ab6f7

Browse files
author
zeloff
committed
add get_document_with_references method
1 parent a016881 commit b2ab6f7

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

vulners/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22

3-
__version__ = "2.0.9"
3+
__version__ = "2.0.10"
44

55
import warnings
66
from .vulners import VulnersApi, Vulners

vulners/vulners.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,31 @@ def get_bulletin_references(self, id, fields=default_fields):
257257
"""
258258
return self.get_multiple_bulletin_references([id], fields=fields).get(id, {})
259259

260+
get_multiple_documents_with_references = Endpoint(
261+
method="post",
262+
url="/api/v3/search/id/",
263+
description="",
264+
params=[
265+
(
266+
"id",
267+
List(
268+
item=String(), description="List of ID's. E.g., ['CVE-2017-14174']"
269+
),
270+
),
271+
("fields", Tuple(item=String(), default=default_fields)),
272+
("references", Const(True)),
273+
]
274+
)
275+
276+
@validate_params(id=String(), fields=Tuple(item=String()))
277+
def get_document_with_references(self, id, fields=default_fields):
278+
"""
279+
Fetch bulletin with references by identificator
280+
281+
identificator: Bulletin ID. E.g., "CVE-2017-14174"
282+
"""
283+
return self.get_multiple_documents_with_references([id], fields=fields)
284+
260285
@validate_params(kbid=String())
261286
def get_kb_seeds(self, kbid):
262287
"""

0 commit comments

Comments
 (0)