Skip to content

Commit

Permalink
Minor 1.5.7
Browse files Browse the repository at this point in the history
Added references option to the documents call.
  • Loading branch information
vulnersCom committed Jul 28, 2020
1 parent 79f2ccc commit 3cec49e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion vulners/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-

__version__ = "1.5.6"
__version__ = "1.5.7"

from vulners.api import Vulners
8 changes: 4 additions & 4 deletions vulners/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,15 +519,15 @@ def cpeVulnerabilities(self, cpeString, maxVulnerabilities = 50):
dataDocs[elementData.get('bulletinFamily')] = dataDocs.get(elementData.get('bulletinFamily'), []) + [elementData]
return dataDocs

def document(self, identificator, fields = None):
def document(self, identificator, fields = None, references = False):
"""
Fetch information about bulletin by identificator
:param identificator: Bulletin ID. As example - CVE-2017-14174
:param references: Search for the references in all collections
:return: bulletin data dict
"""
results = self.__id(identificator, references=False, fields = fields or self.default_fields)
results = self.__id(identificator, references=references, fields = fields or self.default_fields)
return results.get('documents', {}).get(identificator, {})

def audit(self, os, os_version, package):
Expand Down Expand Up @@ -597,7 +597,7 @@ def kbUpdates(self, kb_identificator, fields = None):
dataDocs.append(element.get('_source'))
return AttributeList(dataDocs, total=total)

def documentList(self, identificatorList, fields = None):
def documentList(self, identificatorList, fields = None, references = False):
"""
Fetch information about multiple bulletin identificators
Expand All @@ -607,7 +607,7 @@ def documentList(self, identificatorList, fields = None):

if not isinstance(identificatorList, (list,set)) or not all(isinstance(item, string_types) for item in identificatorList):
raise TypeError('Identificator list is expected to be a list of strings')
return self.__id(identificatorList, references=False, fields=fields or self.default_fields).get('documents')
return self.__id(identificatorList, references=references, fields=fields or self.default_fields).get('documents')

def references(self, identificator, fields = None):
"""
Expand Down

0 comments on commit 3cec49e

Please sign in to comment.