Commit 1b4294df authored by Alexandre Dulaunoy's avatar Alexandre Dulaunoy
Browse files

Dump last 30 entries in JSON (via the API).

API /api/last dump in JSON the last 30 updated entries of CVE.
The entries are expanded including CPE, CAPEC and CWE.
parent 992e7f45
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -240,6 +240,13 @@ def apibrowse(vendor=None):
    else:
    else:
        return (jsonify({}))
        return (jsonify({}))


@app.route('/api/last/', methods=['GET'])
@app.route('/api/last', methods=['GET'])
def apilast():
    limit = 30
    cvesp = cves.last(rankinglookup=True, namelookup=True, vfeedlookup=True, capeclookup=True)
    cve = cvesp.get(limit=limit)
    return (jsonify({"results": cve} ))


@app.route('/api/search/<vendor>/<path:product>', methods=['GET'])
@app.route('/api/search/<vendor>/<path:product>', methods=['GET'])
def apisearch(vendor=None, product=None):
def apisearch(vendor=None, product=None):