Skip to content

Commit

Permalink
add get_document_with_references method
Browse files Browse the repository at this point in the history
  • Loading branch information
zeloff committed May 16, 2023
1 parent a016881 commit b2ab6f7
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion vulners/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-

__version__ = "2.0.9"
__version__ = "2.0.10"

import warnings
from .vulners import VulnersApi, Vulners
Expand Down
25 changes: 25 additions & 0 deletions vulners/vulners.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,31 @@ def get_bulletin_references(self, id, fields=default_fields):
"""
return self.get_multiple_bulletin_references([id], fields=fields).get(id, {})

get_multiple_documents_with_references = Endpoint(
method="post",
url="/api/v3/search/id/",
description="",
params=[
(
"id",
List(
item=String(), description="List of ID's. E.g., ['CVE-2017-14174']"
),
),
("fields", Tuple(item=String(), default=default_fields)),
("references", Const(True)),
]
)

@validate_params(id=String(), fields=Tuple(item=String()))
def get_document_with_references(self, id, fields=default_fields):
"""
Fetch bulletin with references by identificator
identificator: Bulletin ID. E.g., "CVE-2017-14174"
"""
return self.get_multiple_documents_with_references([id], fields=fields)

@validate_params(kbid=String())
def get_kb_seeds(self, kbid):
"""
Expand Down

0 comments on commit b2ab6f7

Please sign in to comment.