1 // Copyright 2017 Google Inc.
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
7 // http://www.apache.org/licenses/LICENSE-2.0
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.
17 package google.cloud.oslogin.v1beta;
19 import "google/api/annotations.proto";
20 import "google/cloud/oslogin/common/common.proto";
21 import "google/protobuf/empty.proto";
22 import "google/protobuf/field_mask.proto";
24 option csharp_namespace = "Google.Cloud.OsLogin.V1Beta";
25 option go_package = "google.golang.org/genproto/googleapis/cloud/oslogin/v1beta;oslogin";
26 option java_multiple_files = true;
27 option java_outer_classname = "OsLoginProto";
28 option java_package = "com.google.cloud.oslogin.v1beta";
29 option php_namespace = "Google\\Cloud\\OsLogin\\V1beta";
33 // The Cloud OS Login API allows you to manage users and their associated SSH
34 // public keys for logging into virtual machines on Google Cloud Platform.
35 service OsLoginService {
36 // Deletes a POSIX account.
37 rpc DeletePosixAccount(DeletePosixAccountRequest)
38 returns (google.protobuf.Empty) {
39 option (google.api.http) = {
40 delete: "/v1beta/{name=users/*/projects/*}"
44 // Deletes an SSH public key.
45 rpc DeleteSshPublicKey(DeleteSshPublicKeyRequest)
46 returns (google.protobuf.Empty) {
47 option (google.api.http) = {
48 delete: "/v1beta/{name=users/*/sshPublicKeys/*}"
52 // Retrieves the profile information used for logging in to a virtual machine
53 // on Google Compute Engine.
54 rpc GetLoginProfile(GetLoginProfileRequest) returns (LoginProfile) {
55 option (google.api.http) = {
56 get: "/v1beta/{name=users/*}/loginProfile"
60 // Retrieves an SSH public key.
61 rpc GetSshPublicKey(GetSshPublicKeyRequest)
62 returns (google.cloud.oslogin.common.SshPublicKey) {
63 option (google.api.http) = {
64 get: "/v1beta/{name=users/*/sshPublicKeys/*}"
68 // Adds an SSH public key and returns the profile information. Default POSIX
69 // account information is set when no username and UID exist as part of the
71 rpc ImportSshPublicKey(ImportSshPublicKeyRequest)
72 returns (ImportSshPublicKeyResponse) {
73 option (google.api.http) = {
74 post: "/v1beta/{parent=users/*}:importSshPublicKey"
75 body: "ssh_public_key"
79 // Updates an SSH public key and returns the profile information. This method
80 // supports patch semantics.
81 rpc UpdateSshPublicKey(UpdateSshPublicKeyRequest)
82 returns (google.cloud.oslogin.common.SshPublicKey) {
83 option (google.api.http) = {
84 patch: "/v1beta/{name=users/*/sshPublicKeys/*}"
85 body: "ssh_public_key"
90 // The user profile information used for logging in to a virtual machine on
91 // Google Compute Engine.
92 message LoginProfile {
93 // The primary email address that uniquely identifies the user.
96 // The list of POSIX accounts associated with the user.
97 repeated google.cloud.oslogin.common.PosixAccount posix_accounts = 2;
99 // A map from SSH public key fingerprint to the associated key object.
100 map<string, google.cloud.oslogin.common.SshPublicKey> ssh_public_keys = 3;
102 // Indicates if the user is suspended. A suspended user cannot log in but
103 // their profile information is retained.
107 // A request message for deleting a POSIX account entry.
108 message DeletePosixAccountRequest {
109 // A reference to the POSIX account to update. POSIX accounts are identified
110 // by the project ID they are associated with. A reference to the POSIX
111 // account is in format `users/{user}/projects/{project}`.
115 // A request message for deleting an SSH public key.
116 message DeleteSshPublicKeyRequest {
117 // The fingerprint of the public key to update. Public keys are identified by
118 // their SHA-256 fingerprint. The fingerprint of the public key is in format
119 // `users/{user}/sshPublicKeys/{fingerprint}`.
123 // A request message for retrieving the login profile information for a user.
124 message GetLoginProfileRequest {
125 // The unique ID for the user in format `users/{user}`.
129 // A request message for retrieving an SSH public key.
130 message GetSshPublicKeyRequest {
131 // The fingerprint of the public key to retrieve. Public keys are identified
132 // by their SHA-256 fingerprint. The fingerprint of the public key is in
133 // format `users/{user}/sshPublicKeys/{fingerprint}`.
137 // A request message for importing an SSH public key.
138 message ImportSshPublicKeyRequest {
139 // The unique ID for the user in format `users/{user}`.
142 // The SSH public key and expiration time.
143 google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2;
145 // The project ID of the Google Cloud Platform project.
146 string project_id = 3;
149 // A response message for importing an SSH public key.
150 message ImportSshPublicKeyResponse {
151 // The login profile information for the user.
152 LoginProfile login_profile = 1;
155 // A request message for updating an SSH public key.
156 message UpdateSshPublicKeyRequest {
157 // The fingerprint of the public key to update. Public keys are identified by
158 // their SHA-256 fingerprint. The fingerprint of the public key is in format
159 // `users/{user}/sshPublicKeys/{fingerprint}`.
162 // The SSH public key and expiration time.
163 google.cloud.oslogin.common.SshPublicKey ssh_public_key = 2;
165 // Mask to control which fields get updated. Updates all if not present.
166 google.protobuf.FieldMask update_mask = 3;