From 146700d2fa0d5ee8fc7a262700e0819b50ede21c Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 6 Mar 2023 14:35:44 -0500 Subject: [PATCH] feat: [grafeas] Import of Grafeas from Github (#4049) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Import of Grafeas from Github PiperOrigin-RevId: 513603965 Source-Link: https://github.com/googleapis/googleapis/commit/7044962d31b872f7424bf3b320add0c4a3b186e8 Source-Link: https://github.com/googleapis/googleapis-gen/commit/0ca25aa1245ce4057f3fbd88653e58970731f571 Copy-Tag: eyJwIjoicGFja2FnZXMvZ3JhZmVhcy8uT3dsQm90LnlhbWwiLCJoIjoiMGNhMjVhYTEyNDVjZTQwNTdmM2ZiZDg4NjUzZTU4OTcwNzMxZjU3MSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot Co-authored-by: Denis DelGrosso <85250797+ddelgrosso1@users.noreply.github.com> --- .../protos/grafeas/v1/vulnerability.proto | 10 +++- packages/grafeas/protos/protos.d.ts | 12 ++++ packages/grafeas/protos/protos.js | 56 +++++++++++++++++++ packages/grafeas/protos/protos.json | 8 +++ .../v1/snippet_metadata.grafeas.v1.json | 2 +- 5 files changed, 85 insertions(+), 3 deletions(-) diff --git a/packages/grafeas/protos/grafeas/v1/vulnerability.proto b/packages/grafeas/protos/grafeas/v1/vulnerability.proto index cea4558b144..99abf3be7a2 100644 --- a/packages/grafeas/protos/grafeas/v1/vulnerability.proto +++ b/packages/grafeas/protos/grafeas/v1/vulnerability.proto @@ -152,7 +152,10 @@ message VulnerabilityNote { // CVSS version used to populate cvss_score and severity. grafeas.v1.CVSSVersion cvss_version = 7; - // Next free ID is 8. + // The full description of the v2 CVSS for this vulnerability. + CVSS cvss_v2 = 8; + + // Next free ID is 9. } // An occurrence of a severity vulnerability on a resource. @@ -247,5 +250,8 @@ message VulnerabilityOccurrence { // Output only. CVSS version used to populate cvss_score and severity. grafeas.v1.CVSSVersion cvss_version = 11; - // Next free ID is 12. + // The cvss v2 score for the vulnerability. + CVSS cvss_v2 = 12; + + // Next free ID is 13. } diff --git a/packages/grafeas/protos/protos.d.ts b/packages/grafeas/protos/protos.d.ts index 1e5ba86ccb5..b8d9ebc30a3 100644 --- a/packages/grafeas/protos/protos.d.ts +++ b/packages/grafeas/protos/protos.d.ts @@ -11520,6 +11520,9 @@ export namespace grafeas { /** VulnerabilityNote cvssVersion */ cvssVersion?: (grafeas.v1.CVSSVersion|keyof typeof grafeas.v1.CVSSVersion|null); + + /** VulnerabilityNote cvssV2 */ + cvssV2?: (grafeas.v1.ICVSS|null); } /** Represents a VulnerabilityNote. */ @@ -11552,6 +11555,9 @@ export namespace grafeas { /** VulnerabilityNote cvssVersion. */ public cvssVersion: (grafeas.v1.CVSSVersion|keyof typeof grafeas.v1.CVSSVersion); + /** VulnerabilityNote cvssV2. */ + public cvssV2?: (grafeas.v1.ICVSS|null); + /** * Creates a new VulnerabilityNote instance using the specified properties. * @param [properties] Properties to set @@ -12064,6 +12070,9 @@ export namespace grafeas { /** VulnerabilityOccurrence cvssVersion */ cvssVersion?: (grafeas.v1.CVSSVersion|keyof typeof grafeas.v1.CVSSVersion|null); + + /** VulnerabilityOccurrence cvssV2 */ + cvssV2?: (grafeas.v1.ICVSS|null); } /** Represents a VulnerabilityOccurrence. */ @@ -12108,6 +12117,9 @@ export namespace grafeas { /** VulnerabilityOccurrence cvssVersion. */ public cvssVersion: (grafeas.v1.CVSSVersion|keyof typeof grafeas.v1.CVSSVersion); + /** VulnerabilityOccurrence cvssV2. */ + public cvssV2?: (grafeas.v1.ICVSS|null); + /** * Creates a new VulnerabilityOccurrence instance using the specified properties. * @param [properties] Properties to set diff --git a/packages/grafeas/protos/protos.js b/packages/grafeas/protos/protos.js index 8cd563c4a74..3187c027df9 100644 --- a/packages/grafeas/protos/protos.js +++ b/packages/grafeas/protos/protos.js @@ -29478,6 +29478,7 @@ * @property {Array.|null} [windowsDetails] VulnerabilityNote windowsDetails * @property {google.protobuf.ITimestamp|null} [sourceUpdateTime] VulnerabilityNote sourceUpdateTime * @property {grafeas.v1.CVSSVersion|null} [cvssVersion] VulnerabilityNote cvssVersion + * @property {grafeas.v1.ICVSS|null} [cvssV2] VulnerabilityNote cvssV2 */ /** @@ -29553,6 +29554,14 @@ */ VulnerabilityNote.prototype.cvssVersion = 0; + /** + * VulnerabilityNote cvssV2. + * @member {grafeas.v1.ICVSS|null|undefined} cvssV2 + * @memberof grafeas.v1.VulnerabilityNote + * @instance + */ + VulnerabilityNote.prototype.cvssV2 = null; + /** * Creates a new VulnerabilityNote instance using the specified properties. * @function create @@ -29593,6 +29602,8 @@ $root.google.protobuf.Timestamp.encode(message.sourceUpdateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); if (message.cvssVersion != null && Object.hasOwnProperty.call(message, "cvssVersion")) writer.uint32(/* id 7, wireType 0 =*/56).int32(message.cvssVersion); + if (message.cvssV2 != null && Object.hasOwnProperty.call(message, "cvssV2")) + $root.grafeas.v1.CVSS.encode(message.cvssV2, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); return writer; }; @@ -29659,6 +29670,10 @@ message.cvssVersion = reader.int32(); break; } + case 8: { + message.cvssV2 = $root.grafeas.v1.CVSS.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -29746,6 +29761,11 @@ case 2: break; } + if (message.cvssV2 != null && message.hasOwnProperty("cvssV2")) { + var error = $root.grafeas.v1.CVSS.verify(message.cvssV2); + if (error) + return "cvssV2." + error; + } return null; }; @@ -29845,6 +29865,11 @@ message.cvssVersion = 2; break; } + if (object.cvssV2 != null) { + if (typeof object.cvssV2 !== "object") + throw TypeError(".grafeas.v1.VulnerabilityNote.cvssV2: object expected"); + message.cvssV2 = $root.grafeas.v1.CVSS.fromObject(object.cvssV2); + } return message; }; @@ -29871,6 +29896,7 @@ object.cvssV3 = null; object.sourceUpdateTime = null; object.cvssVersion = options.enums === String ? "CVSS_VERSION_UNSPECIFIED" : 0; + object.cvssV2 = null; } if (message.cvssScore != null && message.hasOwnProperty("cvssScore")) object.cvssScore = options.json && !isFinite(message.cvssScore) ? String(message.cvssScore) : message.cvssScore; @@ -29892,6 +29918,8 @@ object.sourceUpdateTime = $root.google.protobuf.Timestamp.toObject(message.sourceUpdateTime, options); if (message.cvssVersion != null && message.hasOwnProperty("cvssVersion")) object.cvssVersion = options.enums === String ? $root.grafeas.v1.CVSSVersion[message.cvssVersion] === undefined ? message.cvssVersion : $root.grafeas.v1.CVSSVersion[message.cvssVersion] : message.cvssVersion; + if (message.cvssV2 != null && message.hasOwnProperty("cvssV2")) + object.cvssV2 = $root.grafeas.v1.CVSS.toObject(message.cvssV2, options); return object; }; @@ -30986,6 +31014,7 @@ * @property {grafeas.v1.Severity|null} [effectiveSeverity] VulnerabilityOccurrence effectiveSeverity * @property {boolean|null} [fixAvailable] VulnerabilityOccurrence fixAvailable * @property {grafeas.v1.CVSSVersion|null} [cvssVersion] VulnerabilityOccurrence cvssVersion + * @property {grafeas.v1.ICVSS|null} [cvssV2] VulnerabilityOccurrence cvssV2 */ /** @@ -31093,6 +31122,14 @@ */ VulnerabilityOccurrence.prototype.cvssVersion = 0; + /** + * VulnerabilityOccurrence cvssV2. + * @member {grafeas.v1.ICVSS|null|undefined} cvssV2 + * @memberof grafeas.v1.VulnerabilityOccurrence + * @instance + */ + VulnerabilityOccurrence.prototype.cvssV2 = null; + /** * Creates a new VulnerabilityOccurrence instance using the specified properties. * @function create @@ -31141,6 +31178,8 @@ $root.grafeas.v1.CVSS.encode(message.cvssv3, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); if (message.cvssVersion != null && Object.hasOwnProperty.call(message, "cvssVersion")) writer.uint32(/* id 11, wireType 0 =*/88).int32(message.cvssVersion); + if (message.cvssV2 != null && Object.hasOwnProperty.call(message, "cvssV2")) + $root.grafeas.v1.CVSS.encode(message.cvssV2, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); return writer; }; @@ -31223,6 +31262,10 @@ message.cvssVersion = reader.int32(); break; } + case 12: { + message.cvssV2 = $root.grafeas.v1.CVSS.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -31329,6 +31372,11 @@ case 2: break; } + if (message.cvssV2 != null && message.hasOwnProperty("cvssV2")) { + var error = $root.grafeas.v1.CVSS.verify(message.cvssV2); + if (error) + return "cvssV2." + error; + } return null; }; @@ -31463,6 +31511,11 @@ message.cvssVersion = 2; break; } + if (object.cvssV2 != null) { + if (typeof object.cvssV2 !== "object") + throw TypeError(".grafeas.v1.VulnerabilityOccurrence.cvssV2: object expected"); + message.cvssV2 = $root.grafeas.v1.CVSS.fromObject(object.cvssV2); + } return message; }; @@ -31493,6 +31546,7 @@ object.fixAvailable = false; object.cvssv3 = null; object.cvssVersion = options.enums === String ? "CVSS_VERSION_UNSPECIFIED" : 0; + object.cvssV2 = null; } if (message.type != null && message.hasOwnProperty("type")) object.type = message.type; @@ -31522,6 +31576,8 @@ object.cvssv3 = $root.grafeas.v1.CVSS.toObject(message.cvssv3, options); if (message.cvssVersion != null && message.hasOwnProperty("cvssVersion")) object.cvssVersion = options.enums === String ? $root.grafeas.v1.CVSSVersion[message.cvssVersion] === undefined ? message.cvssVersion : $root.grafeas.v1.CVSSVersion[message.cvssVersion] : message.cvssVersion; + if (message.cvssV2 != null && message.hasOwnProperty("cvssV2")) + object.cvssV2 = $root.grafeas.v1.CVSS.toObject(message.cvssV2, options); return object; }; diff --git a/packages/grafeas/protos/protos.json b/packages/grafeas/protos/protos.json index 90d226d4bb5..daa4360f11c 100644 --- a/packages/grafeas/protos/protos.json +++ b/packages/grafeas/protos/protos.json @@ -2551,6 +2551,10 @@ "cvssVersion": { "type": "grafeas.v1.CVSSVersion", "id": 7 + }, + "cvssV2": { + "type": "CVSS", + "id": 8 } }, "nested": { @@ -2698,6 +2702,10 @@ "cvssVersion": { "type": "grafeas.v1.CVSSVersion", "id": 11 + }, + "cvssV2": { + "type": "CVSS", + "id": 12 } }, "nested": { diff --git a/packages/grafeas/samples/generated/v1/snippet_metadata.grafeas.v1.json b/packages/grafeas/samples/generated/v1/snippet_metadata.grafeas.v1.json index 90ef90670a5..bf3623b4a96 100644 --- a/packages/grafeas/samples/generated/v1/snippet_metadata.grafeas.v1.json +++ b/packages/grafeas/samples/generated/v1/snippet_metadata.grafeas.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-grafeas", - "version": "4.2.1", + "version": "4.2.2", "language": "TYPESCRIPT", "apis": [ {