Skip to content

Commit 8142938

Browse files
docs(samples): include metadata file, add exclusions for samples to handwritten libraries (googleapis#375)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 429395631 Source-Link: googleapis/googleapis@84594b3 Source-Link: https://github.com/googleapis/googleapis-gen/commit/ed74f970fd82914874e6b27b04763cfa66bafe9b Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWQ3NGY5NzBmZDgyOTE0ODc0ZTZiMjdiMDQ3NjNjZmE2NmJhZmU5YiJ9
1 parent 3655ccf commit 8142938

File tree

63 files changed

+28050
-24796
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+28050
-24796
lines changed

Diff for: .jsdoc.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2021 Google LLC
1+
// Copyright 2022 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -40,7 +40,7 @@ module.exports = {
4040
includePattern: '\\.js$'
4141
},
4242
templates: {
43-
copyright: 'Copyright 2021 Google LLC',
43+
copyright: 'Copyright 2022 Google LLC',
4444
includeDate: false,
4545
sourceFiles: false,
4646
systemName: '@google-cloud/containeranalysis',

Diff for: linkinator.config.json

+8-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,14 @@
33
"skip": [
44
"https://codecov.io/gh/googleapis/",
55
"www.googleapis.com",
6-
"img.shields.io"
6+
"img.shields.io",
7+
"https://console.cloud.google.com/cloudshell",
8+
"https://support.google.com"
79
],
810
"silent": true,
9-
"concurrency": 5
11+
"concurrency": 5,
12+
"retry": true,
13+
"retryErrors": true,
14+
"retryErrorsCount": 5,
15+
"retryErrorsJitter": 3000
1016
}

Diff for: protos/google/devtools/containeranalysis/v1/containeranalysis.proto

+14-17
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019 Google LLC
1+
// Copyright 2021 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -23,7 +23,9 @@ import "google/api/resource.proto";
2323
import "google/iam/v1/iam_policy.proto";
2424
import "google/iam/v1/policy.proto";
2525
import "google/protobuf/timestamp.proto";
26-
import "grafeas/v1/vulnerability.proto";
26+
import "grafeas/v1/common.proto";
27+
import "grafeas/v1/grafeas.proto";
28+
import "grafeas/v1/severity.proto";
2729

