iamcredentials.proto 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. // Copyright 2020 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.iam.credentials.v1;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/iam/credentials/v1/common.proto";
  19. option cc_enable_arenas = true;
  20. option csharp_namespace = "Google.Cloud.Iam.Credentials.V1";
  21. option go_package = "google.golang.org/genproto/googleapis/iam/credentials/v1;credentials";
  22. option java_multiple_files = true;
  23. option java_outer_classname = "IAMCredentialsProto";
  24. option java_package = "com.google.cloud.iam.credentials.v1";
  25. option php_namespace = "Google\\Cloud\\Iam\\Credentials\\V1";
  26. // A service account is a special type of Google account that belongs to your
  27. // application or a virtual machine (VM), instead of to an individual end user.
  28. // Your application assumes the identity of the service account to call Google
  29. // APIs, so that the users aren't directly involved.
  30. //
  31. // Service account credentials are used to temporarily assume the identity
  32. // of the service account. Supported credential types include OAuth 2.0 access
  33. // tokens, OpenID Connect ID tokens, self-signed JSON Web Tokens (JWTs), and
  34. // more.
  35. service IAMCredentials {
  36. option (google.api.default_host) = "iamcredentials.googleapis.com";
  37. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
  38. // Generates an OAuth 2.0 access token for a service account.
  39. rpc GenerateAccessToken(GenerateAccessTokenRequest) returns (GenerateAccessTokenResponse) {
  40. option (google.api.http) = {
  41. post: "/v1/{name=projects/*/serviceAccounts/*}:generateAccessToken"
  42. body: "*"
  43. };
  44. option (google.api.method_signature) = "name,delegates,scope,lifetime";
  45. }
  46. // Generates an OpenID Connect ID token for a service account.
  47. rpc GenerateIdToken(GenerateIdTokenRequest) returns (GenerateIdTokenResponse) {
  48. option (google.api.http) = {
  49. post: "/v1/{name=projects/*/serviceAccounts/*}:generateIdToken"
  50. body: "*"
  51. };
  52. option (google.api.method_signature) = "name,delegates,audience,include_email";
  53. }
  54. // Signs a blob using a service account's system-managed private key.
  55. rpc SignBlob(SignBlobRequest) returns (SignBlobResponse) {
  56. option (google.api.http) = {
  57. post: "/v1/{name=projects/*/serviceAccounts/*}:signBlob"
  58. body: "*"
  59. };
  60. option (google.api.method_signature) = "name,delegates,payload";
  61. }
  62. // Signs a JWT using a service account's system-managed private key.
  63. rpc SignJwt(SignJwtRequest) returns (SignJwtResponse) {
  64. option (google.api.http) = {
  65. post: "/v1/{name=projects/*/serviceAccounts/*}:signJwt"
  66. body: "*"
  67. };
  68. option (google.api.method_signature) = "name,delegates,payload";
  69. }
  70. }