common.proto 7.4 KB

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