google-cloud-os_login-v1beta 0.5.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 991ec6a6faff76e98b0e91ad50780ff022bca2147ba41049860f675eadfed0a2
4
- data.tar.gz: c158f8415f71f8f00db4f99ef73c0d1dbb014b55331240877a0f73f70bff11a4
3
+ metadata.gz: 90df7c4342d79edc96c3cd59dd5355ee46a96a1b9fa3ed40a21ed2545bfbde3e
4
+ data.tar.gz: 262ce1289795bfb38f83cbc456002c12ac335212490802e91589717b3d655d7c
5
5
  SHA512:
6
- metadata.gz: 1dd564255d4d46c2bf2a98ac056c8cbcd4b916a4e4231ca5d344e8169cdab4536eaeed41fa9ba5e6244e47a953d8818c9382c0ba420a99ba5d4c9cedc6a27bda
7
- data.tar.gz: 83cf2133f3d3527d0af113db977be7e0129123354917f71681dc4c35e302a4e85481afe3d6b4eec3ea5f28ea1c2e46725e58df194c4fb7acee797d609eed0d44
6
+ metadata.gz: 1f3f9ba3678c3a61ad28da1fc7959e13c0275683b8e935c4dad670c547c5f45ebee4606532c56c5cbdfa23f1f7b84604e252528e73ac117b6be96be04715fb97
7
+ data.tar.gz: 4ac32d535934eff6f604dcadfb2f5df5e86bd43a09198a8d8ed0b0beddcce1737e46c28aa64c1d3a5fa360cea862180f0c5c243e6c0d87e9706a8db485d2d2bc
data/AUTHENTICATION.md CHANGED
@@ -114,7 +114,7 @@ credentials are discovered.
114
114
  To configure your system for this, simply:
115
115
 
116
116
  1. [Download and install the Cloud SDK](https://cloud.google.com/sdk)
117
- 2. Authenticate using OAuth 2.0 `$ gcloud auth login`
117
+ 2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login`
118
118
  3. Write code as if already authenticated.
119
119
 
120
120
  **NOTE:** This is _not_ recommended for running in production. The Cloud SDK
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Ruby Client for the Cloud OS Login V1beta API
2
2
 
3
- API Client library for the Cloud OS Login V1beta API
3
+ You can use OS Login to manage access to your VM instances using IAM roles.
4
4
 
5
5
  Use OS Login to manage SSH access to your instances using IAM without having to create and manage individual SSH keys. OS Login maintains a consistent Linux user identity across VM instances and is the recommended way to manage many users across multiple instances or projects.
6
6
 
@@ -33,8 +33,8 @@ In order to use this library, you first need to go through the following steps:
33
33
  require "google/cloud/os_login/v1beta"
34
34
 
35
35
  client = ::Google::Cloud::OsLogin::V1beta::OsLoginService::Client.new
36
- request = ::Google::Cloud::OsLogin::V1beta::DeletePosixAccountRequest.new # (request fields as keyword arguments...)
37
- response = client.delete_posix_account request
36
+ request = ::Google::Cloud::OsLogin::V1beta::CreateSshPublicKeyRequest.new # (request fields as keyword arguments...)
37
+ response = client.create_ssh_public_key request
38
38
  ```
39
39
 
40
40
  View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-os_login-v1beta/latest)
@@ -46,7 +46,7 @@ for general usage information.
46
46
  ## Enabling Logging
47
47
 
48
48
  To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
49
- The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib/libdoc/logger/rdoc/Logger.html) as shown below,
49
+ The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
50
50
  or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
51
51
  that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
52
52
  and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
@@ -177,6 +177,93 @@ module Google
177
177
 
178
178
  # Service calls
179
179
 
