google-cloud-os_login 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.yardopts +8 -0
- data/LICENSE +201 -0
- data/README.md +31 -0
- data/lib/google/cloud/os_login.rb +107 -0
- data/lib/google/cloud/os_login/credentials.rb +33 -0
- data/lib/google/cloud/os_login/v1beta.rb +100 -0
- data/lib/google/cloud/os_login/v1beta/doc/google/cloud/oslogin/common.rb +66 -0
- data/lib/google/cloud/os_login/v1beta/doc/google/cloud/oslogin/v1beta/oslogin.rb +111 -0
- data/lib/google/cloud/os_login/v1beta/doc/google/protobuf/field_mask.rb +223 -0
- data/lib/google/cloud/os_login/v1beta/doc/overview.rb +54 -0
- data/lib/google/cloud/os_login/v1beta/os_login_service_client.rb +429 -0
- data/lib/google/cloud/os_login/v1beta/os_login_service_client_config.json +56 -0
- data/lib/google/cloud/oslogin/common_pb.rb +35 -0
- data/lib/google/cloud/oslogin/v1beta/oslogin_pb.rb +59 -0
- data/lib/google/cloud/oslogin/v1beta/oslogin_services_pb.rb +62 -0
- metadata +115 -0
@@ -0,0 +1,66 @@
|
|
1
|
+
# Copyright 2017 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
|
+
# https://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
|
+
|
15
|
+
module Google
|
16
|
+
module Cloud
|
17
|
+
module Oslogin
|
18
|
+
module Common
|
19
|
+
# The POSIX account information associated with a Google account.
|
20
|
+
# @!attribute [rw] primary
|
21
|
+
# @return [true, false]
|
22
|
+
# Only one POSIX account can be marked as primary.
|
23
|
+
# @!attribute [rw] username
|
24
|
+
# @return [String]
|
25
|
+
# The username of the POSIX account.
|
26
|
+
# @!attribute [rw] uid
|
27
|
+
# @return [Integer]
|
28
|
+
# The user ID.
|
29
|
+
# @!attribute [rw] gid
|
30
|
+
# @return [Integer]
|
31
|
+
# The default group ID.
|
32
|
+
# @!attribute [rw] home_directory
|
33
|
+
# @return [String]
|
34
|
+
# The path to the home directory for this account.
|
35
|
+
# @!attribute [rw] shell
|
36
|
+
# @return [String]
|
37
|
+
# The path to the logic shell for this account.
|
38
|
+
# @!attribute [rw] gecos
|
39
|
+
# @return [String]
|
40
|
+
# The GECOS (user information) entry for this account.
|
41
|
+
# @!attribute [rw] system_id
|
42
|
+
# @return [String]
|
43
|
+
# System identifier for which account the username or uid applies to.
|
44
|
+
# By default, the empty value is used.
|
45
|
+
# @!attribute [rw] account_id
|
46
|
+
# @return [String]
|
47
|
+
# Output only. A POSIX account identifier.
|
48
|
+
class PosixAccount; end
|
49
|
+
|
50
|
+
# The SSH public key information associated with a Google account.
|
51
|
+
# @!attribute [rw] key
|
52
|
+
# @return [String]
|
53
|
+
# Public key text in SSH format, defined by
|
54
|
+
# <a href="https://www.ietf.org/rfc/rfc4253.txt" target="_blank">RFC4253</a>
|
55
|
+
# section 6.6.
|
56
|
+
# @!attribute [rw] expiration_time_usec
|
57
|
+
# @return [Integer]
|
58
|
+
# An expiration time in microseconds since epoch.
|
59
|
+
# @!attribute [rw] fingerprint
|
60
|
+
# @return [String]
|
61
|
+
# Output only. The SHA-256 fingerprint of the SSH public key.
|
62
|
+
class SshPublicKey; end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
@@ -0,0 +1,111 @@
|
|
1
|
+
# Copyright 2017 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
|
+
# https://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
|
+
|
15
|
+
module Google
|
16
|
+
module Cloud
|
17
|
+
module Oslogin
|
18
|
+
##
|
19
|
+
# # Google Cloud OS Login API Contents
|
20
|
+
#
|
21
|
+
# | Class | Description |
|
22
|
+
# | ----- | ----------- |
|
23
|
+
# | [OsLoginServiceClient][] | Manages OS login configuration for Google account users. |
|
24
|
+
# | [Data Types][] | Data types for Google::Cloud::OsLogin::V1beta |
|
25
|
+
#
|
26
|
+
# [OsLoginServiceClient]: https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-os_login/latest/google/cloud/oslogin/v1beta/osloginserviceclient
|
27
|
+
# [Data Types]: https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud-os_login/latest/google/cloud/oslogin/v1beta/datatypes
|
28
|
+
#
|
29
|
+
module V1beta
|
30
|
+
# The user profile information used for logging in to a virtual machine on
|
31
|
+
# Google Compute Engine.
|
32
|
+
# @!attribute [rw] name
|
33
|
+
# @return [String]
|
34
|
+
# The primary email address that uniquely identifies the user.
|
35
|
+
# @!attribute [rw] posix_accounts
|
36
|
+
# @return [Array<Google::Cloud::Oslogin::Common::PosixAccount>]
|
37
|
+
# The list of POSIX accounts associated with the user.
|
38
|
+
# @!attribute [rw] ssh_public_keys
|
39
|
+
# @return [Hash{String => Google::Cloud::Oslogin::Common::SshPublicKey}]
|
40
|
+
# A map from SSH public key fingerprint to the associated key object.
|
41
|
+
# @!attribute [rw] suspended
|
42
|
+
# @return [true, false]
|
43
|
+
# Indicates if the user is suspended. A suspended user cannot log in but
|
44
|
+
# their profile information is retained.
|
45
|
+
class LoginProfile; end
|
46
|
+
|
47
|
+
# A request message for deleting a POSIX account entry.
|
48
|
+
# @!attribute [rw] name
|
49
|
+
# @return [String]
|
50
|
+
# A reference to the POSIX account to update. POSIX accounts are identified
|
51
|
+
# by the project ID they are associated with. A reference to the POSIX
|
52
|
+
# account is in format +users/{user}/projects/{project}+.
|
53
|
+
class DeletePosixAccountRequest; end
|
54
|
+
|
55
|
+
# A request message for deleting an SSH public key.
|
56
|
+
# @!attribute [rw] name
|
57
|
+
# @return [String]
|
58
|
+
# The fingerprint of the public key to update. Public keys are identified by
|
59
|
+
# their SHA-256 fingerprint. The fingerprint of the public key is in format
|
60
|
+
# +users/{user}/sshPublicKeys/{fingerprint}+.
|
61
|
+
class DeleteSshPublicKeyRequest; end
|
62
|
+
|
63
|
+
# A request message for retrieving the login profile information for a user.
|
64
|
+
# @!attribute [rw] name
|
65
|
+
# @return [String]
|
66
|
+
# The unique ID for the user in format +users/{user}+.
|
67
|
+
class GetLoginProfileRequest; end
|
68
|
+
|
69
|
+
# A request message for retrieving an SSH public key.
|
70
|
+
# @!attribute [rw] name
|
71
|
+
# @return [String]
|
72
|
+
# The fingerprint of the public key to retrieve. Public keys are identified
|
73
|
+
# by their SHA-256 fingerprint. The fingerprint of the public key is in
|
74
|
+
# format +users/{user}/sshPublicKeys/{fingerprint}+.
|
75
|
+
class GetSshPublicKeyRequest; end
|
76
|
+
|
77
|
+
# A request message for importing an SSH public key.
|
78
|
+
# @!attribute [rw] parent
|
79
|
+
# @return [String]
|
80
|
+
# The unique ID for the user in format +users/{user}+.
|
81
|
+
# @!attribute [rw] ssh_public_key
|
82
|
+
# @return [Google::Cloud::Oslogin::Common::SshPublicKey]
|
83
|
+
# The SSH public key and expiration time.
|
84
|
+
# @!attribute [rw] project_id
|
85
|
+
# @return [String]
|
86
|
+
# The project ID of the Google Cloud Platform project.
|
87
|
+
class ImportSshPublicKeyRequest; end
|
88
|
+
|
89
|
+
# A response message for importing an SSH public key.
|
90
|
+
# @!attribute [rw] login_profile
|
91
|
+
# @return [Google::Cloud::Oslogin::V1beta::LoginProfile]
|
92
|
+
# The login profile information for the user.
|
93
|
+
class ImportSshPublicKeyResponse; end
|
94
|
+
|
95
|
+
# A request message for updating an SSH public key.
|
96
|
+
# @!attribute [rw] name
|
97
|
+
# @return [String]
|
98
|
+
# The fingerprint of the public key to update. Public keys are identified by
|
99
|
+
# their SHA-256 fingerprint. The fingerprint of the public key is in format
|
100
|
+
# +users/{user}/sshPublicKeys/{fingerprint}+.
|
101
|
+
# @!attribute [rw] ssh_public_key
|
102
|
+
# @return [Google::Cloud::Oslogin::Common::SshPublicKey]
|
103
|
+
# The SSH public key and expiration time.
|
104
|
+
# @!attribute [rw] update_mask
|
105
|
+
# @return [Google::Protobuf::FieldMask]
|
106
|
+
# Mask to control which fields get updated. Updates all if not present.
|
107
|
+
class UpdateSshPublicKeyRequest; end
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
@@ -0,0 +1,223 @@
|
|
1
|
+
# Copyright 2017 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
|
+
# https://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
|
+
|
15
|
+
module Google
|
16
|
+
module Protobuf
|
17
|
+
# +FieldMask+ represents a set of symbolic field paths, for example:
|
18
|
+
#
|
19
|
+
# paths: "f.a"
|
20
|
+
# paths: "f.b.d"
|
21
|
+
#
|
22
|
+
# Here +f+ represents a field in some root message, +a+ and +b+
|
23
|
+
# fields in the message found in +f+, and +d+ a field found in the
|
24
|
+
# message in +f.b+.
|
25
|
+
#
|
26
|
+
# Field masks are used to specify a subset of fields that should be
|
27
|
+
# returned by a get operation or modified by an update operation.
|
28
|
+
# Field masks also have a custom JSON encoding (see below).
|
29
|
+
#
|
30
|
+
# = Field Masks in Projections
|
31
|
+
#
|
32
|
+
# When used in the context of a projection, a response message or
|
33
|
+
# sub-message is filtered by the API to only contain those fields as
|
34
|
+
# specified in the mask. For example, if the mask in the previous
|
35
|
+
# example is applied to a response message as follows:
|
36
|
+
#
|
37
|
+
# f {
|
38
|
+
# a : 22
|
39
|
+
# b {
|
40
|
+
# d : 1
|
41
|
+
# x : 2
|
42
|
+
# }
|
43
|
+
# y : 13
|
44
|
+
# }
|
45
|
+
# z: 8
|
46
|
+
#
|
47
|
+
# The result will not contain specific values for fields x,y and z
|
48
|
+
# (their value will be set to the default, and omitted in proto text
|
49
|
+
# output):
|
50
|
+
#
|
51
|
+
#
|
52
|
+
# f {
|
53
|
+
# a : 22
|
54
|
+
# b {
|
55
|
+
# d : 1
|
56
|
+
# }
|
57
|
+
# }
|
58
|
+
#
|
59
|
+
# A repeated field is not allowed except at the last position of a
|
60
|
+
# paths string.
|
61
|
+
#
|
62
|
+
# If a FieldMask object is not present in a get operation, the
|
63
|
+
# operation applies to all fields (as if a FieldMask of all fields
|
64
|
+
# had been specified).
|
65
|
+
#
|
66
|
+
# Note that a field mask does not necessarily apply to the
|
67
|
+
# top-level response message. In case of a REST get operation, the
|
68
|
+
# field mask applies directly to the response, but in case of a REST
|
69
|
+
# list operation, the mask instead applies to each individual message
|
70
|
+
# in the returned resource list. In case of a REST custom method,
|
71
|
+
# other definitions may be used. Where the mask applies will be
|
72
|
+
# clearly documented together with its declaration in the API. In
|
73
|
+
# any case, the effect on the returned resource/resources is required
|
74
|
+
# behavior for APIs.
|
75
|
+
#
|
76
|
+
# = Field Masks in Update Operations
|
77
|
+
#
|
78
|
+
# A field mask in update operations specifies which fields of the
|
79
|
+
# targeted resource are going to be updated. The API is required
|
80
|
+
# to only change the values of the fields as specified in the mask
|
81
|
+
# and leave the others untouched. If a resource is passed in to
|
82
|
+
# describe the updated values, the API ignores the values of all
|
83
|
+
# fields not covered by the mask.
|
84
|
+
#
|
85
|
+
# If a repeated field is specified for an update operation, the existing
|
86
|
+
# repeated values in the target resource will be overwritten by the new values.
|
87
|
+
# Note that a repeated field is only allowed in the last position of a +paths+
|
88
|
+
# string.
|
89
|
+
#
|
90
|
+
# If a sub-message is specified in the last position of the field mask for an
|
91
|
+
# update operation, then the existing sub-message in the target resource is
|
92
|
+
# overwritten. Given the target message:
|
93
|
+
#
|
94
|
+
# f {
|
95
|
+
# b {
|
96
|
+
# d : 1
|
97
|
+
# x : 2
|
98
|
+
# }
|
99
|
+
# c : 1
|
100
|
+
# }
|
101
|
+
#
|
102
|
+
# And an update message:
|
103
|
+
#
|
104
|
+
# f {
|
105
|
+
# b {
|
106
|
+
# d : 10
|
107
|
+
# }
|
108
|
+
# }
|
109
|
+
#
|
110
|
+
# then if the field mask is:
|
111
|
+
#
|
112
|
+
# paths: "f.b"
|
113
|
+
#
|
114
|
+
# then the result will be:
|
115
|
+
#
|
116
|
+
# f {
|
117
|
+
# b {
|
118
|
+
# d : 10
|
119
|
+
# }
|
120
|
+
# c : 1
|
121
|
+
# }
|
122
|
+
#
|
123
|
+
# However, if the update mask was:
|
124
|
+
#
|
125
|
+
# paths: "f.b.d"
|
126
|
+
#
|
127
|
+
# then the result would be:
|
128
|
+
#
|
129
|
+
# f {
|
130
|
+
# b {
|
131
|
+
# d : 10
|
132
|
+
# x : 2
|
133
|
+
# }
|
134
|
+
# c : 1
|
135
|
+
# }
|
136
|
+
#
|
137
|
+
# In order to reset a field's value to the default, the field must
|
138
|
+
# be in the mask and set to the default value in the provided resource.
|
139
|
+
# Hence, in order to reset all fields of a resource, provide a default
|
140
|
+
# instance of the resource and set all fields in the mask, or do
|
141
|
+
# not provide a mask as described below.
|
142
|
+
#
|
143
|
+
# If a field mask is not present on update, the operation applies to
|
144
|
+
# all fields (as if a field mask of all fields has been specified).
|
145
|
+
# Note that in the presence of schema evolution, this may mean that
|
146
|
+
# fields the client does not know and has therefore not filled into
|
147
|
+
# the request will be reset to their default. If this is unwanted
|
148
|
+
# behavior, a specific service may require a client to always specify
|
149
|
+
# a field mask, producing an error if not.
|
150
|
+
#
|
151
|
+
# As with get operations, the location of the resource which
|
152
|
+
# describes the updated values in the request message depends on the
|
153
|
+
# operation kind. In any case, the effect of the field mask is
|
154
|
+
# required to be honored by the API.
|
155
|
+
#
|
156
|
+
# == Considerations for HTTP REST
|
157
|
+
#
|
158
|
+
# The HTTP kind of an update operation which uses a field mask must
|
159
|
+
# be set to PATCH instead of PUT in order to satisfy HTTP semantics
|
160
|
+
# (PUT must only be used for full updates).
|
161
|
+
#
|
162
|
+
# = JSON Encoding of Field Masks
|
163
|
+
#
|
164
|
+
# In JSON, a field mask is encoded as a single string where paths are
|
165
|
+
# separated by a comma. Fields name in each path are converted
|
166
|
+
# to/from lower-camel naming conventions.
|
167
|
+
#
|
168
|
+
# As an example, consider the following message declarations:
|
169
|
+
#
|
170
|
+
# message Profile {
|
171
|
+
# User user = 1;
|
172
|
+
# Photo photo = 2;
|
173
|
+
# }
|
174
|
+
# message User {
|
175
|
+
# string display_name = 1;
|
176
|
+
# string address = 2;
|
177
|
+
# }
|
178
|
+
#
|
179
|
+
# In proto a field mask for +Profile+ may look as such:
|
180
|
+
#
|
181
|
+
# mask {
|
182
|
+
# paths: "user.display_name"
|
183
|
+
# paths: "photo"
|
184
|
+
# }
|
185
|
+
#
|
186
|
+
# In JSON, the same mask is represented as below:
|
187
|
+
#
|
188
|
+
# {
|
189
|
+
# mask: "user.displayName,photo"
|
190
|
+
# }
|
191
|
+
#
|
192
|
+
# = Field Masks and Oneof Fields
|
193
|
+
#
|
194
|
+
# Field masks treat fields in oneofs just as regular fields. Consider the
|
195
|
+
# following message:
|
196
|
+
#
|
197
|
+
# message SampleMessage {
|
198
|
+
# oneof test_oneof {
|
199
|
+
# string name = 4;
|
200
|
+
# SubMessage sub_message = 9;
|
201
|
+
# }
|
202
|
+
# }
|
203
|
+
#
|
204
|
+
# The field mask can be:
|
205
|
+
#
|
206
|
+
# mask {
|
207
|
+
# paths: "name"
|
208
|
+
# }
|
209
|
+
#
|
210
|
+
# Or:
|
211
|
+
#
|
212
|
+
# mask {
|
213
|
+
# paths: "sub_message"
|
214
|
+
# }
|
215
|
+
#
|
216
|
+
# Note that oneof type names ("test_oneof" in this case) cannot be used in
|
217
|
+
# paths.
|
218
|
+
# @!attribute [rw] paths
|
219
|
+
# @return [Array<String>]
|
220
|
+
# The set of field mask paths.
|
221
|
+
class FieldMask; end
|
222
|
+
end
|
223
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# Copyright 2017 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
|
+
# https://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
|
+
|
15
|
+
module Google
|
16
|
+
module Cloud
|
17
|
+
# rubocop:disable LineLength
|
18
|
+
|
19
|
+
##
|
20
|
+
# # Ruby Client for Google Cloud OS Login API ([Alpha](https://github.com/GoogleCloudPlatform/google-cloud-ruby#versioning))
|
21
|
+
#
|
22
|
+
# [Google Cloud OS Login API][Product Documentation]:
|
23
|
+
# Manages OS login configuration for Google account users.
|
24
|
+
# - [Product Documentation][]
|
25
|
+
#
|
26
|
+
# ## Quick Start
|
27
|
+
# In order to use this library, you first need to go through the following
|
28
|
+
# steps:
|
29
|
+
#
|
30
|
+
# 1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
|
31
|
+
# 2. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project)
|
32
|
+
# 3. [Enable the Google Cloud OS Login API.](https://console.cloud.google.com/apis/api/oslogin)
|
33
|
+
# 4. [Setup Authentication.](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud/master/guides/authentication)
|
34
|
+
#
|
35
|
+
# ### Installation
|
36
|
+
# ```
|
37
|
+
# $ gem install google-cloud-os_login
|
38
|
+
# ```
|
39
|
+
#
|
40
|
+
# ### Next Steps
|
41
|
+
# - Read the [Google Cloud OS Login API Product documentation][Product Documentation]
|
42
|
+
# to learn more about the product and see How-to Guides.
|
43
|
+
# - View this [repository's main README](https://github.com/GoogleCloudPlatform/google-cloud-ruby/blob/master/README.md)
|
44
|
+
# to see the full list of Cloud APIs that we cover.
|
45
|
+
#
|
46
|
+
# [Product Documentation]: https://cloud.google.com/compute/docs/oslogin/rest/
|
47
|
+
#
|
48
|
+
#
|
49
|
+
module OsLogin
|
50
|
+
module V1beta
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|