2830
option csharp_namespace = "Google.Cloud.DevTools.ContainerAnalysis.V1";
2931
option go_package = "google.golang.org/genproto/googleapis/devtools/containeranalysis/v1;containeranalysis";
@@ -48,8 +50,7 @@ option php_namespace = "Google\\Cloud\\ContainerAnalysis\\V1";
4850
// image with the vulnerability referring to that note.
4951
service ContainerAnalysis {
5052
option (google.api.default_host) = "containeranalysis.googleapis.com";
51-
option (google.api.oauth_scopes) =
52-
"https://www.googleapis.com/auth/cloud-platform";
53+
option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
5354

5455
// Sets the access control policy on the specified note or occurrence.
5556
// Requires `containeranalysis.notes.setIamPolicy` or
@@ -59,8 +60,7 @@ service ContainerAnalysis {
5960
// The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for
6061
// notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for
6162
// occurrences.
62-
rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest)
63-
returns (google.iam.v1.Policy) {
63+
rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) {
6464
option (google.api.http) = {
6565
post: "/v1/{resource=projects/*/notes/*}:setIamPolicy"
6666
body: "*"
@@ -80,8 +80,7 @@ service ContainerAnalysis {
8080
// The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for
8181
// notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for
8282
// occurrences.
83-
rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest)
84-
returns (google.iam.v1.Policy) {
83+
rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) {
8584
option (google.api.http) = {
8685
post: "/v1/{resource=projects/*/notes/*}:getIamPolicy"
8786
body: "*"
@@ -100,8 +99,7 @@ service ContainerAnalysis {
10099
// The resource takes the format `projects/[PROJECT_ID]/notes/[NOTE_ID]` for
101100
// notes and `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]` for
102101
// occurrences.
103-
rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest)
104-
returns (google.iam.v1.TestIamPermissionsResponse) {
102+
rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) {
105103
option (google.api.http) = {
106104
post: "/v1/{resource=projects/*/notes/*}:testIamPermissions"
107105
body: "*"
@@ -114,9 +112,7 @@ service ContainerAnalysis {
114112
}
115113

116114
// Gets a summary of the number and severity of occurrences.
117-
rpc GetVulnerabilityOccurrencesSummary(
118-
GetVulnerabilityOccurrencesSummaryRequest)
119-
returns (VulnerabilityOccurrencesSummary) {
115+
rpc GetVulnerabilityOccurrencesSummary(GetVulnerabilityOccurrencesSummaryRequest) returns (VulnerabilityOccurrencesSummary) {
120116
option (google.api.http) = {
121117
get: "/v1/{parent=projects/*}/occurrences:vulnerabilitySummary"
122118
};
@@ -126,12 +122,13 @@ service ContainerAnalysis {
126122

127123
// Request to get a vulnerability summary for some set of occurrences.
128124
message GetVulnerabilityOccurrencesSummaryRequest {
129-
// The name of the project to get a vulnerability summary for in the form of
125+
// Required. The name of the project to get a vulnerability summary for in the form of
130126
// `projects/[PROJECT_ID]`.
131127
string parent = 1 [
132-
(google.api.resource_reference).type =
133-
"cloudresourcemanager.googleapis.com/Project",
134-
(google.api.field_behavior) = REQUIRED
128+
(google.api.field_behavior) = REQUIRED,
129+
(google.api.resource_reference) = {
130+
type: "cloudresourcemanager.googleapis.com/Project"
131+
}
135132
];
136133

137134
// The filter expression.

Diff for: protos/grafeas/v1/compliance.proto

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ syntax = "proto3";
1616

1717
package grafeas.v1;
1818

19-
import "grafeas/v1/vulnerability.proto";
19+
import "grafeas/v1/severity.proto";
2020

2121
option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas";
2222
option java_multiple_files = true;

Diff for: protos/grafeas/v1/cvss.proto

+75
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,78 @@ message CVSSv3 {
8383
IMPACT_NONE = 3;
8484
}
8585
}
86+
87+
// Common Vulnerability Scoring System.
88+
// For details, see https://www.first.org/cvss/specification-document
89+
// This is a message we will try to use for storing multiple versions of
90+
// CVSS. The intention is that as new versions of CVSS scores get added, we
91+
// will be able to modify this message rather than adding new protos for each
92+
// new version of the score.
93+
message CVSS {
94+
// The base score is a function of the base metric scores.
95+
float base_score = 1;
96+
97+
float exploitability_score = 2;
98+
99+
float impact_score = 3;
100+
101+
// Base Metrics
102+
// Represents the intrinsic characteristics of a vulnerability that are
103+
// constant over time and across user environments.
104+
AttackVector attack_vector = 4;
105+
AttackComplexity attack_complexity = 5;
106+
Authentication authentication = 6;
107+
PrivilegesRequired privileges_required = 7;
108+
UserInteraction user_interaction = 8;
109+
Scope scope = 9;
110+
Impact confidentiality_impact = 10;
111+
Impact integrity_impact = 11;
112+
Impact availability_impact = 12;
113+
114+
enum AttackVector {
115+
ATTACK_VECTOR_UNSPECIFIED = 0;
116+
ATTACK_VECTOR_NETWORK = 1;
117+
ATTACK_VECTOR_ADJACENT = 2;
118+
ATTACK_VECTOR_LOCAL = 3;
119+
ATTACK_VECTOR_PHYSICAL = 4;
120+
}
121+
122+
enum AttackComplexity {
123+
ATTACK_COMPLEXITY_UNSPECIFIED = 0;
124+
ATTACK_COMPLEXITY_LOW = 1;
125+
ATTACK_COMPLEXITY_HIGH = 2;
126+
}
127+
128+
enum Authentication {
129+
AUTHENTICATION_UNSPECIFIED = 0;
130+
AUTHENTICATION_MULTIPLE = 1;
131+
AUTHENTICATION_SINGLE = 2;
132+
AUTHENTICATION_NONE = 3;
133+
}
134+
135+
enum PrivilegesRequired {
136+
PRIVILEGES_REQUIRED_UNSPECIFIED = 0;
137+
PRIVILEGES_REQUIRED_NONE = 1;
138+
PRIVILEGES_REQUIRED_LOW = 2;
139+
PRIVILEGES_REQUIRED_HIGH = 3;
140+
}
141+
142+
enum UserInteraction {
143+
USER_INTERACTION_UNSPECIFIED = 0;
144+
USER_INTERACTION_NONE = 1;
145+
USER_INTERACTION_REQUIRED = 2;
146+
}
147+
148+
enum Scope {
149+
SCOPE_UNSPECIFIED = 0;
150+
SCOPE_UNCHANGED = 1;
151+
SCOPE_CHANGED = 2;
152+
}
153+
154+
enum Impact {
155+
IMPACT_UNSPECIFIED = 0;
156+
IMPACT_HIGH = 1;
157+
IMPACT_LOW = 2;
158+
IMPACT_NONE = 3;
159+
}
160+
}

Diff for: protos/grafeas/v1/discovery.proto

+5
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ syntax = "proto3";
1616

1717
package grafeas.v1;
1818

19+
import "google/api/field_behavior.proto";
1920
import "google/protobuf/timestamp.proto";
2021
import "google/rpc/status.proto";
2122
import "grafeas/v1/common.proto";
@@ -80,4 +81,8 @@ message DiscoveryOccurrence {
8081

8182
// The last time this resource was scanned.
8283
google.protobuf.Timestamp last_scan_time = 5;
84+
85+
// The time occurrences related to this discovery occurrence were archived.
86+
google.protobuf.Timestamp archive_time = 6
87+
[(google.api.field_behavior) = OUTPUT_ONLY];
8388
}

Diff for: protos/grafeas/v1/severity.proto

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// Copyright 2021 The Grafeas Authors. All rights reserved.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
syntax = "proto3";
16+
17+
package grafeas.v1;
18+
19+
option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas";
20+
option java_multiple_files = true;
21+
option java_package = "io.grafeas.v1";
22+
option objc_class_prefix = "GRA";
23+
24+
// Note provider assigned severity/impact ranking.
25+
enum Severity {
26+
// Unknown.
27+
SEVERITY_UNSPECIFIED = 0;
28+
// Minimal severity.
29+
MINIMAL = 1;
30+
// Low severity.
31+
LOW = 2;
32+
// Medium severity.
33+
MEDIUM = 3;
34+
// High severity.
35+
HIGH = 4;
36+
// Critical severity.
37+
CRITICAL = 5;
38+
}

Diff for: protos/grafeas/v1/vulnerability.proto

+7-30
Original file line numberDiff line numberDiff line change
@@ -21,36 +21,21 @@ import "google/protobuf/timestamp.proto";
2121
import "grafeas/v1/common.proto";
2222
import "grafeas/v1/cvss.proto";
2323
import "grafeas/v1/package.proto";
24+
import "grafeas/v1/severity.proto";
2425

2526
option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas";
2627
option java_multiple_files = true;
2728
option java_package = "io.grafeas.v1";
2829
option objc_class_prefix = "GRA";
2930

30-
// Note provider assigned severity/impact ranking.
31-
enum Severity {
32-
// Unknown.
33-
SEVERITY_UNSPECIFIED = 0;
34-
// Minimal severity.
35-
MINIMAL = 1;
36-
// Low severity.
37-
LOW = 2;
38-
// Medium severity.
39-
MEDIUM = 3;
40-
// High severity.
41-
HIGH = 4;
42-
// Critical severity.
43-
CRITICAL = 5;
44-
}
45-
4631
// A security vulnerability that can be found in resources.
4732
message VulnerabilityNote {
4833
// The CVSS score of this vulnerability. CVSS score is on a scale of 0 - 10
4934
// where 0 indicates low severity and 10 indicates high severity.
5035
float cvss_score = 1;
5136

5237
// The note provider assigned severity of this vulnerability.
53-
Severity severity = 2;
38+
grafeas.v1.Severity severity = 2;
5439

5540
// Details of all known distros and packages affected by this vulnerability.
5641
repeated Detail details = 3;
@@ -172,24 +157,15 @@ message VulnerabilityOccurrence {
172157
string type = 1;
173158

174159
// Output only. The note provider assigned severity of this vulnerability.
175-
Severity severity = 2;
160+
grafeas.v1.Severity severity = 2;
176161

177162
// Output only. The CVSS score of this vulnerability. CVSS score is on a
178163
// scale of 0 - 10 where 0 indicates low severity and 10 indicates high
179164
// severity.
180165
float cvss_score = 3;
181166

182-
// The CVSS v3 score for this vulnerability.
183-
message CVSSV3 {
184-
// The base score for for this vulnerability according to cvss v3.
185-
float base_score = 1;
186-
// The severity rating assigned to this vulnerability by vulnerability
187-
// provider.
188-
Severity severity = 2;
189-
}
190-
191167
// The cvss v3 score for the vulnerability.
192-
CVSSV3 cvssv3 = 10;
168+
CVSS cvssv3 = 10;
193169

194170
// Required. The set of affected locations and their fixes (if available)
195171
// within the associated resource.
@@ -231,7 +207,8 @@ message VulnerabilityOccurrence {
231207
// The distro or language system assigned severity for this vulnerability
232208
// when that is available and note provider assigned severity when it is not
233209
// available.
234-
Severity effective_severity = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
210+
grafeas.v1.Severity effective_severity = 9
211+
[(google.api.field_behavior) = OUTPUT_ONLY];
235212
}
236213

237214
// Output only. A one sentence description of this vulnerability.
@@ -253,7 +230,7 @@ message VulnerabilityOccurrence {
253230
// PackageIssue level. In the case where multiple PackageIssues have differing
254231
// effective severities, this field should be the highest severity for any of
255232
// the PackageIssues.
256-
Severity effective_severity = 8;
233+
grafeas.v1.Severity effective_severity = 8;
257234

258235
// Output only. Whether at least one of the affected packages has a fix
259236
// available.

0 commit comments

Comments
 (0)