common.proto 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. // Copyright 2022 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.connectors.v1;
  16. import "google/api/field_behavior.proto";
  17. import "google/protobuf/timestamp.proto";
  18. option go_package = "google.golang.org/genproto/googleapis/cloud/connectors/v1;connectors";
  19. option java_multiple_files = true;
  20. option java_outer_classname = "CommonProto";
  21. option java_package = "com.google.cloud.connectors.v1";
  22. // Represents the metadata of the long-running operation.
  23. message OperationMetadata {
  24. // Output only. The time the operation was created.
  25. google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  26. // Output only. The time the operation finished running.
  27. google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  28. // Output only. Server-defined resource path for the target of the operation.
  29. string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  30. // Output only. Name of the verb executed by the operation.
  31. string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  32. // Output only. Human-readable status of the operation, if any.
  33. string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  34. // Output only. Identifies whether the user has requested cancellation
  35. // of the operation. Operations that have successfully been cancelled
  36. // have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
  37. // corresponding to `Code.CANCELLED`.
  38. bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  39. // Output only. API version used to start the operation.
  40. string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  41. }
  42. // ConfigVariableTemplate provides metadata about a `ConfigVariable` that is
  43. // used in a Connection.
  44. message ConfigVariableTemplate {
  45. // ValueType indicates the data type of the value.
  46. enum ValueType {
  47. // Value type is not specified.
  48. VALUE_TYPE_UNSPECIFIED = 0;
  49. // Value type is string.
  50. STRING = 1;
  51. // Value type is integer.
  52. INT = 2;
  53. // Value type is boolean.
  54. BOOL = 3;
  55. // Value type is secret.
  56. SECRET = 4;
  57. // Value type is enum.
  58. ENUM = 5;
  59. // Value type is authorization code.
  60. AUTHORIZATION_CODE = 6;
  61. }
  62. // Indicates the state of the config variable.
  63. enum State {
  64. // Status is unspecified.
  65. STATE_UNSPECIFIED = 0;
  66. // Config variable is active
  67. ACTIVE = 1;
  68. // Config variable is deprecated.
  69. DEPRECATED = 2;
  70. }
  71. // Key of the config variable.
  72. string key = 1;
  73. // Type of the parameter: string, int, bool etc.
  74. // consider custom type for the benefit for the validation.
  75. ValueType value_type = 2;
  76. // Display name of the parameter.
  77. string display_name = 3;
  78. // Description.
  79. string description = 4;
  80. // Regular expression in RE2 syntax used for validating the `value` of a
  81. // `ConfigVariable`.
  82. string validation_regex = 5;
  83. // Flag represents that this `ConfigVariable` must be provided for a
  84. // connection.
  85. bool required = 6;
  86. // Role grant configuration for the config variable.
  87. RoleGrant role_grant = 7;
  88. // Enum options. To be populated if `ValueType` is `ENUM`
  89. repeated EnumOption enum_options = 8;
  90. // Authorization code link options. To be populated if `ValueType` is
  91. // `AUTHORIZATION_CODE`
  92. AuthorizationCodeLink authorization_code_link = 9;
  93. // State of the config variable.
  94. State state = 10;
  95. }
  96. // Secret provides a reference to entries in Secret Manager.
  97. message Secret {
  98. // The resource name of the secret version in the format,
  99. // format as: `projects/*/secrets/*/versions/*`.
  100. string secret_version = 1;
  101. }
  102. // EnumOption definition
  103. message EnumOption {
  104. // Id of the option.
  105. string id = 1;
  106. // Display name of the option.
  107. string display_name = 2;
  108. }
  109. // ConfigVariable represents a configuration variable present in a Connection.
  110. // or AuthConfig.
  111. message ConfigVariable {
  112. // Key of the config variable.
  113. string key = 1;
  114. // Value type of the config variable.
  115. oneof value {
  116. // Value is an integer
  117. int64 int_value = 2;
  118. // Value is a bool.
  119. bool bool_value = 3;
  120. // Value is a string.
  121. string string_value = 4;
  122. // Value is a secret.
  123. Secret secret_value = 5;
  124. }
  125. }
  126. // This configuration defines all the Cloud IAM roles that needs to be granted
  127. // to a particular GCP resource for the selected prinicpal like service
  128. // account. These configurations will let UI display to customers what
  129. // IAM roles need to be granted by them. Or these configurations can be used
  130. // by the UI to render a 'grant' button to do the same on behalf of the user.
  131. message RoleGrant {
  132. // Supported Principal values.
  133. enum Principal {
  134. // Value type is not specified.
  135. PRINCIPAL_UNSPECIFIED = 0;
  136. // Service Account used for Connector workload identity
  137. // This is either the default service account if unspecified or Service
  138. // Account provided by Customers through BYOSA.
  139. CONNECTOR_SA = 1;
  140. }
  141. // Resource definition
  142. message Resource {
  143. // Resource Type definition.
  144. enum Type {
  145. // Value type is not specified.
  146. TYPE_UNSPECIFIED = 0;
  147. // GCP Project Resource.
  148. GCP_PROJECT = 1;
  149. // Any GCP Resource which is identified uniquely by IAM.
  150. GCP_RESOURCE = 2;
  151. // GCP Secret Resource.
  152. GCP_SECRETMANAGER_SECRET = 3;
  153. // GCP Secret Version Resource.
  154. GCP_SECRETMANAGER_SECRET_VERSION = 4;
  155. }
  156. // Different types of resource supported.
  157. Type type = 1;
  158. // Template to uniquely represent a GCP resource in a format IAM expects
  159. // This is a template that can have references to other values provided in
  160. // the config variable template.
  161. string path_template = 3;
  162. }
  163. // Prinicipal/Identity for whom the role need to assigned.
  164. Principal principal = 1;
  165. // List of roles that need to be granted.
  166. repeated string roles = 2;
  167. // Resource on which the roles needs to be granted for the principal.
  168. Resource resource = 3;
  169. // Template that UI can use to provide helper text to customers.
  170. string helper_text_template = 4;
  171. }
  172. // This configuration captures the details required to render an authorization
  173. // link for the OAuth Authorization Code Flow.
  174. message AuthorizationCodeLink {
  175. // The base URI the user must click to trigger the authorization code login
  176. // flow.
  177. string uri = 1;
  178. // The scopes for which the user will authorize GCP Connectors on the
  179. // connector data source.
  180. repeated string scopes = 2;
  181. // The client ID assigned to the GCP Connectors OAuth app for the connector
  182. // data source.
  183. string client_id = 3;
  184. // Whether to enable PKCE for the auth code flow.
  185. bool enable_pkce = 4;
  186. }
  187. // LaunchStage is a enum to indicate launch stage:
  188. // PREVIEW, GA, DEPRECATED.
  189. enum LaunchStage {
  190. // LAUNCH_STAGE_UNSPECIFIED.
  191. LAUNCH_STAGE_UNSPECIFIED = 0;
  192. // PREVIEW.
  193. PREVIEW = 1;
  194. // GA.
  195. GA = 2;
  196. // DEPRECATED.
  197. DEPRECATED = 3;
  198. }