1*d5c09012SAndroid Build Coastguard Worker// Copyright 2020 Google LLC 2*d5c09012SAndroid Build Coastguard Worker// 3*d5c09012SAndroid Build Coastguard Worker// Licensed under the Apache License, Version 2.0 (the "License"); 4*d5c09012SAndroid Build Coastguard Worker// you may not use this file except in compliance with the License. 5*d5c09012SAndroid Build Coastguard Worker// You may obtain a copy of the License at 6*d5c09012SAndroid Build Coastguard Worker// 7*d5c09012SAndroid Build Coastguard Worker// http://www.apache.org/licenses/LICENSE-2.0 8*d5c09012SAndroid Build Coastguard Worker// 9*d5c09012SAndroid Build Coastguard Worker// Unless required by applicable law or agreed to in writing, software 10*d5c09012SAndroid Build Coastguard Worker// distributed under the License is distributed on an "AS IS" BASIS, 11*d5c09012SAndroid Build Coastguard Worker// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12*d5c09012SAndroid Build Coastguard Worker// See the License for the specific language governing permissions and 13*d5c09012SAndroid Build Coastguard Worker// limitations under the License. 14*d5c09012SAndroid Build Coastguard Worker 15*d5c09012SAndroid Build Coastguard Workersyntax = "proto3"; 16*d5c09012SAndroid Build Coastguard Worker 17*d5c09012SAndroid Build Coastguard Workerpackage google.iam.credentials.v1; 18*d5c09012SAndroid Build Coastguard Worker 19*d5c09012SAndroid Build Coastguard Workerimport "google/api/field_behavior.proto"; 20*d5c09012SAndroid Build Coastguard Workerimport "google/api/resource.proto"; 21*d5c09012SAndroid Build Coastguard Workerimport "google/protobuf/duration.proto"; 22*d5c09012SAndroid Build Coastguard Workerimport "google/protobuf/timestamp.proto"; 23*d5c09012SAndroid Build Coastguard Worker 24*d5c09012SAndroid Build Coastguard Workeroption cc_enable_arenas = true; 25*d5c09012SAndroid Build Coastguard Workeroption csharp_namespace = "Google.Cloud.Iam.Credentials.V1"; 26*d5c09012SAndroid Build Coastguard Workeroption go_package = "cloud.google.com/go/iam/credentials/apiv1/credentialspb;credentialspb"; 27*d5c09012SAndroid Build Coastguard Workeroption java_multiple_files = true; 28*d5c09012SAndroid Build Coastguard Workeroption java_outer_classname = "IAMCredentialsCommonProto"; 29*d5c09012SAndroid Build Coastguard Workeroption java_package = "com.google.cloud.iam.credentials.v1"; 30*d5c09012SAndroid Build Coastguard Workeroption php_namespace = "Google\\Cloud\\Iam\\Credentials\\V1"; 31*d5c09012SAndroid Build Coastguard Workeroption (google.api.resource_definition) = { 32*d5c09012SAndroid Build Coastguard Worker type: "iam.googleapis.com/ServiceAccount" 33*d5c09012SAndroid Build Coastguard Worker pattern: "projects/{project}/serviceAccounts/{service_account}" 34*d5c09012SAndroid Build Coastguard Worker}; 35*d5c09012SAndroid Build Coastguard Worker 36*d5c09012SAndroid Build Coastguard Workermessage GenerateAccessTokenRequest { 37*d5c09012SAndroid Build Coastguard Worker // Required. The resource name of the service account for which the credentials 38*d5c09012SAndroid Build Coastguard Worker // are requested, in the following format: 39*d5c09012SAndroid Build Coastguard Worker // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard 40*d5c09012SAndroid Build Coastguard Worker // character is required; replacing it with a project ID is invalid. 41*d5c09012SAndroid Build Coastguard Worker string name = 1 [ 42*d5c09012SAndroid Build Coastguard Worker (google.api.field_behavior) = REQUIRED, 43*d5c09012SAndroid Build Coastguard Worker (google.api.resource_reference) = { 44*d5c09012SAndroid Build Coastguard Worker type: "iam.googleapis.com/ServiceAccount" 45*d5c09012SAndroid Build Coastguard Worker } 46*d5c09012SAndroid Build Coastguard Worker ]; 47*d5c09012SAndroid Build Coastguard Worker 48*d5c09012SAndroid Build Coastguard Worker // The sequence of service accounts in a delegation chain. Each service 49*d5c09012SAndroid Build Coastguard Worker // account must be granted the `roles/iam.serviceAccountTokenCreator` role 50*d5c09012SAndroid Build Coastguard Worker // on its next service account in the chain. The last service account in the 51*d5c09012SAndroid Build Coastguard Worker // chain must be granted the `roles/iam.serviceAccountTokenCreator` role 52*d5c09012SAndroid Build Coastguard Worker // on the service account that is specified in the `name` field of the 53*d5c09012SAndroid Build Coastguard Worker // request. 54*d5c09012SAndroid Build Coastguard Worker // 55*d5c09012SAndroid Build Coastguard Worker // The delegates must have the following format: 56*d5c09012SAndroid Build Coastguard Worker // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard 57*d5c09012SAndroid Build Coastguard Worker // character is required; replacing it with a project ID is invalid. 58*d5c09012SAndroid Build Coastguard Worker repeated string delegates = 2; 59*d5c09012SAndroid Build Coastguard Worker 60*d5c09012SAndroid Build Coastguard Worker // Required. Code to identify the scopes to be included in the OAuth 2.0 access token. 61*d5c09012SAndroid Build Coastguard Worker // See https://developers.google.com/identity/protocols/googlescopes for more 62*d5c09012SAndroid Build Coastguard Worker // information. 63*d5c09012SAndroid Build Coastguard Worker // At least one value required. 64*d5c09012SAndroid Build Coastguard Worker repeated string scope = 4 [(google.api.field_behavior) = REQUIRED]; 65*d5c09012SAndroid Build Coastguard Worker 66*d5c09012SAndroid Build Coastguard Worker // The desired lifetime duration of the access token in seconds. 67*d5c09012SAndroid Build Coastguard Worker // Must be set to a value less than or equal to 3600 (1 hour). If a value is 68*d5c09012SAndroid Build Coastguard Worker // not specified, the token's lifetime will be set to a default value of one 69*d5c09012SAndroid Build Coastguard Worker // hour. 70*d5c09012SAndroid Build Coastguard Worker google.protobuf.Duration lifetime = 7; 71*d5c09012SAndroid Build Coastguard Worker} 72*d5c09012SAndroid Build Coastguard Worker 73*d5c09012SAndroid Build Coastguard Workermessage GenerateAccessTokenResponse { 74*d5c09012SAndroid Build Coastguard Worker // The OAuth 2.0 access token. 75*d5c09012SAndroid Build Coastguard Worker string access_token = 1; 76*d5c09012SAndroid Build Coastguard Worker 77*d5c09012SAndroid Build Coastguard Worker // Token expiration time. 78*d5c09012SAndroid Build Coastguard Worker // The expiration time is always set. 79*d5c09012SAndroid Build Coastguard Worker google.protobuf.Timestamp expire_time = 3; 80*d5c09012SAndroid Build Coastguard Worker} 81*d5c09012SAndroid Build Coastguard Worker 82*d5c09012SAndroid Build Coastguard Workermessage SignBlobRequest { 83*d5c09012SAndroid Build Coastguard Worker // Required. The resource name of the service account for which the credentials 84*d5c09012SAndroid Build Coastguard Worker // are requested, in the following format: 85*d5c09012SAndroid Build Coastguard Worker // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard 86*d5c09012SAndroid Build Coastguard Worker // character is required; replacing it with a project ID is invalid. 87*d5c09012SAndroid Build Coastguard Worker string name = 1 [ 88*d5c09012SAndroid Build Coastguard Worker (google.api.field_behavior) = REQUIRED, 89*d5c09012SAndroid Build Coastguard Worker (google.api.resource_reference) = { 90*d5c09012SAndroid Build Coastguard Worker type: "iam.googleapis.com/ServiceAccount" 91*d5c09012SAndroid Build Coastguard Worker } 92*d5c09012SAndroid Build Coastguard Worker ]; 93*d5c09012SAndroid Build Coastguard Worker 94*d5c09012SAndroid Build Coastguard Worker // The sequence of service accounts in a delegation chain. Each service 95*d5c09012SAndroid Build Coastguard Worker // account must be granted the `roles/iam.serviceAccountTokenCreator` role 96*d5c09012SAndroid Build Coastguard Worker // on its next service account in the chain. The last service account in the 97*d5c09012SAndroid Build Coastguard Worker // chain must be granted the `roles/iam.serviceAccountTokenCreator` role 98*d5c09012SAndroid Build Coastguard Worker // on the service account that is specified in the `name` field of the 99*d5c09012SAndroid Build Coastguard Worker // request. 100*d5c09012SAndroid Build Coastguard Worker // 101*d5c09012SAndroid Build Coastguard Worker // The delegates must have the following format: 102*d5c09012SAndroid Build Coastguard Worker // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard 103*d5c09012SAndroid Build Coastguard Worker // character is required; replacing it with a project ID is invalid. 104*d5c09012SAndroid Build Coastguard Worker repeated string delegates = 3; 105*d5c09012SAndroid Build Coastguard Worker 106*d5c09012SAndroid Build Coastguard Worker // Required. The bytes to sign. 107*d5c09012SAndroid Build Coastguard Worker bytes payload = 5 [(google.api.field_behavior) = REQUIRED]; 108*d5c09012SAndroid Build Coastguard Worker} 109*d5c09012SAndroid Build Coastguard Worker 110*d5c09012SAndroid Build Coastguard Workermessage SignBlobResponse { 111*d5c09012SAndroid Build Coastguard Worker // The ID of the key used to sign the blob. 112*d5c09012SAndroid Build Coastguard Worker string key_id = 1; 113*d5c09012SAndroid Build Coastguard Worker 114*d5c09012SAndroid Build Coastguard Worker // The signed blob. 115*d5c09012SAndroid Build Coastguard Worker bytes signed_blob = 4; 116*d5c09012SAndroid Build Coastguard Worker} 117*d5c09012SAndroid Build Coastguard Worker 118*d5c09012SAndroid Build Coastguard Workermessage SignJwtRequest { 119*d5c09012SAndroid Build Coastguard Worker // Required. The resource name of the service account for which the credentials 120*d5c09012SAndroid Build Coastguard Worker // are requested, in the following format: 121*d5c09012SAndroid Build Coastguard Worker // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard 122*d5c09012SAndroid Build Coastguard Worker // character is required; replacing it with a project ID is invalid. 123*d5c09012SAndroid Build Coastguard Worker string name = 1 [ 124*d5c09012SAndroid Build Coastguard Worker (google.api.field_behavior) = REQUIRED, 125*d5c09012SAndroid Build Coastguard Worker (google.api.resource_reference) = { 126*d5c09012SAndroid Build Coastguard Worker type: "iam.googleapis.com/ServiceAccount" 127*d5c09012SAndroid Build Coastguard Worker } 128*d5c09012SAndroid Build Coastguard Worker ]; 129*d5c09012SAndroid Build Coastguard Worker 130*d5c09012SAndroid Build Coastguard Worker // The sequence of service accounts in a delegation chain. Each service 131*d5c09012SAndroid Build Coastguard Worker // account must be granted the `roles/iam.serviceAccountTokenCreator` role 132*d5c09012SAndroid Build Coastguard Worker // on its next service account in the chain. The last service account in the 133*d5c09012SAndroid Build Coastguard Worker // chain must be granted the `roles/iam.serviceAccountTokenCreator` role 134*d5c09012SAndroid Build Coastguard Worker // on the service account that is specified in the `name` field of the 135*d5c09012SAndroid Build Coastguard Worker // request. 136*d5c09012SAndroid Build Coastguard Worker // 137*d5c09012SAndroid Build Coastguard Worker // The delegates must have the following format: 138*d5c09012SAndroid Build Coastguard Worker // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard 139*d5c09012SAndroid Build Coastguard Worker // character is required; replacing it with a project ID is invalid. 140*d5c09012SAndroid Build Coastguard Worker repeated string delegates = 3; 141*d5c09012SAndroid Build Coastguard Worker 142*d5c09012SAndroid Build Coastguard Worker // Required. The JWT payload to sign: a JSON object that contains a JWT Claims Set. 143*d5c09012SAndroid Build Coastguard Worker string payload = 5 [(google.api.field_behavior) = REQUIRED]; 144*d5c09012SAndroid Build Coastguard Worker} 145*d5c09012SAndroid Build Coastguard Worker 146*d5c09012SAndroid Build Coastguard Workermessage SignJwtResponse { 147*d5c09012SAndroid Build Coastguard Worker // The ID of the key used to sign the JWT. 148*d5c09012SAndroid Build Coastguard Worker string key_id = 1; 149*d5c09012SAndroid Build Coastguard Worker 150*d5c09012SAndroid Build Coastguard Worker // The signed JWT. 151*d5c09012SAndroid Build Coastguard Worker string signed_jwt = 2; 152*d5c09012SAndroid Build Coastguard Worker} 153*d5c09012SAndroid Build Coastguard Worker 154*d5c09012SAndroid Build Coastguard Workermessage GenerateIdTokenRequest { 155*d5c09012SAndroid Build Coastguard Worker // Required. The resource name of the service account for which the credentials 156*d5c09012SAndroid Build Coastguard Worker // are requested, in the following format: 157*d5c09012SAndroid Build Coastguard Worker // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard 158*d5c09012SAndroid Build Coastguard Worker // character is required; replacing it with a project ID is invalid. 159*d5c09012SAndroid Build Coastguard Worker string name = 1 [ 160*d5c09012SAndroid Build Coastguard Worker (google.api.field_behavior) = REQUIRED, 161*d5c09012SAndroid Build Coastguard Worker (google.api.resource_reference) = { 162*d5c09012SAndroid Build Coastguard Worker type: "iam.googleapis.com/ServiceAccount" 163*d5c09012SAndroid Build Coastguard Worker } 164*d5c09012SAndroid Build Coastguard Worker ]; 165*d5c09012SAndroid Build Coastguard Worker 166*d5c09012SAndroid Build Coastguard Worker // The sequence of service accounts in a delegation chain. Each service 167*d5c09012SAndroid Build Coastguard Worker // account must be granted the `roles/iam.serviceAccountTokenCreator` role 168*d5c09012SAndroid Build Coastguard Worker // on its next service account in the chain. The last service account in the 169*d5c09012SAndroid Build Coastguard Worker // chain must be granted the `roles/iam.serviceAccountTokenCreator` role 170*d5c09012SAndroid Build Coastguard Worker // on the service account that is specified in the `name` field of the 171*d5c09012SAndroid Build Coastguard Worker // request. 172*d5c09012SAndroid Build Coastguard Worker // 173*d5c09012SAndroid Build Coastguard Worker // The delegates must have the following format: 174*d5c09012SAndroid Build Coastguard Worker // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard 175*d5c09012SAndroid Build Coastguard Worker // character is required; replacing it with a project ID is invalid. 176*d5c09012SAndroid Build Coastguard Worker repeated string delegates = 2; 177*d5c09012SAndroid Build Coastguard Worker 178*d5c09012SAndroid Build Coastguard Worker // Required. The audience for the token, such as the API or account that this token 179*d5c09012SAndroid Build Coastguard Worker // grants access to. 180*d5c09012SAndroid Build Coastguard Worker string audience = 3 [(google.api.field_behavior) = REQUIRED]; 181*d5c09012SAndroid Build Coastguard Worker 182*d5c09012SAndroid Build Coastguard Worker // Include the service account email in the token. If set to `true`, the 183*d5c09012SAndroid Build Coastguard Worker // token will contain `email` and `email_verified` claims. 184*d5c09012SAndroid Build Coastguard Worker bool include_email = 4; 185*d5c09012SAndroid Build Coastguard Worker} 186*d5c09012SAndroid Build Coastguard Worker 187*d5c09012SAndroid Build Coastguard Workermessage GenerateIdTokenResponse { 188*d5c09012SAndroid Build Coastguard Worker // The OpenId Connect ID token. 189*d5c09012SAndroid Build Coastguard Worker string token = 1; 190*d5c09012SAndroid Build Coastguard Worker} 191