180
+ ##
181
+ # Create an SSH public key
182
+ #
183
+ # @overload create_ssh_public_key(request, options = nil)
184
+ # Pass arguments to `create_ssh_public_key` via a request object, either of type
185
+ # {::Google::Cloud::OsLogin::V1beta::CreateSshPublicKeyRequest} or an equivalent Hash.
186
+ #
187
+ # @param request [::Google::Cloud::OsLogin::V1beta::CreateSshPublicKeyRequest, ::Hash]
188
+ # A request object representing the call parameters. Required. To specify no
189
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
190
+ # @param options [::Gapic::CallOptions, ::Hash]
191
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
192
+ #
193
+ # @overload create_ssh_public_key(parent: nil, ssh_public_key: nil)
194
+ # Pass arguments to `create_ssh_public_key` via keyword arguments. Note that at
195
+ # least one keyword argument is required. To specify no parameters, or to keep all
196
+ # the default parameter values, pass an empty Hash as a request object (see above).
197
+ #
198
+ # @param parent [::String]
199
+ # Required. The unique ID for the user in format `users/{user}`.
200
+ # @param ssh_public_key [::Google::Cloud::OsLogin::Common::SshPublicKey, ::Hash]
201
+ # Required. The SSH public key and expiration time.
202
+ #
203
+ # @yield [response, operation] Access the result along with the RPC operation
204
+ # @yieldparam response [::Google::Cloud::OsLogin::Common::SshPublicKey]
205
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
206
+ #
207
+ # @return [::Google::Cloud::OsLogin::Common::SshPublicKey]
208
+ #
209
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
210
+ #
211
+ # @example Basic example
212
+ # require "google/cloud/os_login/v1beta"
213
+ #
214
+ # # Create a client object. The client can be reused for multiple calls.
215
+ # client = Google::Cloud::OsLogin::V1beta::OsLoginService::Client.new
216
+ #
217
+ # # Create a request. To set request fields, pass in keyword arguments.
218
+ # request = Google::Cloud::OsLogin::V1beta::CreateSshPublicKeyRequest.new
219
+ #
220
+ # # Call the create_ssh_public_key method.
221
+ # result = client.create_ssh_public_key request
222
+ #
223
+ # # The returned object is of type Google::Cloud::OsLogin::Common::SshPublicKey.
224
+ # p result
225
+ #
226
+ def create_ssh_public_key request, options = nil
227
+ raise ::ArgumentError, "request must be provided" if request.nil?
228
+
229
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::OsLogin::V1beta::CreateSshPublicKeyRequest
230
+
231
+ # Converts hash and nil to an options object
232
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
233
+
234
+ # Customize the options with defaults
235
+ metadata = @config.rpcs.create_ssh_public_key.metadata.to_h
236
+
237
+ # Set x-goog-api-client and x-goog-user-project headers
238
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
239
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
240
+ gapic_version: ::Google::Cloud::OsLogin::V1beta::VERSION
241
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
242
+
243
+ header_params = {}
244
+ if request.parent
245
+ header_params["parent"] = request.parent
246
+ end
247
+
248
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
249
+ metadata[:"x-goog-request-params"] ||= request_params_header
250
+
251
+ options.apply_defaults timeout: @config.rpcs.create_ssh_public_key.timeout,
252
+ metadata: metadata,
253
+ retry_policy: @config.rpcs.create_ssh_public_key.retry_policy
254
+
255
+ options.apply_defaults timeout: @config.timeout,
256
+ metadata: @config.metadata,
257
+ retry_policy: @config.retry_policy
258
+
259
+ @os_login_service_stub.call_rpc :create_ssh_public_key, request, options: options do |response, operation|
260
+ yield response, operation if block_given?
261
+ return response
262
+ end
263
+ rescue ::GRPC::BadStatus => e
264
+ raise ::Google::Cloud::Error.from_error(e)
265
+ end
266
+
180
267
  ##
181
268
  # Deletes a POSIX account.
182
269
  #
@@ -196,9 +283,9 @@ module Google
196
283
  # the default parameter values, pass an empty Hash as a request object (see above).
197
284
  #
198
285
  # @param name [::String]
199
- # Required. A reference to the POSIX account to update. POSIX accounts are identified
200
- # by the project ID they are associated with. A reference to the POSIX
201
- # account is in format `users/{user}/projects/{project}`.
286
+ # Required. A reference to the POSIX account to update. POSIX accounts are
287
+ # identified by the project ID they are associated with. A reference to the
288
+ # POSIX account is in format `users/{user}/projects/{project}`.
202
289
  #
203
290
  # @yield [response, operation] Access the result along with the RPC operation
204
291
  # @yieldparam response [::Google::Protobuf::Empty]
@@ -283,9 +370,9 @@ module Google
283
370
  # the default parameter values, pass an empty Hash as a request object (see above).
284
371
  #
285
372
  # @param name [::String]
286
- # Required. The fingerprint of the public key to update. Public keys are identified by
287
- # their SHA-256 fingerprint. The fingerprint of the public key is in format
288
- # `users/{user}/sshPublicKeys/{fingerprint}`.
373
+ # Required. The fingerprint of the public key to update. Public keys are
374
+ # identified by their SHA-256 fingerprint. The fingerprint of the public key
375
+ # is in format `users/{user}/sshPublicKeys/{fingerprint}`.
289
376
  #
290
377
  # @yield [response, operation] Access the result along with the RPC operation
291
378
  # @yieldparam response [::Google::Protobuf::Empty]
@@ -365,7 +452,7 @@ module Google
365
452
  # @param options [::Gapic::CallOptions, ::Hash]
366
453
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
367
454
  #
368
- # @overload get_login_profile(name: nil, project_id: nil, system_id: nil)
455
+ # @overload get_login_profile(name: nil, project_id: nil, system_id: nil, view: nil)
369
456
  # Pass arguments to `get_login_profile` via keyword arguments. Note that at
370
457
  # least one keyword argument is required. To specify no parameters, or to keep all
371
458
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -376,6 +463,8 @@ module Google
376
463
  # The project ID of the Google Cloud Platform project.
377
464
  # @param system_id [::String]
378
465
  # A system ID for filtering the results of the request.
466
+ # @param view [::Google::Cloud::OsLogin::V1beta::LoginProfileView]
467
+ # The view configures whether to retrieve security keys information.
379
468
  #
380
469
  # @yield [response, operation] Access the result along with the RPC operation
381
470
  # @yieldparam response [::Google::Cloud::OsLogin::V1beta::LoginProfile]
