iam.proto 58 KB

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