def listManagement(self, vendor=None, product=None): try: if product is None: # no product selected yet, so same function as /browse can be used if vendor: vendor = urllib.parse.quote_plus(vendor).lower() browseList = getBrowseList(vendor) vendor = browseList["vendor"] product = browseList["product"] version = None else: # product selected, product versions required version = getVersionsOfProduct( urllib.parse.quote_plus(product).lower()) return render_template("listmanagement.html", vendor=vendor, product=product, version=version) except redisExceptions.ConnectionError: return render_template( "error.html", status={ "except": "redis-connection", "info": { "host": Configuration.getRedisHost(), "port": Configuration.getRedisPort(), }, }, )
def listManagement(vendor=None, product=None): try: if product is None and vendor is None: # no product selected yet, so same function as /browse can be used vendor = [x for x in dbh.connection.store_cves.distinct("vendors") if x is not None] product = None version = None elif product is None: vendor = vendor product = [x for x in dbh.connection.store_cves.distinct("products", {"vendors": vendor}) if x is not None] version = None else: # product selected, product versions required version = getVersionsOfProduct(urllib.parse.quote_plus(product).lower()) return render_template( "listmanagement.html", vendor=vendor, product=product, version=version ) except redisExceptions.ConnectionError: return render_template( "error.html", status={ "except": "redis-connection", "info": {"host": config.getRedisHost(), "port": config.getRedisPort(),}, }, )
def get(self, vendor, product): """ List CPEs of product Returns a list of CPEs of a specific product. When the link is called, it enumerates the CPEs for said product. """ browse_list = getVersionsOfProduct(product) result = {"vendor": vendor, "product": product, "version": browse_list} return result