common.proto 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. // Copyright 2020 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.iam.credentials.v1;
  16. import "google/api/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/protobuf/duration.proto";
  19. import "google/protobuf/timestamp.proto";
  20. option cc_enable_arenas = true;
  21. option csharp_namespace = "Google.Cloud.Iam.Credentials.V1";
  22. option go_package = "google.golang.org/genproto/googleapis/iam/credentials/v1;credentials";
  23. option java_multiple_files = true;
  24. option java_outer_classname = "IAMCredentialsCommonProto";
  25. option java_package = "com.google.cloud.iam.credentials.v1";
  26. option (google.api.resource_definition) = {
  27. type: "iam.googleapis.com/ServiceAccount"
  28. pattern: "projects/{project}/serviceAccounts/{service_account}"
  29. };
  30. message GenerateAccessTokenRequest {
  31. // Required. The resource name of the service account for which the credentials
  32. // are requested, in the following format:
  33. // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard
  34. // character is required; replacing it with a project ID is invalid.
  35. string name = 1 [
  36. (google.api.field_behavior) = REQUIRED,
  37. (google.api.resource_reference) = {
  38. type: "iam.googleapis.com/ServiceAccount"
  39. }
  40. ];
  41. // The sequence of service accounts in a delegation chain. Each service
  42. // account must be granted the `roles/iam.serviceAccountTokenCreator` role
  43. // on its next service account in the chain. The last service account in the
  44. // chain must be granted the `roles/iam.serviceAccountTokenCreator` role
  45. // on the service account that is specified in the `name` field of the
  46. // request.
  47. //
  48. // The delegates must have the following format:
  49. // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard
  50. // character is required; replacing it with a project ID is invalid.
  51. repeated string delegates = 2;
  52. // Required. Code to identify the scopes to be included in the OAuth 2.0 access token.
  53. // See https://developers.google.com/identity/protocols/googlescopes for more
  54. // information.
  55. // At least one value required.
  56. repeated string scope = 4 [(google.api.field_behavior) = REQUIRED];
  57. // The desired lifetime duration of the access token in seconds.
  58. // Must be set to a value less than or equal to 3600 (1 hour). If a value is
  59. // not specified, the token's lifetime will be set to a default value of one
  60. // hour.
  61. google.protobuf.Duration lifetime = 7;
  62. }
  63. message GenerateAccessTokenResponse {
  64. // The OAuth 2.0 access token.
  65. string access_token = 1;
  66. // Token expiration time.
  67. // The expiration time is always set.
  68. google.protobuf.Timestamp expire_time = 3;
  69. }
  70. message SignBlobRequest {
  71. // Required. The resource name of the service account for which the credentials
  72. // are requested, in the following format:
  73. // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard
  74. // character is required; replacing it with a project ID is invalid.
  75. string name = 1 [
  76. (google.api.field_behavior) = REQUIRED,
  77. (google.api.resource_reference) = {
  78. type: "iam.googleapis.com/ServiceAccount"
  79. }
  80. ];
  81. // The sequence of service accounts in a delegation chain. Each service
  82. // account must be granted the `roles/iam.serviceAccountTokenCreator` role
  83. // on its next service account in the chain. The last service account in the
  84. // chain must be granted the `roles/iam.serviceAccountTokenCreator` role
  85. // on the service account that is specified in the `name` field of the
  86. // request.
  87. //
  88. // The delegates must have the following format:
  89. // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard
  90. // character is required; replacing it with a project ID is invalid.
  91. repeated string delegates = 3;
  92. // Required. The bytes to sign.
  93. bytes payload = 5 [(google.api.field_behavior) = REQUIRED];
  94. }
  95. message SignBlobResponse {
  96. // The ID of the key used to sign the blob.
  97. string key_id = 1;
  98. // The signed blob.
  99. bytes signed_blob = 4;
  100. }
  101. message SignJwtRequest {
  102. // Required. The resource name of the service account for which the credentials
  103. // are requested, in the following format:
  104. // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard
  105. // character is required; replacing it with a project ID is invalid.
  106. string name = 1 [
  107. (google.api.field_behavior) = REQUIRED,
  108. (google.api.resource_reference) = {
  109. type: "iam.googleapis.com/ServiceAccount"
  110. }
  111. ];
  112. // The sequence of service accounts in a delegation chain. Each service
  113. // account must be granted the `roles/iam.serviceAccountTokenCreator` role
  114. // on its next service account in the chain. The last service account in the
  115. // chain must be granted the `roles/iam.serviceAccountTokenCreator` role
  116. // on the service account that is specified in the `name` field of the
  117. // request.
  118. //
  119. // The delegates must have the following format:
  120. // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard
  121. // character is required; replacing it with a project ID is invalid.
  122. repeated string delegates = 3;
  123. // Required. The JWT payload to sign: a JSON object that contains a JWT Claims Set.
  124. string payload = 5 [(google.api.field_behavior) = REQUIRED];
  125. }
  126. message SignJwtResponse {
  127. // The ID of the key used to sign the JWT.
  128. string key_id = 1;
  129. // The signed JWT.
  130. string signed_jwt = 2;
  131. }
  132. message GenerateIdTokenRequest {
  133. // Required. The resource name of the service account for which the credentials
  134. // are requested, in the following format:
  135. // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard
  136. // character is required; replacing it with a project ID is invalid.
  137. string name = 1 [
  138. (google.api.field_behavior) = REQUIRED,
  139. (google.api.resource_reference) = {
  140. type: "iam.googleapis.com/ServiceAccount"
  141. }
  142. ];
  143. // The sequence of service accounts in a delegation chain. Each service
  144. // account must be granted the `roles/iam.serviceAccountTokenCreator` role
  145. // on its next service account in the chain. The last service account in the
  146. // chain must be granted the `roles/iam.serviceAccountTokenCreator` role
  147. // on the service account that is specified in the `name` field of the
  148. // request.
  149. //
  150. // The delegates must have the following format:
  151. // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard
  152. // character is required; replacing it with a project ID is invalid.
  153. repeated string delegates = 2;
  154. // Required. The audience for the token, such as the API or account that this token
  155. // grants access to.
  156. string audience = 3 [(google.api.field_behavior) = REQUIRED];
  157. // Include the service account email in the token. If set to `true`, the
  158. // token will contain `email` and `email_verified` claims.
  159. bool include_email = 4;
  160. }
  161. message GenerateIdTokenResponse {
  162. // The OpenId Connect ID token.
  163. string token = 1;
  164. }