server_tls_policy.proto 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. // Copyright 2021 Google LLC
  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. syntax = "proto3";
  15. package google.cloud.networksecurity.v1beta1;
  16. import "google/api/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/cloud/networksecurity/v1beta1/tls.proto";
  19. import "google/protobuf/field_mask.proto";
  20. import "google/protobuf/timestamp.proto";
  21. option csharp_namespace = "Google.Cloud.NetworkSecurity.V1Beta1";
  22. option go_package = "google.golang.org/genproto/googleapis/cloud/networksecurity/v1beta1;networksecurity";
  23. option java_multiple_files = true;
  24. option java_outer_classname = "ServerTlsPolicyProto";
  25. option java_package = "com.google.cloud.networksecurity.v1beta1";
  26. option php_namespace = "Google\\Cloud\\NetworkSecurity\\V1beta1";
  27. option ruby_package = "Google::Cloud::NetworkSecurity::V1beta1";
  28. // ServerTlsPolicy is a resource that specifies how a server should authenticate
  29. // incoming requests. This resource itself does not affect configuration unless
  30. // it is attached to a target https proxy or endpoint config selector resource.
  31. message ServerTlsPolicy {
  32. option (google.api.resource) = {
  33. type: "networksecurity.googleapis.com/ServerTlsPolicy"
  34. pattern: "projects/{project}/locations/{location}/serverTlsPolicies/{server_tls_policy}"
  35. };
  36. // Specification of the MTLSPolicy.
  37. message MTLSPolicy {
  38. //
  39. // Defines the mechanism to obtain the Certificate Authority certificate to
  40. // validate the client certificate.
  41. repeated ValidationCA client_validation_ca = 1;
  42. }
  43. // Required. Name of the ServerTlsPolicy resource. It matches the pattern
  44. // `projects/*/locations/{location}/serverTlsPolicies/{server_tls_policy}`
  45. string name = 1 [(google.api.field_behavior) = REQUIRED];
  46. // Free-text description of the resource.
  47. string description = 2;
  48. // Output only. The timestamp when the resource was created.
  49. google.protobuf.Timestamp create_time = 3
  50. [(google.api.field_behavior) = OUTPUT_ONLY];
  51. // Output only. The timestamp when the resource was updated.
  52. google.protobuf.Timestamp update_time = 4
  53. [(google.api.field_behavior) = OUTPUT_ONLY];
  54. // Set of label tags associated with the resource.
  55. map<string, string> labels = 5;
  56. //
  57. // Determines if server allows plaintext connections. If set to true, server
  58. // allows plain text connections. By default, it is set to false. This setting
  59. // is not exclusive of other encryption modes. For example, if `allow_open`
  60. // and `mtls_policy` are set, server allows both plain text and mTLS
  61. // connections. See documentation of other encryption modes to confirm
  62. // compatibility.
  63. //
  64. // Consider using it if you wish to upgrade in place your deployment to TLS
  65. // while having mixed TLS and non-TLS traffic reaching port :80.
  66. bool allow_open = 6;
  67. //
  68. // Defines a mechanism to provision server identity (public and private keys).
  69. // Cannot be combined with `allow_open` as a permissive mode that allows both
  70. // plain text and TLS is not supported.
  71. CertificateProvider server_certificate = 7;
  72. //
  73. // Defines a mechanism to provision peer validation certificates for peer to
  74. // peer authentication (Mutual TLS - mTLS). If not specified, client
  75. // certificate will not be requested. The connection is treated as TLS and not
  76. // mTLS. If `allow_open` and `mtls_policy` are set, server allows both plain
  77. // text and mTLS connections.
  78. MTLSPolicy mtls_policy = 8;
  79. }
  80. // Request used by the ListServerTlsPolicies method.
  81. message ListServerTlsPoliciesRequest {
  82. // Required. The project and location from which the ServerTlsPolicies should
  83. // be listed, specified in the format `projects/*/locations/{location}`.
  84. string parent = 1 [
  85. (google.api.field_behavior) = REQUIRED,
  86. (google.api.resource_reference) = {
  87. type: "locations.googleapis.com/Location"
  88. }
  89. ];
  90. // Maximum number of ServerTlsPolicies to return per call.
  91. int32 page_size = 2;
  92. // The value returned by the last `ListServerTlsPoliciesResponse`
  93. // Indicates that this is a continuation of a prior
  94. // `ListServerTlsPolicies` call, and that the system
  95. // should return the next page of data.
  96. string page_token = 3;
  97. }
  98. // Response returned by the ListServerTlsPolicies method.
  99. message ListServerTlsPoliciesResponse {
  100. // List of ServerTlsPolicy resources.
  101. repeated ServerTlsPolicy server_tls_policies = 1;
  102. // If there might be more results than those appearing in this response, then
  103. // `next_page_token` is included. To get the next set of results, call this
  104. // method again using the value of `next_page_token` as `page_token`.
  105. string next_page_token = 2;
  106. }
  107. // Request used by the GetServerTlsPolicy method.
  108. message GetServerTlsPolicyRequest {
  109. // Required. A name of the ServerTlsPolicy to get. Must be in the format
  110. // `projects/*/locations/{location}/serverTlsPolicies/*`.
  111. string name = 1 [
  112. (google.api.field_behavior) = REQUIRED,
  113. (google.api.resource_reference) = {
  114. type: "networksecurity.googleapis.com/ServerTlsPolicy"
  115. }
  116. ];
  117. }
  118. // Request used by the CreateServerTlsPolicy method.
  119. message CreateServerTlsPolicyRequest {
  120. // Required. The parent resource of the ServerTlsPolicy. Must be in
  121. // the format `projects/*/locations/{location}`.
  122. string parent = 1 [
  123. (google.api.field_behavior) = REQUIRED,
  124. (google.api.resource_reference) = {
  125. child_type: "networksecurity.googleapis.com/ServerTlsPolicy"
  126. }
  127. ];
  128. // Required. Short name of the ServerTlsPolicy resource to be created. This
  129. // value should be 1-63 characters long, containing only letters, numbers,
  130. // hyphens, and underscores, and should not start with a number. E.g.
  131. // "server_mtls_policy".
  132. string server_tls_policy_id = 2 [(google.api.field_behavior) = REQUIRED];
  133. // Required. ServerTlsPolicy resource to be created.
  134. ServerTlsPolicy server_tls_policy = 3
  135. [(google.api.field_behavior) = REQUIRED];
  136. }
  137. // Request used by UpdateServerTlsPolicy method.
  138. message UpdateServerTlsPolicyRequest {
  139. // Optional. Field mask is used to specify the fields to be overwritten in the
  140. // ServerTlsPolicy resource by the update. The fields
  141. // specified in the update_mask are relative to the resource, not
  142. // the full request. A field will be overwritten if it is in the
  143. // mask. If the user does not provide a mask then all fields will be
  144. // overwritten.
  145. google.protobuf.FieldMask update_mask = 1
  146. [(google.api.field_behavior) = OPTIONAL];
  147. // Required. Updated ServerTlsPolicy resource.
  148. ServerTlsPolicy server_tls_policy = 2
  149. [(google.api.field_behavior) = REQUIRED];
  150. }
  151. // Request used by the DeleteServerTlsPolicy method.
  152. message DeleteServerTlsPolicyRequest {
  153. // Required. A name of the ServerTlsPolicy to delete. Must be in
  154. // the format `projects/*/locations/{location}/serverTlsPolicies/*`.
  155. string name = 1 [
  156. (google.api.field_behavior) = REQUIRED,
  157. (google.api.resource_reference) = {
  158. type: "networksecurity.googleapis.com/ServerTlsPolicy"
  159. }
  160. ];
  161. }