oslogin.proto 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. // Copyright 2017 Google Inc.
  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.cloud.oslogin.v1alpha;
  16. import "google/api/annotations.proto";
  17. import "google/cloud/oslogin/common/common.proto";
  18. import "google/protobuf/empty.proto";
  19. import "google/protobuf/field_mask.proto";
  20. option csharp_namespace = "Google.Cloud.OsLogin.V1Alpha";
  21. option go_package = "google.golang.org/genproto/googleapis/cloud/oslogin/v1alpha;oslogin";
  22. option java_multiple_files = true;
  23. option java_outer_classname = "OsLoginProto";
  24. option java_package = "com.google.cloud.oslogin.v1alpha";
  25. option php_namespace = "Google\\Cloud\\OsLogin\\V1alpha";
  26. // Cloud OS Login API
  27. //
  28. // The Cloud OS Login API allows you to manage users and their associated SSH
  29. // public keys for logging into virtual machines on Google Cloud Platform.
  30. service OsLoginService {
  31. // Deletes a POSIX account.
  32. rpc DeletePosixAccount(DeletePosixAccountRequest)
  33. returns (google.protobuf.Empty) {
  34. option (google.api.http) = {
  35. delete: "/v1alpha/{name=users/*/projects/*}"
  36. };
  37. }
  38. // Deletes an SSH public key.
  39. rpc DeleteSshPublicKey(DeleteSshPublicKeyRequest)
  40. returns (google.protobuf.Empty) {
  41. option (google.api.http) = {
  42. delete: "/v1alpha/{name=users/*/sshPublicKeys/*}"
  43. };
  44. }
  45. // Retrieves the profile information used for logging in to a virtual machine
  46. // on Google Compute Engine.
  47. rpc GetLoginProfile(GetLoginProfileRequest) returns (LoginProfile) {
  48. option (google.api.http) = {
  49. get: "/v1alpha/{name=users/*}/loginProfile"
  50. };
  51. }
  52. // Retrieves an SSH public key.
  53. rpc GetSshPublicKey(GetSshPublicKeyRequest)
  54. returns (google.cloud.oslogin.common.SshPublicKey) {
  55. option (google.api.http) = {
  56. get: "/v1alpha/{name=users/*/sshPublicKeys/*}"
  57. };
  58. }
  59. // Adds an SSH public key and returns the profile information. Default POSIX
  60. // account information is set when no username and UID exist as part of the
  61. // login profile.
  62. rpc ImportSshPublicKey(ImportSshPublicKeyRequest)
  63. returns (ImportSshPublicKeyResponse) {
  64. option (google.api.http) = {
  65. post: "/v1alpha/{parent=users/*}:importSshPublicKey"
  66. body: "ssh_public_key"
  67. };
  68. }
  69. // Updates an SSH public key and returns the profile information. This method
  70. // supports patch semantics.
  71. rpc UpdateSshPublicKey(UpdateSshPublicKeyRequest)
  72. returns (google.cloud.oslogin.common.SshPublicKey) {
  73. option (google.api.http) = {
  74. patch: "/v1alpha/{name=users/*/sshPublicKeys/*}"
  75. body: "ssh_public_key"
  76. };
  77. }
  78. }
  79. // The user profile information used for logging in to a virtual machine on
  80. // Google Compute Engine.
  81. message LoginProfile {
  82. // A unique user ID for identifying the user.
  83. string name = 1;
  84. // The list of POSIX accounts associated with the Directory API user.
  85. repeated google.cloud.oslogin.common.PosixAccount posix_accounts = 2;
  86. // A map from SSH public key fingerprint to the associated key object.
  87. map<string, google.cloud.oslogin.common.SshPublicKey> ssh_public_keys = 3;
  88. // Indicates if the user is suspended.
  89. bool suspended = 4;
  90. }
  91. // A request message for deleting a POSIX account entry.
  92. message DeletePosixAccountRequest {
  93. // A reference to the POSIX account to update. POSIX accounts are identified
  94. // by the project ID they are associated with. A reference to the POSIX
  95. // account is in format `users/{user}/projects/{project}`.
  96. string name = 1;
  97. }
  98. // A request message for deleting an SSH public key.
  99. message DeleteSshPublicKeyRequest {
  100. // The fingerprint of the public key to update. Public keys are identified by
  101. // their SHA-256 fingerprint. The fingerprint of the public key is in format
  102. // `users/{user}/sshPublicKeys/{fingerprint}`.
  103. string name = 1;
  104. }
  105. // A request message for retrieving the login profile information for a user.
  106. message GetLoginProfileRequest {
  107. // The unique ID for the user in format `users/{user}`.
  108. string name = 1;
  109. }
  110. // A request message for retrieving an SSH public key.
  111. message GetSshPublicKeyRequest {
  112. // The fingerprint of the public key to retrieve. Public keys are identified
  113. // by their SHA-256 fingerprint. The fingerprint of the public key is in
  114. // format `users/{user}/sshPublicKeys/{fingerprint}`.
  115. string name = 1;
  116. }
  117. // A request message for importing an SSH public key.
  118. message ImportSshPublicKeyRequest {
  119. // The unique ID for the user in format `users/{user}`.
  120. string parent = 1;
  121. // The SSH public key and expiration time.
  122. google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2;
  123. // The project ID of the Google Cloud Platform project.
  124. string project_id = 3;
  125. }
  126. // A response message for importing an SSH public key.
  127. message ImportSshPublicKeyResponse {
  128. // The login profile information for the user.
  129. LoginProfile login_profile = 1;
  130. }
  131. // A request message for updating an SSH public key.
  132. message UpdateSshPublicKeyRequest {
  133. // The fingerprint of the public key to update. Public keys are identified by
  134. // their SHA-256 fingerprint. The fingerprint of the public key is in format
  135. // `users/{user}/sshPublicKeys/{fingerprint}`.
  136. string name = 1;
  137. // The SSH public key and expiration time.
  138. google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2;
  139. // Mask to control which fields get updated. Updates all if not present.
  140. google.protobuf.FieldMask update_mask = 3;
  141. }