diff --git a/cveClientlib.js b/cveClientlib.js index 0a050ff..4fcca59 100644 --- a/cveClientlib.js +++ b/cveClientlib.js @@ -5,7 +5,7 @@ class cveClient { this.key = key; this.url = url; this.user_path = "/org/" + this.org + "/user/" + this.user; - this._version = "1.0.15"; + this._version = "1.0.25"; } /* PUT /cve/{id}/adp — the only ADP endpoint per CVE Services API spec See https://cveawg.mitre.org/api-docs/ */ @@ -22,6 +22,8 @@ class cveClient { let path = "/cve/" + cve + "/cna"; if(rejected) path = "/cve/" + cve + "/reject"; + if(!cnajson["x_generator"]) + cnajson["x_generator"] = {engine: "cveClient/" + this._version}; return this.putjson(path,opts,null,{cnaContainer:cnajson}); } reservecve(amount,cve_year,batch_type) { diff --git a/cveInterface.js b/cveInterface.js index 1332812..f5cddc7 100644 --- a/cveInterface.js +++ b/cveInterface.js @@ -1,9 +1,26 @@ /* Clientlib, UI html, css and UI js all are version controlled */ const _version = "1.0.25"; -const _tool = "CVE Services Client Interface "+_version; -const _cna_template = { "descriptions": [ { "lang": "${descriptions.0.lang}", "value": "${descriptions.0.value}"} ] , "affected": [ { "versions": [{"version": "${affected.0.versions.0.version}"}], "product": "${affected.0.product}", "vendor": "${affected.0.vendor|client.orgobj.name}" } ],"references": [ { "name": "${references.0.name}", "url": "${references.0.url}" }], "providerMetadata": { "orgId": "${client.userobj.org_UUID}", "shortName": "${client.org}" } } -const schemaUrl = "https://cveproject.github.io/cve-schema/schema/docs/CVE_Record_Format_bundled.json"; -const valid_states = {PUBLISHED: 1,RESERVED: 1, REJECTED: 1}; +const _tool = "CVE Services Client Interface " + _version; +const _cna_template = { + descriptions: [ + { lang: "${descriptions.0.lang}", value: "${descriptions.0.value}" }, + ], + affected: [ + { + versions: [{ version: "${affected.0.versions.0.version}" }], + product: "${affected.0.product}", + vendor: "${affected.0.vendor|client.orgobj.name}", + }, + ], + references: [{ name: "${references.0.name}", url: "${references.0.url}" }], + providerMetadata: { + orgId: "${client.userobj.org_UUID}", + shortName: "${client.org}", + }, +}; +const schemaUrl = + "https://cveproject.github.io/cve-schema/schema/docs/CVE_Record_Format_bundled.json"; +const valid_states = { PUBLISHED: 1, RESERVED: 1, REJECTED: 1 }; let store; let store_tag = "cveClient/"; /* User var to access client as window.client global var */ @@ -11,2009 +28,2161 @@ var client; /* Global variables for dynamic forms */ var autoCompleter; var allFieldsForm; -function add_option(w,v,f,s) { - $(w).append($('