@@ -460,9 +549,9 @@ module Google
460
549
  # the default parameter values, pass an empty Hash as a request object (see above).
461
550
  #
462
551
  # @param name [::String]
463
- # Required. The fingerprint of the public key to retrieve. Public keys are identified
464
- # by their SHA-256 fingerprint. The fingerprint of the public key is in
465
- # format `users/{user}/sshPublicKeys/{fingerprint}`.
552
+ # Required. The fingerprint of the public key to retrieve. Public keys are
553
+ # identified by their SHA-256 fingerprint. The fingerprint of the public key
554
+ # is in format `users/{user}/sshPublicKeys/{fingerprint}`.
466
555
  #
467
556
  # @yield [response, operation] Access the result along with the RPC operation
468
557
  # @yieldparam response [::Google::Cloud::OsLogin::Common::SshPublicKey]
@@ -543,7 +632,7 @@ module Google
543
632
  # @param options [::Gapic::CallOptions, ::Hash]
544
633
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
545
634
  #
546
- # @overload import_ssh_public_key(parent: nil, ssh_public_key: nil, project_id: nil)
635
+ # @overload import_ssh_public_key(parent: nil, ssh_public_key: nil, project_id: nil, view: nil)
547
636
  # Pass arguments to `import_ssh_public_key` via keyword arguments. Note that at
548
637
  # least one keyword argument is required. To specify no parameters, or to keep all
549
638
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -554,6 +643,8 @@ module Google
554
643
  # Required. The SSH public key and expiration time.
555
644
  # @param project_id [::String]
556
645
  # The project ID of the Google Cloud Platform project.
646
+ # @param view [::Google::Cloud::OsLogin::V1beta::LoginProfileView]
647
+ # The view configures whether to retrieve security keys information.
557
648
  #
558
649
  # @yield [response, operation] Access the result along with the RPC operation
559
650
  # @yieldparam response [::Google::Cloud::OsLogin::V1beta::ImportSshPublicKeyResponse]
@@ -639,9 +730,9 @@ module Google
639
730
  # the default parameter values, pass an empty Hash as a request object (see above).
640
731
  #
641
732
  # @param name [::String]
642
- # Required. The fingerprint of the public key to update. Public keys are identified by
643
- # their SHA-256 fingerprint. The fingerprint of the public key is in format
644
- # `users/{user}/sshPublicKeys/{fingerprint}`.
733
+ # Required. The fingerprint of the public key to update. Public keys are
734
+ # identified by their SHA-256 fingerprint. The fingerprint of the public key
735
+ # is in format `users/{user}/sshPublicKeys/{fingerprint}`.
645
736
  # @param ssh_public_key [::Google::Cloud::OsLogin::Common::SshPublicKey, ::Hash]
646
737
  # Required. The SSH public key and expiration time.
647
738
  # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
@@ -727,17 +818,17 @@ module Google
727
818
  # @example
728
819
  #
729
820
  # # Modify the global config, setting the timeout for
730
- # # delete_posix_account to 20 seconds,
821
+ # # create_ssh_public_key to 20 seconds,
731
822
  # # and all remaining timeouts to 10 seconds.
732
823
  # ::Google::Cloud::OsLogin::V1beta::OsLoginService::Client.configure do |config|
733
824
  # config.timeout = 10.0
734
- # config.rpcs.delete_posix_account.timeout = 20.0
825
+ # config.rpcs.create_ssh_public_key.timeout = 20.0
735
826
  # end
736
827
  #
737
828
  # # Apply the above configuration only to a new client.
738
829
  # client = ::Google::Cloud::OsLogin::V1beta::OsLoginService::Client.new do |config|
739
830
  # config.timeout = 10.0
740
- # config.rpcs.delete_posix_account.timeout = 20.0
831
+ # config.rpcs.create_ssh_public_key.timeout = 20.0
741
832
  # end
742
833
  #
743
834
  # @!attribute [rw] endpoint
@@ -846,6 +937,11 @@ module Google
846
937
  # trigger a retry.
847
938
  #
848
939
  class Rpcs
940
+ ##
941
+ # RPC-specific configuration for `create_ssh_public_key`
942
+ # @return [::Gapic::Config::Method]
943
+ #
944
+ attr_reader :create_ssh_public_key
849
945
  ##
850
946
  # RPC-specific configuration for `delete_posix_account`
851
947
  # @return [::Gapic::Config::Method]
@@ -879,6 +975,8 @@ module Google
879
975
 
880
976
  # @private
881
977
  def initialize parent_rpcs = nil
978
+ create_ssh_public_key_config = parent_rpcs.create_ssh_public_key if parent_rpcs.respond_to? :create_ssh_public_key
979
+ @create_ssh_public_key = ::Gapic::Config::Method.new create_ssh_public_key_config
882
980
  delete_posix_account_config = parent_rpcs.delete_posix_account if parent_rpcs.respond_to? :delete_posix_account
883
981
  @delete_posix_account = ::Gapic::Config::Method.new delete_posix_account_config
884
982
  delete_ssh_public_key_config = parent_rpcs.delete_ssh_public_key if parent_rpcs.respond_to? :delete_ssh_public_key