1
- // Copyright 2018 Google LLC
1
+ // Copyright 2019 Google LLC.
2
2
//
3
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
4
// you may not use this file except in compliance with the License.
11
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
// See the License for the specific language governing permissions and
13
13
// limitations under the License.
14
+ //
14
15
15
16
syntax = "proto3" ;
16
17
17
18
package google.iam.credentials.v1 ;
18
19
20
+ import "google/api/field_behavior.proto" ;
21
+ import "google/api/resource.proto" ;
19
22
import "google/protobuf/duration.proto" ;
20
23
import "google/protobuf/timestamp.proto" ;
21
24
@@ -24,12 +27,22 @@ option go_package = "google.golang.org/genproto/googleapis/iam/credentials/v1;cr
24
27
option java_multiple_files = true ;
25
28
option java_outer_classname = "IAMCredentialsCommonProto" ;
26
29
option java_package = "com.google.cloud.iam.credentials.v1" ;
30
+ option (google.api.resource_definition ) = {
31
+ type : "iam.googleapis.com/ServiceAccount"
32
+ pattern : "projects/{project}/serviceAccounts/{service_account}"
33
+ };
27
34
28
35
message GenerateAccessTokenRequest {
29
- // The resource name of the service account for which the credentials
36
+ // Required. The resource name of the service account for which the credentials
30
37
// are requested, in the following format:
31
- // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
32
- string name = 1 ;
38
+ // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard
39
+ // character is required; replacing it with a project ID is invalid.
40
+ string name = 1 [
41
+ (google.api.field_behavior ) = REQUIRED ,
42
+ (google.api.resource_reference ) = {
43
+ type : "iam.googleapis.com/ServiceAccount"
44
+ }
45
+ ];
33
46
34
47
// The sequence of service accounts in a delegation chain. Each service
35
48
// account must be granted the `roles/iam.serviceAccountTokenCreator` role
@@ -39,14 +52,15 @@ message GenerateAccessTokenRequest {
39
52
// request.
40
53
//
41
54
// The delegates must have the following format:
42
- // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
55
+ // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard
56
+ // character is required; replacing it with a project ID is invalid.
43
57
repeated string delegates = 2 ;
44
58
45
- // Code to identify the scopes to be included in the OAuth 2.0 access token.
59
+ // Required. Code to identify the scopes to be included in the OAuth 2.0 access token.
46
60
// See https://developers.google.com/identity/protocols/googlescopes for more
47
61
// information.
48
62
// At least one value required.
49
- repeated string scope = 4 ;
63
+ repeated string scope = 4 [ (google.api .field_behavior ) = REQUIRED ] ;
50
64
51
65
// The desired lifetime duration of the access token in seconds.
52
66
// Must be set to a value less than or equal to 3600 (1 hour). If a value is
@@ -65,10 +79,16 @@ message GenerateAccessTokenResponse {
65
79
}
66
80
67
81
message SignBlobRequest {
68
- // The resource name of the service account for which the credentials
82
+ // Required. The resource name of the service account for which the credentials
69
83
// are requested, in the following format:
70
- // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
71
- string name = 1 ;
84
+ // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard
85
+ // character is required; replacing it with a project ID is invalid.
86
+ string name = 1 [
87
+ (google.api.field_behavior ) = REQUIRED ,
88
+ (google.api.resource_reference ) = {
89
+ type : "iam.googleapis.com/ServiceAccount"
90
+ }
91
+ ];
72
92
73
93
// The sequence of service accounts in a delegation chain. Each service
74
94
// account must be granted the `roles/iam.serviceAccountTokenCreator` role
@@ -78,11 +98,12 @@ message SignBlobRequest {
78
98
// request.
79
99
//
80
100
// The delegates must have the following format:
81
- // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
101
+ // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard
102
+ // character is required; replacing it with a project ID is invalid.
82
103
repeated string delegates = 3 ;
83
104
84
- // The bytes to sign.
85
- bytes payload = 5 ;
105
+ // Required. The bytes to sign.
106
+ bytes payload = 5 [ (google.api .field_behavior ) = REQUIRED ] ;
86
107
}
87
108
88
109
message SignBlobResponse {
@@ -94,10 +115,16 @@ message SignBlobResponse {
94
115
}
95
116
96
117
message SignJwtRequest {
97
- // The resource name of the service account for which the credentials
118
+ // Required. The resource name of the service account for which the credentials
98
119
// are requested, in the following format:
99
- // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
100
- string name = 1 ;
120
+ // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard
121
+ // character is required; replacing it with a project ID is invalid.
122
+ string name = 1 [
123
+ (google.api.field_behavior ) = REQUIRED ,
124
+ (google.api.resource_reference ) = {
125
+ type : "iam.googleapis.com/ServiceAccount"
126
+ }
127
+ ];
101
128
102
129
// The sequence of service accounts in a delegation chain. Each service
103
130
// account must be granted the `roles/iam.serviceAccountTokenCreator` role
@@ -107,11 +134,12 @@ message SignJwtRequest {
107
134
// request.
108
135
//
109
136
// The delegates must have the following format:
110
- // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
137
+ // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard
138
+ // character is required; replacing it with a project ID is invalid.
111
139
repeated string delegates = 3 ;
112
140
113
- // The JWT payload to sign: a JSON object that contains a JWT Claims Set.
114
- string payload = 5 ;
141
+ // Required. The JWT payload to sign: a JSON object that contains a JWT Claims Set.
142
+ string payload = 5 [ (google.api .field_behavior ) = REQUIRED ] ;
115
143
}
116
144
117
145
message SignJwtResponse {
@@ -123,10 +151,16 @@ message SignJwtResponse {
123
151
}
124
152
125
153
message GenerateIdTokenRequest {
126
- // The resource name of the service account for which the credentials
154
+ // Required. The resource name of the service account for which the credentials
127
155
// are requested, in the following format:
128
- // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`.
129
- string name = 1 ;
156
+ // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard
157
+ // character is required; replacing it with a project ID is invalid.
158
+ string name = 1 [
159
+ (google.api.field_behavior ) = REQUIRED ,
160
+ (google.api.resource_reference ) = {
161
+ type : "iam.googleapis.com/ServiceAccount"
162
+ }
163
+ ];
130
164
131
165
// The sequence of service accounts in a delegation chain. Each service
132
166
// account must be granted the `roles/iam.serviceAccountTokenCreator` role
@@ -136,12 +170,13 @@ message GenerateIdTokenRequest {
136
170
// request.
137
171
//
138
172
// The delegates must have the following format:
139
- // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`
173
+ // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard
174
+ // character is required; replacing it with a project ID is invalid.
140
175
repeated string delegates = 2 ;
141
176
142
- // The audience for the token, such as the API or account that this token
177
+ // Required. The audience for the token, such as the API or account that this token
143
178
// grants access to.
144
- string audience = 3 ;
179
+ string audience = 3 [ (google.api .field_behavior ) = REQUIRED ] ;
145
180
146
181
// Include the service account email in the token. If set to `true`, the
147
182
// token will contain `email` and `email_verified` claims.
0 commit comments