iamcredentials.proto 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. // A service account is a special type of Google account that belongs to your
  26. // application or a virtual machine (VM), instead of to an individual end user.
  27. // Your application assumes the identity of the service account to call Google
  28. // APIs, so that the users aren't directly involved.
  29. //
  30. // Service account credentials are used to temporarily assume the identity
  31. // of the service account. Supported credential types include OAuth 2.0 access
  32. // tokens, OpenID Connect ID tokens, self-signed JSON Web Tokens (JWTs), and
  33. // more.
  34. service IAMCredentials {
  35. option (google.api.default_host) = "iamcredentials.googleapis.com";
  36. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
  37. // Generates an OAuth 2.0 access token for a service account.
  38. rpc GenerateAccessToken(GenerateAccessTokenRequest) returns (GenerateAccessTokenResponse) {
  39. option (google.api.http) = {
  40. post: "/v1/{name=projects/*/serviceAccounts/*}:generateAccessToken"
  41. body: "*"
  42. };
  43. option (google.api.method_signature) = "name,delegates,scope,lifetime";
  44. }
  45. // Generates an OpenID Connect ID token for a service account.
  46. rpc GenerateIdToken(GenerateIdTokenRequest) returns (GenerateIdTokenResponse) {
  47. option (google.api.http) = {
  48. post: "/v1/{name=projects/*/serviceAccounts/*}:generateIdToken"
  49. body: "*"
  50. };
  51. option (google.api.method_signature) = "name,delegates,audience,include_email";
  52. }
  53. // Signs a blob using a service account's system-managed private key.
  54. rpc SignBlob(SignBlobRequest) returns (SignBlobResponse) {
  55. option (google.api.http) = {
  56. post: "/v1/{name=projects/*/serviceAccounts/*}:signBlob"
  57. body: "*"
  58. };
  59. option (google.api.method_signature) = "name,delegates,payload";
  60. }
  61. // Signs a JWT using a service account's system-managed private key.
  62. rpc SignJwt(SignJwtRequest) returns (SignJwtResponse) {
  63. option (google.api.http) = {
  64. post: "/v1/{name=projects/*/serviceAccounts/*}:signJwt"
  65. body: "*"
  66. };
  67. option (google.api.method_signature) = "name,delegates,payload";
  68. }
  69. }