iam.proto 62 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623
  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.iam.admin.v1;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/api/field_behavior.proto";
  19. import "google/api/resource.proto";
  20. import "google/iam/v1/iam_policy.proto";
  21. import "google/iam/v1/policy.proto";
  22. import "google/protobuf/empty.proto";
  23. import "google/protobuf/field_mask.proto";
  24. import "google/protobuf/timestamp.proto";
  25. import "google/type/expr.proto";
  26. option cc_enable_arenas = true;
  27. option csharp_namespace = "Google.Cloud.Iam.Admin.V1";
  28. option go_package = "google.golang.org/genproto/googleapis/iam/admin/v1;admin";
  29. option java_multiple_files = true;
  30. option java_package = "com.google.iam.admin.v1";
  31. option php_namespace = "Google\\Cloud\\Iam\\Admin\\V1";
  32. // Creates and manages Identity and Access Management (IAM) resources.
  33. //
  34. // You can use this service to work with all of the following resources:
  35. //
  36. // * **Service accounts**, which identify an application or a virtual machine
  37. // (VM) instance rather than a person
  38. // * **Service account keys**, which service accounts use to authenticate with
  39. // Google APIs
  40. // * **IAM policies for service accounts**, which specify the roles that a
  41. // principal has for the service account
  42. // * **IAM custom roles**, which help you limit the number of permissions that
  43. // you grant to principals
  44. //
  45. // In addition, you can use this service to complete the following tasks, among
  46. // others:
  47. //
  48. // * Test whether a service account can use specific permissions
  49. // * Check which roles you can grant for a specific resource
  50. // * Lint, or validate, condition expressions in an IAM policy
  51. //
  52. // When you read data from the IAM API, each read is eventually consistent. In
  53. // other words, if you write data with the IAM API, then immediately read that
  54. // data, the read operation might return an older version of the data. To deal
  55. // with this behavior, your application can retry the request with truncated
  56. // exponential backoff.
  57. //
  58. // In contrast, writing data to the IAM API is sequentially consistent. In other
  59. // words, write operations are always processed in the order in which they were
  60. // received.
  61. service IAM {
  62. option (google.api.default_host) = "iam.googleapis.com";
  63. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
  64. // Lists every [ServiceAccount][google.iam.admin.v1.ServiceAccount] that belongs to a specific project.
  65. rpc ListServiceAccounts(ListServiceAccountsRequest) returns (ListServiceAccountsResponse) {
  66. option (google.api.http) = {
  67. get: "/v1/{name=projects/*}/serviceAccounts"
  68. };
  69. option (google.api.method_signature) = "name";
  70. }
  71. // Gets a [ServiceAccount][google.iam.admin.v1.ServiceAccount].
  72. rpc GetServiceAccount(GetServiceAccountRequest) returns (ServiceAccount) {
  73. option (google.api.http) = {
  74. get: "/v1/{name=projects/*/serviceAccounts/*}"
  75. };
  76. option (google.api.method_signature) = "name";
  77. }
  78. // Creates a [ServiceAccount][google.iam.admin.v1.ServiceAccount].
  79. rpc CreateServiceAccount(CreateServiceAccountRequest) returns (ServiceAccount) {
  80. option (google.api.http) = {
  81. post: "/v1/{name=projects/*}/serviceAccounts"
  82. body: "*"
  83. };
  84. option (google.api.method_signature) = "name,account_id,service_account";
  85. }
  86. // **Note:** We are in the process of deprecating this method. Use
  87. // [PatchServiceAccount][google.iam.admin.v1.IAM.PatchServiceAccount] instead.
  88. //
  89. // Updates a [ServiceAccount][google.iam.admin.v1.ServiceAccount].
  90. //
  91. // You can update only the `display_name` field.
  92. rpc UpdateServiceAccount(ServiceAccount) returns (ServiceAccount) {
  93. option (google.api.http) = {
  94. put: "/v1/{name=projects/*/serviceAccounts/*}"
  95. body: "*"
  96. };
  97. }
  98. // Patches a [ServiceAccount][google.iam.admin.v1.ServiceAccount].
  99. rpc PatchServiceAccount(PatchServiceAccountRequest) returns (ServiceAccount) {
  100. option (google.api.http) = {
  101. patch: "/v1/{service_account.name=projects/*/serviceAccounts/*}"
  102. body: "*"
  103. };
  104. }
  105. // Deletes a [ServiceAccount][google.iam.admin.v1.ServiceAccount].
  106. //
  107. // **Warning:** After you delete a service account, you might not be able to
  108. // undelete it. If you know that you need to re-enable the service account in
  109. // the future, use [DisableServiceAccount][google.iam.admin.v1.IAM.DisableServiceAccount] instead.
  110. //
  111. // If you delete a service account, IAM permanently removes the service
  112. // account 30 days later. Google Cloud cannot recover the service account
  113. // after it is permanently removed, even if you file a support request.
  114. //
  115. // To help avoid unplanned outages, we recommend that you disable the service
  116. // account before you delete it. Use [DisableServiceAccount][google.iam.admin.v1.IAM.DisableServiceAccount] to disable the
  117. // service account, then wait at least 24 hours and watch for unintended
  118. // consequences. If there are no unintended consequences, you can delete the
  119. // service account.
  120. rpc DeleteServiceAccount(DeleteServiceAccountRequest) returns (google.protobuf.Empty) {
  121. option (google.api.http) = {
  122. delete: "/v1/{name=projects/*/serviceAccounts/*}"
  123. };
  124. option (google.api.method_signature) = "name";
  125. }
  126. // Restores a deleted [ServiceAccount][google.iam.admin.v1.ServiceAccount].
  127. //
  128. // **Important:** It is not always possible to restore a deleted service
  129. // account. Use this method only as a last resort.
  130. //
  131. // After you delete a service account, IAM permanently removes the service
  132. // account 30 days later. There is no way to restore a deleted service account
  133. // that has been permanently removed.
  134. rpc UndeleteServiceAccount(UndeleteServiceAccountRequest) returns (UndeleteServiceAccountResponse) {
  135. option (google.api.http) = {
  136. post: "/v1/{name=projects/*/serviceAccounts/*}:undelete"
  137. body: "*"
  138. };
  139. }
  140. // Enables a [ServiceAccount][google.iam.admin.v1.ServiceAccount] that was disabled by
  141. // [DisableServiceAccount][google.iam.admin.v1.IAM.DisableServiceAccount].
  142. //
  143. // If the service account is already enabled, then this method has no effect.
  144. //
  145. // If the service account was disabled by other means—for example, if Google
  146. // disabled the service account because it was compromised—you cannot use this
  147. // method to enable the service account.
  148. rpc EnableServiceAccount(EnableServiceAccountRequest) returns (google.protobuf.Empty) {
  149. option (google.api.http) = {
  150. post: "/v1/{name=projects/*/serviceAccounts/*}:enable"
  151. body: "*"
  152. };
  153. }
  154. // Disables a [ServiceAccount][google.iam.admin.v1.ServiceAccount] immediately.
  155. //
  156. // If an application uses the service account to authenticate, that
  157. // application can no longer call Google APIs or access Google Cloud
  158. // resources. Existing access tokens for the service account are rejected, and
  159. // requests for new access tokens will fail.
  160. //
  161. // To re-enable the service account, use [EnableServiceAccount][google.iam.admin.v1.IAM.EnableServiceAccount]. After you
  162. // re-enable the service account, its existing access tokens will be accepted,
  163. // and you can request new access tokens.
  164. //
  165. // To help avoid unplanned outages, we recommend that you disable the service
  166. // account before you delete it. Use this method to disable the service
  167. // account, then wait at least 24 hours and watch for unintended consequences.
  168. // If there are no unintended consequences, you can delete the service account
  169. // with [DeleteServiceAccount][google.iam.admin.v1.IAM.DeleteServiceAccount].
  170. rpc DisableServiceAccount(DisableServiceAccountRequest) returns (google.protobuf.Empty) {
  171. option (google.api.http) = {
  172. post: "/v1/{name=projects/*/serviceAccounts/*}:disable"
  173. body: "*"
  174. };
  175. }
  176. // Lists every [ServiceAccountKey][google.iam.admin.v1.ServiceAccountKey] for a service account.
  177. rpc ListServiceAccountKeys(ListServiceAccountKeysRequest) returns (ListServiceAccountKeysResponse) {
  178. option (google.api.http) = {
  179. get: "/v1/{name=projects/*/serviceAccounts/*}/keys"
  180. };
  181. option (google.api.method_signature) = "name,key_types";
  182. }
  183. // Gets a [ServiceAccountKey][google.iam.admin.v1.ServiceAccountKey].
  184. rpc GetServiceAccountKey(GetServiceAccountKeyRequest) returns (ServiceAccountKey) {
  185. option (google.api.http) = {
  186. get: "/v1/{name=projects/*/serviceAccounts/*/keys/*}"
  187. };
  188. option (google.api.method_signature) = "name,public_key_type";
  189. }
  190. // Creates a [ServiceAccountKey][google.iam.admin.v1.ServiceAccountKey].
  191. rpc CreateServiceAccountKey(CreateServiceAccountKeyRequest) returns (ServiceAccountKey) {
  192. option (google.api.http) = {
  193. post: "/v1/{name=projects/*/serviceAccounts/*}/keys"
  194. body: "*"
  195. };
  196. option (google.api.method_signature) = "name,private_key_type,key_algorithm";
  197. }
  198. // Uploads the public key portion of a key pair that you manage, and
  199. // associates the public key with a [ServiceAccount][google.iam.admin.v1.ServiceAccount].
  200. //
  201. // After you upload the public key, you can use the private key from the key
  202. // pair as a service account key.
  203. rpc UploadServiceAccountKey(UploadServiceAccountKeyRequest) returns (ServiceAccountKey) {
  204. option (google.api.http) = {
  205. post: "/v1/{name=projects/*/serviceAccounts/*}/keys:upload"
  206. body: "*"
  207. };
  208. }
  209. // Deletes a [ServiceAccountKey][google.iam.admin.v1.ServiceAccountKey]. Deleting a service account key does not
  210. // revoke short-lived credentials that have been issued based on the service
  211. // account key.
  212. rpc DeleteServiceAccountKey(DeleteServiceAccountKeyRequest) returns (google.protobuf.Empty) {
  213. option (google.api.http) = {
  214. delete: "/v1/{name=projects/*/serviceAccounts/*/keys/*}"
  215. };
  216. option (google.api.method_signature) = "name";
  217. }
  218. // Disable a [ServiceAccountKey][google.iam.admin.v1.ServiceAccountKey]. A disabled service account key can be
  219. // re-enabled with [EnableServiceAccountKey][google.iam.admin.v1.IAM.EnableServiceAccountKey].
  220. rpc DisableServiceAccountKey(DisableServiceAccountKeyRequest) returns (google.protobuf.Empty) {
  221. option (google.api.http) = {
  222. post: "/v1/{name=projects/*/serviceAccounts/*/keys/*}:disable"
  223. body: "*"
  224. };
  225. option (google.api.method_signature) = "name";
  226. }
  227. // Enable a [ServiceAccountKey][google.iam.admin.v1.ServiceAccountKey].
  228. rpc EnableServiceAccountKey(EnableServiceAccountKeyRequest) returns (google.protobuf.Empty) {
  229. option (google.api.http) = {
  230. post: "/v1/{name=projects/*/serviceAccounts/*/keys/*}:enable"
  231. body: "*"
  232. };
  233. option (google.api.method_signature) = "name";
  234. }
  235. // **Note:** This method is deprecated. Use the
  236. // [`signBlob`](https://cloud.google.com/iam/help/rest-credentials/v1/projects.serviceAccounts/signBlob)
  237. // method in the IAM Service Account Credentials API instead. If you currently
  238. // use this method, see the [migration
  239. // guide](https://cloud.google.com/iam/help/credentials/migrate-api) for
  240. // instructions.
  241. //
  242. // Signs a blob using the system-managed private key for a [ServiceAccount][google.iam.admin.v1.ServiceAccount].
  243. rpc SignBlob(SignBlobRequest) returns (SignBlobResponse) {
  244. option deprecated = true;
  245. option (google.api.http) = {
  246. post: "/v1/{name=projects/*/serviceAccounts/*}:signBlob"
  247. body: "*"
  248. };
  249. option (google.api.method_signature) = "name,bytes_to_sign";
  250. }
  251. // **Note:** This method is deprecated. Use the
  252. // [`signJwt`](https://cloud.google.com/iam/help/rest-credentials/v1/projects.serviceAccounts/signJwt)
  253. // method in the IAM Service Account Credentials API instead. If you currently
  254. // use this method, see the [migration
  255. // guide](https://cloud.google.com/iam/help/credentials/migrate-api) for
  256. // instructions.
  257. //
  258. // Signs a JSON Web Token (JWT) using the system-managed private key for a
  259. // [ServiceAccount][google.iam.admin.v1.ServiceAccount].
  260. rpc SignJwt(SignJwtRequest) returns (SignJwtResponse) {
  261. option deprecated = true;
  262. option (google.api.http) = {
  263. post: "/v1/{name=projects/*/serviceAccounts/*}:signJwt"
  264. body: "*"
  265. };
  266. option (google.api.method_signature) = "name,payload";
  267. }
  268. // Gets the IAM policy that is attached to a [ServiceAccount][google.iam.admin.v1.ServiceAccount]. This IAM
  269. // policy specifies which principals have access to the service account.
  270. //
  271. // This method does not tell you whether the service account has been granted
  272. // any roles on other resources. To check whether a service account has role
  273. // grants on a resource, use the `getIamPolicy` method for that resource. For
  274. // example, to view the role grants for a project, call the Resource Manager
  275. // API's
  276. // [`projects.getIamPolicy`](https://cloud.google.com/resource-manager/reference/rest/v1/projects/getIamPolicy)
  277. // method.
  278. rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy) {
  279. option (google.api.http) = {
  280. post: "/v1/{resource=projects/*/serviceAccounts/*}:getIamPolicy"
  281. };
  282. option (google.api.method_signature) = "resource";
  283. }
  284. // Sets the IAM policy that is attached to a [ServiceAccount][google.iam.admin.v1.ServiceAccount].
  285. //
  286. // Use this method to grant or revoke access to the service account. For
  287. // example, you could grant a principal the ability to impersonate the service
  288. // account.
  289. //
  290. // This method does not enable the service account to access other resources.
  291. // To grant roles to a service account on a resource, follow these steps:
  292. //
  293. // 1. Call the resource's `getIamPolicy` method to get its current IAM policy.
  294. // 2. Edit the policy so that it binds the service account to an IAM role for
  295. // the resource.
  296. // 3. Call the resource's `setIamPolicy` method to update its IAM policy.
  297. //
  298. // For detailed instructions, see
  299. // [Manage access to project, folders, and
  300. // organizations](https://cloud.google.com/iam/help/service-accounts/granting-access-to-service-accounts)
  301. // or [Manage access to other
  302. // resources](https://cloud.google.com/iam/help/access/manage-other-resources).
  303. rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy) {
  304. option (google.api.http) = {
  305. post: "/v1/{resource=projects/*/serviceAccounts/*}:setIamPolicy"
  306. body: "*"
  307. };
  308. option (google.api.method_signature) = "resource,policy";
  309. }
  310. // Tests whether the caller has the specified permissions on a
  311. // [ServiceAccount][google.iam.admin.v1.ServiceAccount].
  312. rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse) {
  313. option (google.api.http) = {
  314. post: "/v1/{resource=projects/*/serviceAccounts/*}:testIamPermissions"
  315. body: "*"
  316. };
  317. option (google.api.method_signature) = "resource,permissions";
  318. }
  319. // Lists roles that can be granted on a Google Cloud resource. A role is
  320. // grantable if the IAM policy for the resource can contain bindings to the
  321. // role.
  322. rpc QueryGrantableRoles(QueryGrantableRolesRequest) returns (QueryGrantableRolesResponse) {
  323. option (google.api.http) = {
  324. post: "/v1/roles:queryGrantableRoles"
  325. body: "*"
  326. };
  327. option (google.api.method_signature) = "full_resource_name";
  328. }
  329. // Lists every predefined [Role][google.iam.admin.v1.Role] that IAM supports, or every custom role
  330. // that is defined for an organization or project.
  331. rpc ListRoles(ListRolesRequest) returns (ListRolesResponse) {
  332. option (google.api.http) = {
  333. get: "/v1/roles"
  334. additional_bindings {
  335. get: "/v1/{parent=organizations/*}/roles"
  336. }
  337. additional_bindings {
  338. get: "/v1/{parent=projects/*}/roles"
  339. }
  340. };
  341. }
  342. // Gets the definition of a [Role][google.iam.admin.v1.Role].
  343. rpc GetRole(GetRoleRequest) returns (Role) {
  344. option (google.api.http) = {
  345. get: "/v1/{name=roles/*}"
  346. additional_bindings {
  347. get: "/v1/{name=organizations/*/roles/*}"
  348. }
  349. additional_bindings {
  350. get: "/v1/{name=projects/*/roles/*}"
  351. }
  352. };
  353. }
  354. // Creates a new custom [Role][google.iam.admin.v1.Role].
  355. rpc CreateRole(CreateRoleRequest) returns (Role) {
  356. option (google.api.http) = {
  357. post: "/v1/{parent=organizations/*}/roles"
  358. body: "*"
  359. additional_bindings {
  360. post: "/v1/{parent=projects/*}/roles"
  361. body: "*"
  362. }
  363. };
  364. }
  365. // Updates the definition of a custom [Role][google.iam.admin.v1.Role].
  366. rpc UpdateRole(UpdateRoleRequest) returns (Role) {
  367. option (google.api.http) = {
  368. patch: "/v1/{name=organizations/*/roles/*}"
  369. body: "role"
  370. additional_bindings {
  371. patch: "/v1/{name=projects/*/roles/*}"
  372. body: "role"
  373. }
  374. };
  375. }
  376. // Deletes a custom [Role][google.iam.admin.v1.Role].
  377. //
  378. // When you delete a custom role, the following changes occur immediately:
  379. //
  380. // * You cannot bind a principal to the custom role in an IAM
  381. // [Policy][google.iam.v1.Policy].
  382. // * Existing bindings to the custom role are not changed, but they have no
  383. // effect.
  384. // * By default, the response from [ListRoles][google.iam.admin.v1.IAM.ListRoles] does not include the custom
  385. // role.
  386. //
  387. // You have 7 days to undelete the custom role. After 7 days, the following
  388. // changes occur:
  389. //
  390. // * The custom role is permanently deleted and cannot be recovered.
  391. // * If an IAM policy contains a binding to the custom role, the binding is
  392. // permanently removed.
  393. rpc DeleteRole(DeleteRoleRequest) returns (Role) {
  394. option (google.api.http) = {
  395. delete: "/v1/{name=organizations/*/roles/*}"
  396. additional_bindings {
  397. delete: "/v1/{name=projects/*/roles/*}"
  398. }
  399. };
  400. }
  401. // Undeletes a custom [Role][google.iam.admin.v1.Role].
  402. rpc UndeleteRole(UndeleteRoleRequest) returns (Role) {
  403. option (google.api.http) = {
  404. post: "/v1/{name=organizations/*/roles/*}:undelete"
  405. body: "*"
  406. additional_bindings {
  407. post: "/v1/{name=projects/*/roles/*}:undelete"
  408. body: "*"
  409. }
  410. };
  411. }
  412. // Lists every permission that you can test on a resource. A permission is
  413. // testable if you can check whether a principal has that permission on the
  414. // resource.
  415. rpc QueryTestablePermissions(QueryTestablePermissionsRequest) returns (QueryTestablePermissionsResponse) {
  416. option (google.api.http) = {
  417. post: "/v1/permissions:queryTestablePermissions"
  418. body: "*"
  419. };
  420. }
  421. // Returns a list of services that allow you to opt into audit logs that are
  422. // not generated by default.
  423. //
  424. // To learn more about audit logs, see the [Logging
  425. // documentation](https://cloud.google.com/logging/docs/audit).
  426. rpc QueryAuditableServices(QueryAuditableServicesRequest) returns (QueryAuditableServicesResponse) {
  427. option (google.api.http) = {
  428. post: "/v1/iamPolicies:queryAuditableServices"
  429. body: "*"
  430. };
  431. }
  432. // Lints, or validates, an IAM policy. Currently checks the
  433. // [google.iam.v1.Binding.condition][google.iam.v1.Binding.condition] field, which contains a condition
  434. // expression for a role binding.
  435. //
  436. // Successful calls to this method always return an HTTP `200 OK` status code,
  437. // even if the linter detects an issue in the IAM policy.
  438. rpc LintPolicy(LintPolicyRequest) returns (LintPolicyResponse) {
  439. option (google.api.http) = {
  440. post: "/v1/iamPolicies:lintPolicy"
  441. body: "*"
  442. };
  443. }
  444. }
  445. // An IAM service account.
  446. //
  447. // A service account is an account for an application or a virtual machine (VM)
  448. // instance, not a person. You can use a service account to call Google APIs. To
  449. // learn more, read the [overview of service
  450. // accounts](https://cloud.google.com/iam/help/service-accounts/overview).
  451. //
  452. // When you create a service account, you specify the project ID that owns the
  453. // service account, as well as a name that must be unique within the project.
  454. // IAM uses these values to create an email address that identifies the service
  455. // account.
  456. message ServiceAccount {
  457. option (google.api.resource) = {
  458. type: "iam.googleapis.com/ServiceAccount"
  459. pattern: "projects/{project}/serviceAccounts/{service_account}"
  460. };
  461. // The resource name of the service account.
  462. //
  463. // Use one of the following formats:
  464. //
  465. // * `projects/{PROJECT_ID}/serviceAccounts/{EMAIL_ADDRESS}`
  466. // * `projects/{PROJECT_ID}/serviceAccounts/{UNIQUE_ID}`
  467. //
  468. // As an alternative, you can use the `-` wildcard character instead of the
  469. // project ID:
  470. //
  471. // * `projects/-/serviceAccounts/{EMAIL_ADDRESS}`
  472. // * `projects/-/serviceAccounts/{UNIQUE_ID}`
  473. //
  474. // When possible, avoid using the `-` wildcard character, because it can cause
  475. // response messages to contain misleading error codes. For example, if you
  476. // try to get the service account
  477. // `projects/-/serviceAccounts/fake@example.com`, which does not exist, the
  478. // response contains an HTTP `403 Forbidden` error instead of a `404 Not
  479. // Found` error.
  480. string name = 1;
  481. // Output only. The ID of the project that owns the service account.
  482. string project_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  483. // Output only. The unique, stable numeric ID for the service account.
  484. //
  485. // Each service account retains its unique ID even if you delete the service
  486. // account. For example, if you delete a service account, then create a new
  487. // service account with the same name, the new service account has a different
  488. // unique ID than the deleted service account.
  489. string unique_id = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  490. // Output only. The email address of the service account.
  491. string email = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  492. // Optional. A user-specified, human-readable name for the service account. The maximum
  493. // length is 100 UTF-8 bytes.
  494. string display_name = 6 [(google.api.field_behavior) = OPTIONAL];
  495. // Deprecated. Do not use.
  496. bytes etag = 7 [deprecated = true];
  497. // Optional. A user-specified, human-readable description of the service account. The
  498. // maximum length is 256 UTF-8 bytes.
  499. string description = 8 [(google.api.field_behavior) = OPTIONAL];
  500. // Output only. The OAuth 2.0 client ID for the service account.
  501. string oauth2_client_id = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
  502. // Output only. Whether the service account is disabled.
  503. bool disabled = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
  504. }
  505. // The service account create request.
  506. message CreateServiceAccountRequest {
  507. // Required. The resource name of the project associated with the service
  508. // accounts, such as `projects/my-project-123`.
  509. string name = 1 [
  510. (google.api.field_behavior) = REQUIRED,
  511. (google.api.resource_reference) = {
  512. type: "cloudresourcemanager.googleapis.com/Project"
  513. }
  514. ];
  515. // Required. The account id that is used to generate the service account
  516. // email address and a stable unique id. It is unique within a project,
  517. // must be 6-30 characters long, and match the regular expression
  518. // `[a-z]([-a-z0-9]*[a-z0-9])` to comply with RFC1035.
  519. string account_id = 2 [(google.api.field_behavior) = REQUIRED];
  520. // The [ServiceAccount][google.iam.admin.v1.ServiceAccount] resource to
  521. // create. Currently, only the following values are user assignable:
  522. // `display_name` and `description`.
  523. ServiceAccount service_account = 3;
  524. }
  525. // The service account list request.
  526. message ListServiceAccountsRequest {
  527. // Required. The resource name of the project associated with the service
  528. // accounts, such as `projects/my-project-123`.
  529. string name = 1 [
  530. (google.api.field_behavior) = REQUIRED,
  531. (google.api.resource_reference) = {
  532. type: "cloudresourcemanager.googleapis.com/Project"
  533. }
  534. ];
  535. // Optional limit on the number of service accounts to include in the
  536. // response. Further accounts can subsequently be obtained by including the
  537. // [ListServiceAccountsResponse.next_page_token][google.iam.admin.v1.ListServiceAccountsResponse.next_page_token]
  538. // in a subsequent request.
  539. //
  540. // The default is 20, and the maximum is 100.
  541. int32 page_size = 2;
  542. // Optional pagination token returned in an earlier
  543. // [ListServiceAccountsResponse.next_page_token][google.iam.admin.v1.ListServiceAccountsResponse.next_page_token].
  544. string page_token = 3;
  545. }
  546. // The service account list response.
  547. message ListServiceAccountsResponse {
  548. // The list of matching service accounts.
  549. repeated ServiceAccount accounts = 1;
  550. // To retrieve the next page of results, set
  551. // [ListServiceAccountsRequest.page_token][google.iam.admin.v1.ListServiceAccountsRequest.page_token]
  552. // to this value.
  553. string next_page_token = 2;
  554. }
  555. // The service account get request.
  556. message GetServiceAccountRequest {
  557. // Required. The resource name of the service account in the following format:
  558. // `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`.
  559. // Using `-` as a wildcard for the `PROJECT_ID` will infer the project from
  560. // the account. The `ACCOUNT` value can be the `email` address or the
  561. // `unique_id` of the service account.
  562. string name = 1 [
  563. (google.api.field_behavior) = REQUIRED,
  564. (google.api.resource_reference) = {
  565. type: "iam.googleapis.com/ServiceAccount"
  566. }
  567. ];
  568. }
  569. // The service account delete request.
  570. message DeleteServiceAccountRequest {
  571. // Required. The resource name of the service account in the following format:
  572. // `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`.
  573. // Using `-` as a wildcard for the `PROJECT_ID` will infer the project from
  574. // the account. The `ACCOUNT` value can be the `email` address or the
  575. // `unique_id` of the service account.
  576. string name = 1 [
  577. (google.api.field_behavior) = REQUIRED,
  578. (google.api.resource_reference) = {
  579. type: "iam.googleapis.com/ServiceAccount"
  580. }
  581. ];
  582. }
  583. // The service account patch request.
  584. //
  585. // You can patch only the `display_name` and `description` fields. You must use
  586. // the `update_mask` field to specify which of these fields you want to patch.
  587. //
  588. // Only the fields specified in the request are guaranteed to be returned in
  589. // the response. Other fields may be empty in the response.
  590. message PatchServiceAccountRequest {
  591. ServiceAccount service_account = 1;
  592. google.protobuf.FieldMask update_mask = 2;
  593. }
  594. // The service account undelete request.
  595. message UndeleteServiceAccountRequest {
  596. // The resource name of the service account in the following format:
  597. // `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT_UNIQUE_ID}`.
  598. // Using `-` as a wildcard for the `PROJECT_ID` will infer the project from
  599. // the account.
  600. string name = 1;
  601. }
  602. message UndeleteServiceAccountResponse {
  603. // Metadata for the restored service account.
  604. ServiceAccount restored_account = 1;
  605. }
  606. // The service account enable request.
  607. message EnableServiceAccountRequest {
  608. // The resource name of the service account in the following format:
  609. // `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`.
  610. // Using `-` as a wildcard for the `PROJECT_ID` will infer the project from
  611. // the account. The `ACCOUNT` value can be the `email` address or the
  612. // `unique_id` of the service account.
  613. string name = 1;
  614. }
  615. // The service account disable request.
  616. message DisableServiceAccountRequest {
  617. // The resource name of the service account in the following format:
  618. // `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`.
  619. // Using `-` as a wildcard for the `PROJECT_ID` will infer the project from
  620. // the account. The `ACCOUNT` value can be the `email` address or the
  621. // `unique_id` of the service account.
  622. string name = 1;
  623. }
  624. // The service account keys list request.
  625. message ListServiceAccountKeysRequest {
  626. // `KeyType` filters to selectively retrieve certain varieties
  627. // of keys.
  628. enum KeyType {
  629. // Unspecified key type. The presence of this in the
  630. // message will immediately result in an error.
  631. KEY_TYPE_UNSPECIFIED = 0;
  632. // User-managed keys (managed and rotated by the user).
  633. USER_MANAGED = 1;
  634. // System-managed keys (managed and rotated by Google).
  635. SYSTEM_MANAGED = 2;
  636. }
  637. // Required. The resource name of the service account in the following format:
  638. // `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`.
  639. //
  640. // Using `-` as a wildcard for the `PROJECT_ID`, will infer the project from
  641. // the account. The `ACCOUNT` value can be the `email` address or the
  642. // `unique_id` of the service account.
  643. string name = 1 [
  644. (google.api.field_behavior) = REQUIRED,
  645. (google.api.resource_reference) = {
  646. type: "iam.googleapis.com/ServiceAccount"
  647. }
  648. ];
  649. // Filters the types of keys the user wants to include in the list
  650. // response. Duplicate key types are not allowed. If no key type
  651. // is provided, all keys are returned.
  652. repeated KeyType key_types = 2;
  653. }
  654. // The service account keys list response.
  655. message ListServiceAccountKeysResponse {
  656. // The public keys for the service account.
  657. repeated ServiceAccountKey keys = 1;
  658. }
  659. // The service account key get by id request.
  660. message GetServiceAccountKeyRequest {
  661. // Required. The resource name of the service account key in the following format:
  662. // `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}`.
  663. //
  664. // Using `-` as a wildcard for the `PROJECT_ID` will infer the project from
  665. // the account. The `ACCOUNT` value can be the `email` address or the
  666. // `unique_id` of the service account.
  667. string name = 1 [
  668. (google.api.field_behavior) = REQUIRED,
  669. (google.api.resource_reference) = {
  670. type: "iam.googleapis.com/Key"
  671. }
  672. ];
  673. // Optional. The output format of the public key. The default is `TYPE_NONE`, which
  674. // means that the public key is not returned.
  675. ServiceAccountPublicKeyType public_key_type = 2 [(google.api.field_behavior) = OPTIONAL];
  676. }
  677. // Supported key algorithms.
  678. enum ServiceAccountKeyAlgorithm {
  679. // An unspecified key algorithm.
  680. KEY_ALG_UNSPECIFIED = 0;
  681. // 1k RSA Key.
  682. KEY_ALG_RSA_1024 = 1;
  683. // 2k RSA Key.
  684. KEY_ALG_RSA_2048 = 2;
  685. }
  686. // Supported private key output formats.
  687. enum ServiceAccountPrivateKeyType {
  688. // Unspecified. Equivalent to `TYPE_GOOGLE_CREDENTIALS_FILE`.
  689. TYPE_UNSPECIFIED = 0;
  690. // PKCS12 format.
  691. // The password for the PKCS12 file is `notasecret`.
  692. // For more information, see https://tools.ietf.org/html/rfc7292.
  693. TYPE_PKCS12_FILE = 1;
  694. // Google Credentials File format.
  695. TYPE_GOOGLE_CREDENTIALS_FILE = 2;
  696. }
  697. // Supported public key output formats.
  698. enum ServiceAccountPublicKeyType {
  699. // Do not return the public key.
  700. TYPE_NONE = 0;
  701. // X509 PEM format.
  702. TYPE_X509_PEM_FILE = 1;
  703. // Raw public key.
  704. TYPE_RAW_PUBLIC_KEY = 2;
  705. }
  706. // Service Account Key Origin.
  707. enum ServiceAccountKeyOrigin {
  708. // Unspecified key origin.
  709. ORIGIN_UNSPECIFIED = 0;
  710. // Key is provided by user.
  711. USER_PROVIDED = 1;
  712. // Key is provided by Google.
  713. GOOGLE_PROVIDED = 2;
  714. }
  715. // Represents a service account key.
  716. //
  717. // A service account has two sets of key-pairs: user-managed, and
  718. // system-managed.
  719. //
  720. // User-managed key-pairs can be created and deleted by users. Users are
  721. // responsible for rotating these keys periodically to ensure security of
  722. // their service accounts. Users retain the private key of these key-pairs,
  723. // and Google retains ONLY the public key.
  724. //
  725. // System-managed keys are automatically rotated by Google, and are used for
  726. // signing for a maximum of two weeks. The rotation process is probabilistic,
  727. // and usage of the new key will gradually ramp up and down over the key's
  728. // lifetime.
  729. //
  730. // If you cache the public key set for a service account, we recommend that you
  731. // update the cache every 15 minutes. User-managed keys can be added and removed
  732. // at any time, so it is important to update the cache frequently. For
  733. // Google-managed keys, Google will publish a key at least 6 hours before it is
  734. // first used for signing and will keep publishing it for at least 6 hours after
  735. // it was last used for signing.
  736. //
  737. // Public keys for all service accounts are also published at the OAuth2
  738. // Service Account API.
  739. message ServiceAccountKey {
  740. option (google.api.resource) = {
  741. type: "iam.googleapis.com/Key"
  742. pattern: "projects/{project}/serviceAccounts/{service_account}/keys/{key}"
  743. };
  744. // The resource name of the service account key in the following format
  745. // `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}`.
  746. string name = 1;
  747. // The output format for the private key.
  748. // Only provided in `CreateServiceAccountKey` responses, not
  749. // in `GetServiceAccountKey` or `ListServiceAccountKey` responses.
  750. //
  751. // Google never exposes system-managed private keys, and never retains
  752. // user-managed private keys.
  753. ServiceAccountPrivateKeyType private_key_type = 2;
  754. // Specifies the algorithm (and possibly key size) for the key.
  755. ServiceAccountKeyAlgorithm key_algorithm = 8;
  756. // The private key data. Only provided in `CreateServiceAccountKey`
  757. // responses. Make sure to keep the private key data secure because it
  758. // allows for the assertion of the service account identity.
  759. // When base64 decoded, the private key data can be used to authenticate with
  760. // Google API client libraries and with
  761. // <a href="/sdk/gcloud/reference/auth/activate-service-account">gcloud
  762. // auth activate-service-account</a>.
  763. bytes private_key_data = 3;
  764. // The public key data. Only provided in `GetServiceAccountKey` responses.
  765. bytes public_key_data = 7;
  766. // The key can be used after this timestamp.
  767. google.protobuf.Timestamp valid_after_time = 4;
  768. // The key can be used before this timestamp.
  769. // For system-managed key pairs, this timestamp is the end time for the
  770. // private key signing operation. The public key could still be used
  771. // for verification for a few hours after this time.
  772. google.protobuf.Timestamp valid_before_time = 5;
  773. // The key origin.
  774. ServiceAccountKeyOrigin key_origin = 9;
  775. // The key type.
  776. ListServiceAccountKeysRequest.KeyType key_type = 10;
  777. // The key status.
  778. bool disabled = 11;
  779. }
  780. // The service account key create request.
  781. message CreateServiceAccountKeyRequest {
  782. // Required. The resource name of the service account in the following format:
  783. // `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`.
  784. // Using `-` as a wildcard for the `PROJECT_ID` will infer the project from
  785. // the account. The `ACCOUNT` value can be the `email` address or the
  786. // `unique_id` of the service account.
  787. string name = 1 [
  788. (google.api.field_behavior) = REQUIRED,
  789. (google.api.resource_reference) = {
  790. type: "iam.googleapis.com/ServiceAccount"
  791. }
  792. ];
  793. // The output format of the private key. The default value is
  794. // `TYPE_GOOGLE_CREDENTIALS_FILE`, which is the Google Credentials File
  795. // format.
  796. ServiceAccountPrivateKeyType private_key_type = 2;
  797. // Which type of key and algorithm to use for the key.
  798. // The default is currently a 2K RSA key. However this may change in the
  799. // future.
  800. ServiceAccountKeyAlgorithm key_algorithm = 3;
  801. }
  802. // The service account key upload request.
  803. message UploadServiceAccountKeyRequest {
  804. // The resource name of the service account in the following format:
  805. // `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`.
  806. // Using `-` as a wildcard for the `PROJECT_ID` will infer the project from
  807. // the account. The `ACCOUNT` value can be the `email` address or the
  808. // `unique_id` of the service account.
  809. string name = 1;
  810. // The public key to associate with the service account. Must be an RSA public
  811. // key that is wrapped in an X.509 v3 certificate. Include the first line,
  812. // `-----BEGIN CERTIFICATE-----`, and the last line,
  813. // `-----END CERTIFICATE-----`.
  814. bytes public_key_data = 2;
  815. }
  816. // The service account key delete request.
  817. message DeleteServiceAccountKeyRequest {
  818. // Required. The resource name of the service account key in the following format:
  819. // `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}`.
  820. // Using `-` as a wildcard for the `PROJECT_ID` will infer the project from
  821. // the account. The `ACCOUNT` value can be the `email` address or the
  822. // `unique_id` of the service account.
  823. string name = 1 [
  824. (google.api.field_behavior) = REQUIRED,
  825. (google.api.resource_reference) = {
  826. type: "iam.googleapis.com/Key"
  827. }
  828. ];
  829. }
  830. // The service account key disable request.
  831. message DisableServiceAccountKeyRequest {
  832. // Required. The resource name of the service account key in the following format:
  833. // `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}`.
  834. //
  835. // Using `-` as a wildcard for the `PROJECT_ID` will infer the project from
  836. // the account. The `ACCOUNT` value can be the `email` address or the
  837. // `unique_id` of the service account.
  838. string name = 1 [
  839. (google.api.field_behavior) = REQUIRED,
  840. (google.api.resource_reference) = {
  841. type: "iam.googleapis.com/Key"
  842. }
  843. ];
  844. }
  845. // The service account key enable request.
  846. message EnableServiceAccountKeyRequest {
  847. // Required. The resource name of the service account key in the following format:
  848. // `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}`.
  849. //
  850. // Using `-` as a wildcard for the `PROJECT_ID` will infer the project from
  851. // the account. The `ACCOUNT` value can be the `email` address or the
  852. // `unique_id` of the service account.
  853. string name = 1 [
  854. (google.api.field_behavior) = REQUIRED,
  855. (google.api.resource_reference) = {
  856. type: "iam.googleapis.com/Key"
  857. }
  858. ];
  859. }
  860. // Deprecated. [Migrate to Service Account Credentials
  861. // API](https://cloud.google.com/iam/help/credentials/migrate-api).
  862. //
  863. // The service account sign blob request.
  864. message SignBlobRequest {
  865. // Required. Deprecated. [Migrate to Service Account Credentials
  866. // API](https://cloud.google.com/iam/help/credentials/migrate-api).
  867. //
  868. // The resource name of the service account in the following format:
  869. // `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`.
  870. // Using `-` as a wildcard for the `PROJECT_ID` will infer the project from
  871. // the account. The `ACCOUNT` value can be the `email` address or the
  872. // `unique_id` of the service account.
  873. string name = 1 [
  874. deprecated = true,
  875. (google.api.field_behavior) = REQUIRED,
  876. (google.api.resource_reference) = {
  877. type: "iam.googleapis.com/ServiceAccount"
  878. }
  879. ];
  880. // Required. Deprecated. [Migrate to Service Account Credentials
  881. // API](https://cloud.google.com/iam/help/credentials/migrate-api).
  882. //
  883. // The bytes to sign.
  884. bytes bytes_to_sign = 2 [
  885. deprecated = true,
  886. (google.api.field_behavior) = REQUIRED
  887. ];
  888. }
  889. // Deprecated. [Migrate to Service Account Credentials
  890. // API](https://cloud.google.com/iam/help/credentials/migrate-api).
  891. //
  892. // The service account sign blob response.
  893. message SignBlobResponse {
  894. // Deprecated. [Migrate to Service Account Credentials
  895. // API](https://cloud.google.com/iam/help/credentials/migrate-api).
  896. //
  897. // The id of the key used to sign the blob.
  898. string key_id = 1 [deprecated = true];
  899. // Deprecated. [Migrate to Service Account Credentials
  900. // API](https://cloud.google.com/iam/help/credentials/migrate-api).
  901. //
  902. // The signed blob.
  903. bytes signature = 2 [deprecated = true];
  904. }
  905. // Deprecated. [Migrate to Service Account Credentials
  906. // API](https://cloud.google.com/iam/help/credentials/migrate-api).
  907. //
  908. // The service account sign JWT request.
  909. message SignJwtRequest {
  910. // Required. Deprecated. [Migrate to Service Account Credentials
  911. // API](https://cloud.google.com/iam/help/credentials/migrate-api).
  912. //
  913. // The resource name of the service account in the following format:
  914. // `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`.
  915. // Using `-` as a wildcard for the `PROJECT_ID` will infer the project from
  916. // the account. The `ACCOUNT` value can be the `email` address or the
  917. // `unique_id` of the service account.
  918. string name = 1 [
  919. deprecated = true,
  920. (google.api.field_behavior) = REQUIRED,
  921. (google.api.resource_reference) = {
  922. type: "iam.googleapis.com/ServiceAccount"
  923. }
  924. ];
  925. // Required. Deprecated. [Migrate to Service Account Credentials
  926. // API](https://cloud.google.com/iam/help/credentials/migrate-api).
  927. //
  928. // The JWT payload to sign. Must be a serialized JSON object that contains a
  929. // JWT Claims Set. For example: `{"sub": "user@example.com", "iat": 313435}`
  930. //
  931. // If the JWT Claims Set contains an expiration time (`exp`) claim, it must be
  932. // an integer timestamp that is not in the past and no more than 12 hours in
  933. // the future.
  934. //
  935. // If the JWT Claims Set does not contain an expiration time (`exp`) claim,
  936. // this claim is added automatically, with a timestamp that is 1 hour in the
  937. // future.
  938. string payload = 2 [
  939. deprecated = true,
  940. (google.api.field_behavior) = REQUIRED
  941. ];
  942. }
  943. // Deprecated. [Migrate to Service Account Credentials
  944. // API](https://cloud.google.com/iam/help/credentials/migrate-api).
  945. //
  946. // The service account sign JWT response.
  947. message SignJwtResponse {
  948. // Deprecated. [Migrate to Service Account Credentials
  949. // API](https://cloud.google.com/iam/help/credentials/migrate-api).
  950. //
  951. // The id of the key used to sign the JWT.
  952. string key_id = 1 [deprecated = true];
  953. // Deprecated. [Migrate to Service Account Credentials
  954. // API](https://cloud.google.com/iam/help/credentials/migrate-api).
  955. //
  956. // The signed JWT.
  957. string signed_jwt = 2 [deprecated = true];
  958. }
  959. // A role in the Identity and Access Management API.
  960. message Role {
  961. // A stage representing a role's lifecycle phase.
  962. enum RoleLaunchStage {
  963. // The user has indicated this role is currently in an Alpha phase. If this
  964. // launch stage is selected, the `stage` field will not be included when
  965. // requesting the definition for a given role.
  966. ALPHA = 0;
  967. // The user has indicated this role is currently in a Beta phase.
  968. BETA = 1;
  969. // The user has indicated this role is generally available.
  970. GA = 2;
  971. // The user has indicated this role is being deprecated.
  972. DEPRECATED = 4;
  973. // This role is disabled and will not contribute permissions to any
  974. // principals it is granted to in policies.
  975. DISABLED = 5;
  976. // The user has indicated this role is currently in an EAP phase.
  977. EAP = 6;
  978. }
  979. // The name of the role.
  980. //
  981. // When Role is used in CreateRole, the role name must not be set.
  982. //
  983. // When Role is used in output and other input such as UpdateRole, the role
  984. // name is the complete path, e.g., roles/logging.viewer for predefined roles
  985. // and organizations/{ORGANIZATION_ID}/roles/logging.viewer for custom roles.
  986. string name = 1;
  987. // Optional. A human-readable title for the role. Typically this
  988. // is limited to 100 UTF-8 bytes.
  989. string title = 2;
  990. // Optional. A human-readable description for the role.
  991. string description = 3;
  992. // The names of the permissions this role grants when bound in an IAM policy.
  993. repeated string included_permissions = 7;
  994. // The current launch stage of the role. If the `ALPHA` launch stage has been
  995. // selected for a role, the `stage` field will not be included in the
  996. // returned definition for the role.
  997. RoleLaunchStage stage = 8;
  998. // Used to perform a consistent read-modify-write.
  999. bytes etag = 9;
  1000. // The current deleted state of the role. This field is read only.
  1001. // It will be ignored in calls to CreateRole and UpdateRole.
  1002. bool deleted = 11;
  1003. }
  1004. // The grantable role query request.
  1005. message QueryGrantableRolesRequest {
  1006. // Required. The full resource name to query from the list of grantable roles.
  1007. //
  1008. // The name follows the Google Cloud Platform resource format.
  1009. // For example, a Cloud Platform project with id `my-project` will be named
  1010. // `//cloudresourcemanager.googleapis.com/projects/my-project`.
  1011. string full_resource_name = 1 [(google.api.field_behavior) = REQUIRED];
  1012. RoleView view = 2;
  1013. // Optional limit on the number of roles to include in the response.
  1014. //
  1015. // The default is 300, and the maximum is 1,000.
  1016. int32 page_size = 3;
  1017. // Optional pagination token returned in an earlier
  1018. // QueryGrantableRolesResponse.
  1019. string page_token = 4;
  1020. }
  1021. // The grantable role query response.
  1022. message QueryGrantableRolesResponse {
  1023. // The list of matching roles.
  1024. repeated Role roles = 1;
  1025. // To retrieve the next page of results, set
  1026. // `QueryGrantableRolesRequest.page_token` to this value.
  1027. string next_page_token = 2;
  1028. }
  1029. // A view for Role objects.
  1030. enum RoleView {
  1031. // Omits the `included_permissions` field.
  1032. // This is the default value.
  1033. BASIC = 0;
  1034. // Returns all fields.
  1035. FULL = 1;
  1036. }
  1037. // The request to get all roles defined under a resource.
  1038. message ListRolesRequest {
  1039. // The `parent` parameter's value depends on the target resource for the
  1040. // request, namely
  1041. // [`roles`](https://cloud.google.com/iam/reference/rest/v1/roles),
  1042. // [`projects`](https://cloud.google.com/iam/reference/rest/v1/projects.roles),
  1043. // or
  1044. // [`organizations`](https://cloud.google.com/iam/reference/rest/v1/organizations.roles).
  1045. // Each resource type's `parent` value format is described below:
  1046. //
  1047. // * [`roles.list()`](https://cloud.google.com/iam/reference/rest/v1/roles/list): An empty string.
  1048. // This method doesn't require a resource; it simply returns all
  1049. // [predefined
  1050. // roles](https://cloud.google.com/iam/docs/understanding-roles#predefined_roles)
  1051. // in Cloud IAM. Example request URL: `https://iam.googleapis.com/v1/roles`
  1052. //
  1053. // * [`projects.roles.list()`](https://cloud.google.com/iam/reference/rest/v1/projects.roles/list):
  1054. // `projects/{PROJECT_ID}`. This method lists all project-level
  1055. // [custom
  1056. // roles](https://cloud.google.com/iam/docs/understanding-custom-roles).
  1057. // Example request URL:
  1058. // `https://iam.googleapis.com/v1/projects/{PROJECT_ID}/roles`
  1059. //
  1060. // * [`organizations.roles.list()`](https://cloud.google.com/iam/reference/rest/v1/organizations.roles/list):
  1061. // `organizations/{ORGANIZATION_ID}`. This method lists all
  1062. // organization-level [custom
  1063. // roles](https://cloud.google.com/iam/docs/understanding-custom-roles).
  1064. // Example request URL:
  1065. // `https://iam.googleapis.com/v1/organizations/{ORGANIZATION_ID}/roles`
  1066. //
  1067. // Note: Wildcard (*) values are invalid; you must specify a complete project
  1068. // ID or organization ID.
  1069. string parent = 1 [(google.api.resource_reference) = {
  1070. type: "*"
  1071. }];
  1072. // Optional limit on the number of roles to include in the response.
  1073. //
  1074. // The default is 300, and the maximum is 1,000.
  1075. int32 page_size = 2;
  1076. // Optional pagination token returned in an earlier ListRolesResponse.
  1077. string page_token = 3;
  1078. // Optional view for the returned Role objects. When `FULL` is specified,
  1079. // the `includedPermissions` field is returned, which includes a list of all
  1080. // permissions in the role. The default value is `BASIC`, which does not
  1081. // return the `includedPermissions` field.
  1082. RoleView view = 4;
  1083. // Include Roles that have been deleted.
  1084. bool show_deleted = 6;
  1085. }
  1086. // The response containing the roles defined under a resource.
  1087. message ListRolesResponse {
  1088. // The Roles defined on this resource.
  1089. repeated Role roles = 1;
  1090. // To retrieve the next page of results, set
  1091. // `ListRolesRequest.page_token` to this value.
  1092. string next_page_token = 2;
  1093. }
  1094. // The request to get the definition of an existing role.
  1095. message GetRoleRequest {
  1096. // The `name` parameter's value depends on the target resource for the
  1097. // request, namely
  1098. // [`roles`](https://cloud.google.com/iam/reference/rest/v1/roles),
  1099. // [`projects`](https://cloud.google.com/iam/reference/rest/v1/projects.roles),
  1100. // or
  1101. // [`organizations`](https://cloud.google.com/iam/reference/rest/v1/organizations.roles).
  1102. // Each resource type's `name` value format is described below:
  1103. //
  1104. // * [`roles.get()`](https://cloud.google.com/iam/reference/rest/v1/roles/get): `roles/{ROLE_NAME}`.
  1105. // This method returns results from all
  1106. // [predefined
  1107. // roles](https://cloud.google.com/iam/docs/understanding-roles#predefined_roles)
  1108. // in Cloud IAM. Example request URL:
  1109. // `https://iam.googleapis.com/v1/roles/{ROLE_NAME}`
  1110. //
  1111. // * [`projects.roles.get()`](https://cloud.google.com/iam/reference/rest/v1/projects.roles/get):
  1112. // `projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}`. This method returns only
  1113. // [custom
  1114. // roles](https://cloud.google.com/iam/docs/understanding-custom-roles) that
  1115. // have been created at the project level. Example request URL:
  1116. // `https://iam.googleapis.com/v1/projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}`
  1117. //
  1118. // * [`organizations.roles.get()`](https://cloud.google.com/iam/reference/rest/v1/organizations.roles/get):
  1119. // `organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}`. This method
  1120. // returns only [custom
  1121. // roles](https://cloud.google.com/iam/docs/understanding-custom-roles) that
  1122. // have been created at the organization level. Example request URL:
  1123. // `https://iam.googleapis.com/v1/organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}`
  1124. //
  1125. // Note: Wildcard (*) values are invalid; you must specify a complete project
  1126. // ID or organization ID.
  1127. string name = 1 [(google.api.resource_reference) = {
  1128. type: "*"
  1129. }];
  1130. }
  1131. // The request to create a new role.
  1132. message CreateRoleRequest {
  1133. // The `parent` parameter's value depends on the target resource for the
  1134. // request, namely
  1135. // [`projects`](https://cloud.google.com/iam/reference/rest/v1/projects.roles)
  1136. // or
  1137. // [`organizations`](https://cloud.google.com/iam/reference/rest/v1/organizations.roles).
  1138. // Each resource type's `parent` value format is described below:
  1139. //
  1140. // * [`projects.roles.create()`](https://cloud.google.com/iam/reference/rest/v1/projects.roles/create):
  1141. // `projects/{PROJECT_ID}`. This method creates project-level
  1142. // [custom
  1143. // roles](https://cloud.google.com/iam/docs/understanding-custom-roles).
  1144. // Example request URL:
  1145. // `https://iam.googleapis.com/v1/projects/{PROJECT_ID}/roles`
  1146. //
  1147. // * [`organizations.roles.create()`](https://cloud.google.com/iam/reference/rest/v1/organizations.roles/create):
  1148. // `organizations/{ORGANIZATION_ID}`. This method creates organization-level
  1149. // [custom
  1150. // roles](https://cloud.google.com/iam/docs/understanding-custom-roles).
  1151. // Example request URL:
  1152. // `https://iam.googleapis.com/v1/organizations/{ORGANIZATION_ID}/roles`
  1153. //
  1154. // Note: Wildcard (*) values are invalid; you must specify a complete project
  1155. // ID or organization ID.
  1156. string parent = 1 [(google.api.resource_reference) = {
  1157. type: "*"
  1158. }];
  1159. // The role ID to use for this role.
  1160. //
  1161. // A role ID may contain alphanumeric characters, underscores (`_`), and
  1162. // periods (`.`). It must contain a minimum of 3 characters and a maximum of
  1163. // 64 characters.
  1164. string role_id = 2;
  1165. // The Role resource to create.
  1166. Role role = 3;
  1167. }
  1168. // The request to update a role.
  1169. message UpdateRoleRequest {
  1170. // The `name` parameter's value depends on the target resource for the
  1171. // request, namely
  1172. // [`projects`](https://cloud.google.com/iam/reference/rest/v1/projects.roles)
  1173. // or
  1174. // [`organizations`](https://cloud.google.com/iam/reference/rest/v1/organizations.roles).
  1175. // Each resource type's `name` value format is described below:
  1176. //
  1177. // * [`projects.roles.patch()`](https://cloud.google.com/iam/reference/rest/v1/projects.roles/patch):
  1178. // `projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}`. This method updates only
  1179. // [custom
  1180. // roles](https://cloud.google.com/iam/docs/understanding-custom-roles) that
  1181. // have been created at the project level. Example request URL:
  1182. // `https://iam.googleapis.com/v1/projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}`
  1183. //
  1184. // * [`organizations.roles.patch()`](https://cloud.google.com/iam/reference/rest/v1/organizations.roles/patch):
  1185. // `organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}`. This method
  1186. // updates only [custom
  1187. // roles](https://cloud.google.com/iam/docs/understanding-custom-roles) that
  1188. // have been created at the organization level. Example request URL:
  1189. // `https://iam.googleapis.com/v1/organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}`
  1190. //
  1191. // Note: Wildcard (*) values are invalid; you must specify a complete project
  1192. // ID or organization ID.
  1193. string name = 1 [(google.api.resource_reference) = {
  1194. type: "*"
  1195. }];
  1196. // The updated role.
  1197. Role role = 2;
  1198. // A mask describing which fields in the Role have changed.
  1199. google.protobuf.FieldMask update_mask = 3;
  1200. }
  1201. // The request to delete an existing role.
  1202. message DeleteRoleRequest {
  1203. // The `name` parameter's value depends on the target resource for the
  1204. // request, namely
  1205. // [`projects`](https://cloud.google.com/iam/reference/rest/v1/projects.roles)
  1206. // or
  1207. // [`organizations`](https://cloud.google.com/iam/reference/rest/v1/organizations.roles).
  1208. // Each resource type's `name` value format is described below:
  1209. //
  1210. // * [`projects.roles.delete()`](https://cloud.google.com/iam/reference/rest/v1/projects.roles/delete):
  1211. // `projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}`. This method deletes only
  1212. // [custom
  1213. // roles](https://cloud.google.com/iam/docs/understanding-custom-roles) that
  1214. // have been created at the project level. Example request URL:
  1215. // `https://iam.googleapis.com/v1/projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}`
  1216. //
  1217. // * [`organizations.roles.delete()`](https://cloud.google.com/iam/reference/rest/v1/organizations.roles/delete):
  1218. // `organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}`. This method
  1219. // deletes only [custom
  1220. // roles](https://cloud.google.com/iam/docs/understanding-custom-roles) that
  1221. // have been created at the organization level. Example request URL:
  1222. // `https://iam.googleapis.com/v1/organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}`
  1223. //
  1224. // Note: Wildcard (*) values are invalid; you must specify a complete project
  1225. // ID or organization ID.
  1226. string name = 1 [(google.api.resource_reference) = {
  1227. type: "*"
  1228. }];
  1229. // Used to perform a consistent read-modify-write.
  1230. bytes etag = 2;
  1231. }
  1232. // The request to undelete an existing role.
  1233. message UndeleteRoleRequest {
  1234. // The `name` parameter's value depends on the target resource for the
  1235. // request, namely
  1236. // [`projects`](https://cloud.google.com/iam/reference/rest/v1/projects.roles)
  1237. // or
  1238. // [`organizations`](https://cloud.google.com/iam/reference/rest/v1/organizations.roles).
  1239. // Each resource type's `name` value format is described below:
  1240. //
  1241. // * [`projects.roles.undelete()`](https://cloud.google.com/iam/reference/rest/v1/projects.roles/undelete):
  1242. // `projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}`. This method undeletes
  1243. // only [custom
  1244. // roles](https://cloud.google.com/iam/docs/understanding-custom-roles) that
  1245. // have been created at the project level. Example request URL:
  1246. // `https://iam.googleapis.com/v1/projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}`
  1247. //
  1248. // * [`organizations.roles.undelete()`](https://cloud.google.com/iam/reference/rest/v1/organizations.roles/undelete):
  1249. // `organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}`. This method
  1250. // undeletes only [custom
  1251. // roles](https://cloud.google.com/iam/docs/understanding-custom-roles) that
  1252. // have been created at the organization level. Example request URL:
  1253. // `https://iam.googleapis.com/v1/organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}`
  1254. //
  1255. // Note: Wildcard (*) values are invalid; you must specify a complete project
  1256. // ID or organization ID.
  1257. string name = 1 [(google.api.resource_reference) = {
  1258. type: "*"
  1259. }];
  1260. // Used to perform a consistent read-modify-write.
  1261. bytes etag = 2;
  1262. }
  1263. // A permission which can be included by a role.
  1264. message Permission {
  1265. // A stage representing a permission's lifecycle phase.
  1266. enum PermissionLaunchStage {
  1267. // The permission is currently in an alpha phase.
  1268. ALPHA = 0;
  1269. // The permission is currently in a beta phase.
  1270. BETA = 1;
  1271. // The permission is generally available.
  1272. GA = 2;
  1273. // The permission is being deprecated.
  1274. DEPRECATED = 3;
  1275. }
  1276. // The state of the permission with regards to custom roles.
  1277. enum CustomRolesSupportLevel {
  1278. // Default state. Permission is fully supported for custom role use.
  1279. SUPPORTED = 0;
  1280. // Permission is being tested to check custom role compatibility.
  1281. TESTING = 1;
  1282. // Permission is not supported for custom role use.
  1283. NOT_SUPPORTED = 2;
  1284. }
  1285. // The name of this Permission.
  1286. string name = 1;
  1287. // The title of this Permission.
  1288. string title = 2;
  1289. // A brief description of what this Permission is used for.
  1290. // This permission can ONLY be used in predefined roles.
  1291. string description = 3;
  1292. bool only_in_predefined_roles = 4 [deprecated = true];
  1293. // The current launch stage of the permission.
  1294. PermissionLaunchStage stage = 5;
  1295. // The current custom role support level.
  1296. CustomRolesSupportLevel custom_roles_support_level = 6;
  1297. // The service API associated with the permission is not enabled.
  1298. bool api_disabled = 7;
  1299. // The preferred name for this permission. If present, then this permission is
  1300. // an alias of, and equivalent to, the listed primary_permission.
  1301. string primary_permission = 8;
  1302. }
  1303. // A request to get permissions which can be tested on a resource.
  1304. message QueryTestablePermissionsRequest {
  1305. // Required. The full resource name to query from the list of testable
  1306. // permissions.
  1307. //
  1308. // The name follows the Google Cloud Platform resource format.
  1309. // For example, a Cloud Platform project with id `my-project` will be named
  1310. // `//cloudresourcemanager.googleapis.com/projects/my-project`.
  1311. string full_resource_name = 1;
  1312. // Optional limit on the number of permissions to include in the response.
  1313. //
  1314. // The default is 100, and the maximum is 1,000.
  1315. int32 page_size = 2;
  1316. // Optional pagination token returned in an earlier
  1317. // QueryTestablePermissionsRequest.
  1318. string page_token = 3;
  1319. }
  1320. // The response containing permissions which can be tested on a resource.
  1321. message QueryTestablePermissionsResponse {
  1322. // The Permissions testable on the requested resource.
  1323. repeated Permission permissions = 1;
  1324. // To retrieve the next page of results, set
  1325. // `QueryTestableRolesRequest.page_token` to this value.
  1326. string next_page_token = 2;
  1327. }
  1328. // A request to get the list of auditable services for a resource.
  1329. message QueryAuditableServicesRequest {
  1330. // Required. The full resource name to query from the list of auditable
  1331. // services.
  1332. //
  1333. // The name follows the Google Cloud Platform resource format.
  1334. // For example, a Cloud Platform project with id `my-project` will be named
  1335. // `//cloudresourcemanager.googleapis.com/projects/my-project`.
  1336. string full_resource_name = 1;
  1337. }
  1338. // A response containing a list of auditable services for a resource.
  1339. message QueryAuditableServicesResponse {
  1340. // Contains information about an auditable service.
  1341. message AuditableService {
  1342. // Public name of the service.
  1343. // For example, the service name for Cloud IAM is 'iam.googleapis.com'.
  1344. string name = 1;
  1345. }
  1346. // The auditable services for a resource.
  1347. repeated AuditableService services = 1;
  1348. }
  1349. // The request to lint a Cloud IAM policy object.
  1350. message LintPolicyRequest {
  1351. // The full resource name of the policy this lint request is about.
  1352. //
  1353. // The name follows the Google Cloud Platform (GCP) resource format.
  1354. // For example, a GCP project with ID `my-project` will be named
  1355. // `//cloudresourcemanager.googleapis.com/projects/my-project`.
  1356. //
  1357. // The resource name is not used to read the policy instance from the Cloud
  1358. // IAM database. The candidate policy for lint has to be provided in the same
  1359. // request object.
  1360. string full_resource_name = 1;
  1361. // Required. The Cloud IAM object to be linted.
  1362. oneof lint_object {
  1363. // [google.iam.v1.Binding.condition] [google.iam.v1.Binding.condition] object to be linted.
  1364. google.type.Expr condition = 5;
  1365. }
  1366. }
  1367. // Structured response of a single validation unit.
  1368. message LintResult {
  1369. // Possible Level values of a validation unit corresponding to its domain
  1370. // of discourse.
  1371. enum Level {
  1372. // Level is unspecified.
  1373. LEVEL_UNSPECIFIED = 0;
  1374. // A validation unit which operates on an individual condition within a
  1375. // binding.
  1376. CONDITION = 3;
  1377. }
  1378. // Possible Severity values of an issued result.
  1379. enum Severity {
  1380. // Severity is unspecified.
  1381. SEVERITY_UNSPECIFIED = 0;
  1382. // A validation unit returns an error only for critical issues. If an
  1383. // attempt is made to set the problematic policy without rectifying the
  1384. // critical issue, it causes the `setPolicy` operation to fail.
  1385. ERROR = 1;
  1386. // Any issue which is severe enough but does not cause an error.
  1387. // For example, suspicious constructs in the input object will not
  1388. // necessarily fail `setPolicy`, but there is a high likelihood that they
  1389. // won't behave as expected during policy evaluation in `checkPolicy`.
  1390. // This includes the following common scenarios:
  1391. //
  1392. // - Unsatisfiable condition: Expired timestamp in date/time condition.
  1393. // - Ineffective condition: Condition on a <principal, role> pair which is
  1394. // granted unconditionally in another binding of the same policy.
  1395. WARNING = 2;
  1396. // Reserved for the issues that are not severe as `ERROR`/`WARNING`, but
  1397. // need special handling. For instance, messages about skipped validation
  1398. // units are issued as `NOTICE`.
  1399. NOTICE = 3;
  1400. // Any informative statement which is not severe enough to raise
  1401. // `ERROR`/`WARNING`/`NOTICE`, like auto-correction recommendations on the
  1402. // input content. Note that current version of the linter does not utilize
  1403. // `INFO`.
  1404. INFO = 4;
  1405. // Deprecated severity level.
  1406. DEPRECATED = 5;
  1407. }
  1408. // The validation unit level.
  1409. Level level = 1;
  1410. // The validation unit name, for instance
  1411. // "lintValidationUnits/ConditionComplexityCheck".
  1412. string validation_unit_name = 2;
  1413. // The validation unit severity.
  1414. Severity severity = 3;
  1415. // The name of the field for which this lint result is about.
  1416. //
  1417. // For nested messages `field_name` consists of names of the embedded fields
  1418. // separated by period character. The top-level qualifier is the input object
  1419. // to lint in the request. For example, the `field_name` value
  1420. // `condition.expression` identifies a lint result for the `expression` field
  1421. // of the provided condition.
  1422. string field_name = 5;
  1423. // 0-based character position of problematic construct within the object
  1424. // identified by `field_name`. Currently, this is populated only for condition
  1425. // expression.
  1426. int32 location_offset = 6;
  1427. // Human readable debug message associated with the issue.
  1428. string debug_message = 7;
  1429. }
  1430. // The response of a lint operation. An empty response indicates
  1431. // the operation was able to fully execute and no lint issue was found.
  1432. message LintPolicyResponse {
  1433. // List of lint results sorted by `severity` in descending order.
  1434. repeated LintResult lint_results = 1;
  1435. }