Skip to content

Commit 9213efa

Browse files
Google APIscopybara-github
Google APIs
authored andcommitted
docs: update the comments of various networksecurity resources
fix!: fix annotation of parent in Create*Request PiperOrigin-RevId: 462271672
1 parent fb78f5b commit 9213efa

File tree

7 files changed

+148
-87
lines changed

7 files changed

+148
-87
lines changed

google/cloud/networksecurity/v1beta1/BUILD.bazel

+36-3
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ proto_library_with_info(
4444
deps = [
4545
":networksecurity_proto",
4646
"//google/cloud:common_resources_proto",
47+
"//google/cloud/location:location_proto",
48+
"//google/iam/v1:iam_policy_proto",
4749
],
4850
)
4951

@@ -73,18 +75,27 @@ java_grpc_library(
7375
java_gapic_library(
7476
name = "networksecurity_java_gapic",
7577
srcs = [":networksecurity_proto_with_info"],
78+
gapic_yaml = None,
7679
grpc_service_config = "networksecurity_v1beta1_grpc_service_config.json",
80+
service_yaml = "networksecurity_v1beta1.yaml",
7781
test_deps = [
7882
":networksecurity_java_grpc",
83+
"//google/cloud/location:location_java_grpc",
84+
"//google/iam/v1:iam_java_grpc",
7985
],
86+
transport = "grpc+rest",
8087
deps = [
8188
":networksecurity_java_proto",
89+
"//google/api:api_java_proto",
90+
"//google/cloud/location:location_java_proto",
91+
"//google/iam/v1:iam_java_proto",
8292
],
8393
)
8494

8595
java_gapic_test(
8696
name = "networksecurity_java_gapic_test_suite",
8797
test_classes = [
98+
"com.google.cloud.networksecurity.v1beta1.NetworkSecurityClientHttpJsonTest",
8899
"com.google.cloud.networksecurity.v1beta1.NetworkSecurityClientTest",
89100
],
90101
runtime_deps = [":networksecurity_java_gapic_test"],
@@ -94,6 +105,7 @@ java_gapic_test(
94105
java_gapic_assembly_gradle_pkg(
95106
name = "google-cloud-networksecurity-v1beta1-java",
96107
include_samples = True,
108+
transport = "grpc+rest",
97109
deps = [
98110
":networksecurity_java_gapic",
99111
":networksecurity_java_grpc",
@@ -131,8 +143,11 @@ go_gapic_library(
131143
importpath = "cloud.google.com/go/networksecurity/apiv1beta1;networksecurity",
132144
metadata = True,
133145
service_yaml = "networksecurity_v1beta1.yaml",
146+
transport = "grpc+rest",
134147
deps = [
135148
":networksecurity_go_proto",
149+
"//google/cloud/location:location_go_proto",
150+
"//google/iam/v1:iam_go_proto",
136151
"//google/longrunning:longrunning_go_proto",
137152
"@com_google_cloud_go//longrunning:go_default_library",
138153
"@com_google_cloud_go//longrunning/autogen:go_default_library",
@@ -171,10 +186,11 @@ py_gapic_library(
171186
srcs = [":networksecurity_proto"],
172187
grpc_service_config = "networksecurity_v1beta1_grpc_service_config.json",
173188
opt_args = [
174-
"warehouse-package-name=google-cloud-network-security",
175-
"python-gapic-namespace=google.cloud",
176189
"python-gapic-name=network-security",
190+
"python-gapic-namespace=google.cloud",
191+
"warehouse-package-name=google-cloud-network-security",
177192
],
193+
service_yaml = "networksecurity_v1beta1.yaml",
178194
)
179195

180196
# Open Source Packages
@@ -290,6 +306,7 @@ ruby_cloud_gapic_library(
290306
grpc_service_config = "networksecurity_v1beta1_grpc_service_config.json",
291307
ruby_cloud_description = "The client library for the Google Network Security V1beta1 API.",
292308
ruby_cloud_title = "Network Security V1beta1",
309+
service_yaml = "networksecurity_v1beta1.yaml",
293310
deps = [
294311
":networksecurity_ruby_grpc",
295312
":networksecurity_ruby_proto",
@@ -353,4 +370,20 @@ csharp_gapic_assembly_pkg(
353370
##############################################################################
354371
# C++
355372
##############################################################################
356-
# Put your C++ rules here
373+
load(
374+
"@com_google_googleapis_imports//:imports.bzl",
375+
"cc_grpc_library",
376+
"cc_proto_library",
377+
)
378+
379+
cc_proto_library(
380+
name = "networksecurity_cc_proto",
381+
deps = [":networksecurity_proto"],
382+
)
383+
384+
cc_grpc_library(
385+
name = "networksecurity_cc_grpc",
386+
srcs = [":networksecurity_proto"],
387+
grpc_only = True,
388+
deps = [":networksecurity_cc_proto"],
389+
)

google/cloud/networksecurity/v1beta1/authorization_policy.proto

+53-44
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import "google/api/field_behavior.proto";
2020
import "google/api/resource.proto";
2121
import "google/protobuf/field_mask.proto";
2222
import "google/protobuf/timestamp.proto";
23-
import "google/api/annotations.proto";
2423

2524
option csharp_namespace = "Google.Cloud.NetworkSecurity.V1Beta1";
2625
option go_package = "google.golang.org/genproto/googleapis/cloud/networksecurity/v1beta1;networksecurity";
@@ -44,25 +43,25 @@ message AuthorizationPolicy {
4443
message Rule {
4544
// Specification of traffic source attributes.
4645
message Source {
47-
// Optional. List of peer identities to match for authorization. At least one
48-
// principal should match. Each peer can be an exact match, or a prefix
49-
// match (example, "namespace/*") or a suffix match (example, //
50-
// */service-account") or a presence match "*". Authorization based on the
51-
// principal name without certificate validation (configured by
46+
// Optional. List of peer identities to match for authorization. At least
47+
// one principal should match. Each peer can be an exact match, or a
48+
// prefix match (example, "namespace/*") or a suffix match (example,
49+
// "*/service-account") or a presence match "*". Authorization based on
50+
// the principal name without certificate validation (configured by
5251
// ServerTlsPolicy resource) is considered insecure.
5352
repeated string principals = 1 [(google.api.field_behavior) = OPTIONAL];
5453

55-
// Optional. List of CIDR ranges to match based on source IP address. At least one
56-
// IP block should match. Single IP (e.g., "1.2.3.4") and CIDR (e.g.,
57-
// "1.2.3.0/24") are supported. Authorization based on source IP alone
58-
// should be avoided. The IP addresses of any load balancers or proxies
59-
// should be considered untrusted.
54+
// Optional. List of CIDR ranges to match based on source IP address. At
55+
// least one IP block should match. Single IP (e.g., "1.2.3.4") and CIDR
56+
// (e.g., "1.2.3.0/24") are supported. Authorization based on source IP
57+
// alone should be avoided. The IP addresses of any load balancers or
58+
// proxies should be considered untrusted.
6059
repeated string ip_blocks = 2 [(google.api.field_behavior) = OPTIONAL];
6160
}
6261

6362
// Specification of traffic destination attributes.
6463
message Destination {
65-
// Specification of HTTP header match atrributes.
64+
// Specification of HTTP header match attributes.
6665
message HttpHeaderMatch {
6766
oneof type {
6867
// Required. The value of the header must match the regular expression
@@ -82,39 +81,42 @@ message AuthorizationPolicy {
8281
string header_name = 1 [(google.api.field_behavior) = REQUIRED];
8382
}
8483

85-
// Required. List of host names to match. Matched against the ":authority" header in
86-
// http requests. At least one host should match. Each host can be an
87-
// exact match, or a prefix match (example "mydomain.*") or a suffix
88-
// match (example // *.myorg.com") or a presence(any) match "*".
84+
// Required. List of host names to match. Matched against the ":authority"
85+
// header in http requests. At least one host should match. Each host can
86+
// be an exact match, or a prefix match (example "mydomain.*") or a suffix
87+
// match (example "*.myorg.com") or a presence (any) match "*".
8988
repeated string hosts = 1 [(google.api.field_behavior) = REQUIRED];
9089

91-
// Required. List of destination ports to match. At least one port should match.
90+
// Required. List of destination ports to match. At least one port should
91+
// match.
9292
repeated uint32 ports = 2 [(google.api.field_behavior) = REQUIRED];
9393

9494
// Optional. A list of HTTP methods to match. At least one method should
9595
// match. Should not be set for gRPC services.
9696
repeated string methods = 4 [(google.api.field_behavior) = OPTIONAL];
9797

98-
// Optional. Match against key:value pair in http header. Provides a flexible match
99-
// based on HTTP headers, for potentially advanced use cases. At least one
100-
// header should match. Avoid using header matches to make authorization
101-
// decisions unless there is a strong guarantee that requests arrive
102-
// through a trusted client or proxy.
103-
HttpHeaderMatch http_header_match = 5 [(google.api.field_behavior) = OPTIONAL];
98+
// Optional. Match against key:value pair in http header. Provides a
99+
// flexible match based on HTTP headers, for potentially advanced use
100+
// cases. At least one header should match. Avoid using header matches to
101+
// make authorization decisions unless there is a strong guarantee that
102+
// requests arrive through a trusted client or proxy.
103+
HttpHeaderMatch http_header_match = 5
104+
[(google.api.field_behavior) = OPTIONAL];
104105
}
105106

106-
// Optional. List of attributes for the traffic source. All of the sources must match.
107-
// A source is a match if both principals and ip_blocks match. If not set,
108-
// the action specified in the 'action' field will be applied without any
109-
// rule checks for the source.
107+
// Optional. List of attributes for the traffic source. All of the sources
108+
// must match. A source is a match if both principals and ip_blocks match.
109+
// If not set, the action specified in the 'action' field will be applied
110+
// without any rule checks for the source.
110111
repeated Source sources = 1 [(google.api.field_behavior) = OPTIONAL];
111112

112-
// Optional. List of attributes for the traffic destination. All of the destinations
113-
// must match. A destination is a match if a request matches all the
114-
// specified hosts, ports, methods and headers. If not set, the
113+
// Optional. List of attributes for the traffic destination. All of the
114+
// destinations must match. A destination is a match if a request matches
115+
// all the specified hosts, ports, methods and headers. If not set, the
115116
// action specified in the 'action' field will be applied without any rule
116117
// checks for the destination.
117-
repeated Destination destinations = 2 [(google.api.field_behavior) = OPTIONAL];
118+
repeated Destination destinations = 2
119+
[(google.api.field_behavior) = OPTIONAL];
118120
}
119121

120122
// Possible values that define what action to take.
@@ -139,22 +141,26 @@ message AuthorizationPolicy {
139141
string description = 2 [(google.api.field_behavior) = OPTIONAL];
140142

141143
// Output only. The timestamp when the resource was created.
142-
google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
144+
google.protobuf.Timestamp create_time = 3
145+
[(google.api.field_behavior) = OUTPUT_ONLY];
143146

144147
// Output only. The timestamp when the resource was updated.
145-
google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
148+
google.protobuf.Timestamp update_time = 4
149+
[(google.api.field_behavior) = OUTPUT_ONLY];
146150

147-
// Optional. Set of label tags associated with the AuthorizationPolicy resource.
151+
// Optional. Set of label tags associated with the AuthorizationPolicy
152+
// resource.
148153
map<string, string> labels = 5 [(google.api.field_behavior) = OPTIONAL];
149154

150155
// Required. The action to take when a rule match is found. Possible values
151156
// are "ALLOW" or "DENY".
152157
Action action = 6 [(google.api.field_behavior) = REQUIRED];
153158

154-
// Optional. List of rules to match. Note that at least one of the rules must match in
155-
// order for the action specified in the 'action' field to be taken. A rule is
156-
// a match if there is a matching source and destination. If left blank, the
157-
// action specified in the `action` field will be applied on every request.
159+
// Optional. List of rules to match. Note that at least one of the rules must
160+
// match in order for the action specified in the 'action' field to be taken.
161+
// A rule is a match if there is a matching source and destination. If left
162+
// blank, the action specified in the `action` field will be applied on every
163+
// request.
158164
repeated Rule rules = 7 [(google.api.field_behavior) = OPTIONAL];
159165
}
160166

@@ -210,7 +216,7 @@ message CreateAuthorizationPolicyRequest {
210216
string parent = 1 [
211217
(google.api.field_behavior) = REQUIRED,
212218
(google.api.resource_reference) = {
213-
type: "networksecurity.googleapis.com/AuthorizationPolicy"
219+
child_type: "networksecurity.googleapis.com/AuthorizationPolicy"
214220
}
215221
];
216222

@@ -221,7 +227,8 @@ message CreateAuthorizationPolicyRequest {
221227
string authorization_policy_id = 2 [(google.api.field_behavior) = REQUIRED];
222228

223229
// Required. AuthorizationPolicy resource to be created.
224-
AuthorizationPolicy authorization_policy = 3 [(google.api.field_behavior) = REQUIRED];
230+
AuthorizationPolicy authorization_policy = 3
231+
[(google.api.field_behavior) = REQUIRED];
225232
}
226233

227234
// Request used by the UpdateAuthorizationPolicy method.
@@ -231,16 +238,18 @@ message UpdateAuthorizationPolicyRequest {
231238
// The fields specified in the update_mask are relative to the resource, not
232239
// the full request. A field will be overwritten if it is in the mask. If the
233240
// user does not provide a mask then all fields will be overwritten.
234-
google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = OPTIONAL];
241+
google.protobuf.FieldMask update_mask = 1
242+
[(google.api.field_behavior) = OPTIONAL];
235243

236244
// Required. Updated AuthorizationPolicy resource.
237-
AuthorizationPolicy authorization_policy = 2 [(google.api.field_behavior) = REQUIRED];
245+
AuthorizationPolicy authorization_policy = 2
246+
[(google.api.field_behavior) = REQUIRED];
238247
}
239248

240249
// Request used by the DeleteAuthorizationPolicy method.
241250
message DeleteAuthorizationPolicyRequest {
242-
// Required. A name of the AuthorizationPolicy to delete. Must be in the format
243-
// `projects/{project}/locations/{location}/authorizationPolicies/*`.
251+
// Required. A name of the AuthorizationPolicy to delete. Must be in the
252+
// format `projects/{project}/locations/{location}/authorizationPolicies/*`.
244253
string name = 1 [
245254
(google.api.field_behavior) = REQUIRED,
246255
(google.api.resource_reference) = {

google/cloud/networksecurity/v1beta1/client_tls_policy.proto

+26-18
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import "google/api/resource.proto";
2121
import "google/cloud/networksecurity/v1beta1/tls.proto";
2222
import "google/protobuf/field_mask.proto";
2323
import "google/protobuf/timestamp.proto";
24-
import "google/api/annotations.proto";
2524

2625
option csharp_namespace = "Google.Cloud.NetworkSecurity.V1Beta1";
2726
option go_package = "google.golang.org/genproto/googleapis/cloud/networksecurity/v1beta1;networksecurity";
@@ -48,10 +47,12 @@ message ClientTlsPolicy {
4847
string description = 2 [(google.api.field_behavior) = OPTIONAL];
4948

5049
// Output only. The timestamp when the resource was created.
51-
google.protobuf.Timestamp create_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
50+
google.protobuf.Timestamp create_time = 3
51+
[(google.api.field_behavior) = OUTPUT_ONLY];
5252

5353
// Output only. The timestamp when the resource was updated.
54-
google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
54+
google.protobuf.Timestamp update_time = 4
55+
[(google.api.field_behavior) = OUTPUT_ONLY];
5556

5657
// Optional. Set of label tags associated with the resource.
5758
map<string, string> labels = 5 [(google.api.field_behavior) = OPTIONAL];
@@ -60,14 +61,17 @@ message ClientTlsPolicy {
6061
// handshake. E.g: "secure.example.com".
6162
string sni = 6 [(google.api.field_behavior) = OPTIONAL];
6263

63-
// Optional. Defines a mechanism to provision client identity (public and private keys)
64-
// for peer to peer authentication. The presence of this dictates mTLS.
65-
CertificateProvider client_certificate = 7 [(google.api.field_behavior) = OPTIONAL];
66-
67-
// Optional. Defines the mechanism to obtain the Certificate Authority certificate to
68-
// validate the server certificate. If empty, client does not validate the
69-
// server certificate.
70-
repeated ValidationCA server_validation_ca = 8 [(google.api.field_behavior) = OPTIONAL];
64+
// Optional. Defines a mechanism to provision client identity (public and
65+
// private keys) for peer to peer authentication. The presence of this
66+
// dictates mTLS.
67+
CertificateProvider client_certificate = 7
68+
[(google.api.field_behavior) = OPTIONAL];
69+
70+
// Optional. Defines the mechanism to obtain the Certificate Authority
71+
// certificate to validate the server certificate. If empty, client does not
72+
// validate the server certificate.
73+
repeated ValidationCA server_validation_ca = 8
74+
[(google.api.field_behavior) = OPTIONAL];
7175
}
7276

7377
// Request used by the ListClientTlsPolicies method.
@@ -121,17 +125,19 @@ message CreateClientTlsPolicyRequest {
121125
string parent = 1 [
122126
(google.api.field_behavior) = REQUIRED,
123127
(google.api.resource_reference) = {
124-
type: "networksecurity.googleapis.com/ClientTlsPolicy"
128+
child_type: "networksecurity.googleapis.com/ClientTlsPolicy"
125129
}
126130
];
127131

128-
// Required. Short name of the ClientTlsPolicy resource to be created. This value should
129-
// be 1-63 characters long, containing only letters, numbers, hyphens, and
130-
// underscores, and should not start with a number. E.g. "client_mtls_policy".
132+
// Required. Short name of the ClientTlsPolicy resource to be created. This
133+
// value should be 1-63 characters long, containing only letters, numbers,
134+
// hyphens, and underscores, and should not start with a number. E.g.
135+
// "client_mtls_policy".
131136
string client_tls_policy_id = 2 [(google.api.field_behavior) = REQUIRED];
132137

133138
// Required. ClientTlsPolicy resource to be created.
134-
ClientTlsPolicy client_tls_policy = 3 [(google.api.field_behavior) = REQUIRED];
139+
ClientTlsPolicy client_tls_policy = 3
140+
[(google.api.field_behavior) = REQUIRED];
135141
}
136142

137143
// Request used by UpdateClientTlsPolicy method.
@@ -142,10 +148,12 @@ message UpdateClientTlsPolicyRequest {
142148
// the full request. A field will be overwritten if it is in the
143149
// mask. If the user does not provide a mask then all fields will be
144150
// overwritten.
145-
google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = OPTIONAL];
151+
google.protobuf.FieldMask update_mask = 1
152+
[(google.api.field_behavior) = OPTIONAL];
146153

147154
// Required. Updated ClientTlsPolicy resource.
148-
ClientTlsPolicy client_tls_policy = 2 [(google.api.field_behavior) = REQUIRED];
155+
ClientTlsPolicy client_tls_policy = 2
156+
[(google.api.field_behavior) = REQUIRED];
149157
}
150158

151159
// Request used by the DeleteClientTlsPolicy method.

0 commit comments

Comments
 (0)