google-cloud-kms-v1 0.18.1 → 0.20.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: 59b86de14b63de4677b18bf0f2bd000fd989942c71966e4fc934e6402e42e0ee
4
- data.tar.gz: 2b93be85406e63ca4f5f316a3704be88f32fb47ec5a7daf76133a3bcf4a48afb
3
+ metadata.gz: df0145acded1923556f3d2fb9da19c2f2eeadcb77e5c7c13fce83bc86681e3cc
4
+ data.tar.gz: '08f2f6b7a180fd101bb3d882cd50c520261645088dd31e5a80b94495526d81ac'
5
5
  SHA512:
6
- metadata.gz: b5476742317b44f7715d20116b165bbd1827b02b837d3b2c65c2c606c5bebe4a1a42cf129896dc8f2ce35aeed907e87d1b8cbc927d71a7e702bab73260da6e21
7
- data.tar.gz: e615bc561491044d5e42d26754fac81a63f781a249c6f061f58006ec0644508dedb84101528e62bd34232bd76b8b667d82b0e936d7e6d583ec26d2b11a55bb72
6
+ metadata.gz: 660675bc64e9fa9e0f742411ed0621d781b0388cd6199966c9300cf30937bd3871435155886f1be84ed4d0f9f1665ab6a56fca6ca46f2d21827205836414f6d0
7
+ data.tar.gz: 2f35a06d6dbfbaf44deaa01d6162efbdef83270451365431e1c68f9b1c9174f743ecc5404b2692df5887450160c6f11a425c1696d6b3ad35a9ccc393408bda2c
@@ -149,7 +149,7 @@ module Google
149
149
  credentials = @config.credentials
150
150
  # Use self-signed JWT if the endpoint is unchanged from default,
151
151
  # but only if the default endpoint does not have a region prefix.
152
- enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
152
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
153
153
  !@config.endpoint.split(".").first.include?("-")
154
154
  credentials ||= Credentials.default scope: @config.scope,
155
155
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -753,6 +753,96 @@ module Google
753
753
  raise ::Google::Cloud::Error.from_error(e)
754
754
  end
755
755
 
756
+ ##
757
+ # Verifies that Cloud KMS can successfully connect to the external key
758
+ # manager specified by an {::Google::Cloud::Kms::V1::EkmConnection EkmConnection}.
759
+ # If there is an error connecting to the EKM, this method returns a
760
+ # FAILED_PRECONDITION status containing structured information as described
761
+ # at https://cloud.google.com/kms/docs/reference/ekm_errors.
762
+ #
763
+ # @overload verify_connectivity(request, options = nil)
764
+ # Pass arguments to `verify_connectivity` via a request object, either of type
765
+ # {::Google::Cloud::Kms::V1::VerifyConnectivityRequest} or an equivalent Hash.
766
+ #
767
+ # @param request [::Google::Cloud::Kms::V1::VerifyConnectivityRequest, ::Hash]
768
+ # A request object representing the call parameters. Required. To specify no
769
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
770
+ # @param options [::Gapic::CallOptions, ::Hash]
771
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
772
+ #
773
+ # @overload verify_connectivity(name: nil)
774
+ # Pass arguments to `verify_connectivity` via keyword arguments. Note that at
775
+ # least one keyword argument is required. To specify no parameters, or to keep all
776
+ # the default parameter values, pass an empty Hash as a request object (see above).
777
+ #
778
+ # @param name [::String]
779
+ # Required. The {::Google::Cloud::Kms::V1::EkmConnection#name name} of the
780
+ # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} to verify.
781
+ #
782
+ # @yield [response, operation] Access the result along with the RPC operation
783
+ # @yieldparam response [::Google::Cloud::Kms::V1::VerifyConnectivityResponse]
784
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
785
+ #
786
+ # @return [::Google::Cloud::Kms::V1::VerifyConnectivityResponse]
787
+ #
788
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
789
+ #
790
+ # @example Basic example
791
+ # require "google/cloud/kms/v1"
792
+ #
793
+ # # Create a client object. The client can be reused for multiple calls.
794
+ # client = Google::Cloud::Kms::V1::EkmService::Client.new
795
+ #
796
+ # # Create a request. To set request fields, pass in keyword arguments.
797
+ # request = Google::Cloud::Kms::V1::VerifyConnectivityRequest.new
798
+ #
799
+ # # Call the verify_connectivity method.
800
+ # result = client.verify_connectivity request
801
+ #
802
+ # # The returned object is of type Google::Cloud::Kms::V1::VerifyConnectivityResponse.
803
+ # p result
804
+ #
805
+ def verify_connectivity request, options = nil
806
+ raise ::ArgumentError, "request must be provided" if request.nil?
807
+
808
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::VerifyConnectivityRequest
809
+
810
+ # Converts hash and nil to an options object
811
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
812
+
813
+ # Customize the options with defaults
814
+ metadata = @config.rpcs.verify_connectivity.metadata.to_h
815
+
816
+ # Set x-goog-api-client and x-goog-user-project headers
817
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
818
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
819
+ gapic_version: ::Google::Cloud::Kms::V1::VERSION
820
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
821
+
822
+ header_params = {}
823
+ if request.name
824
+ header_params["name"] = request.name
825
+ end
826
+
827
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
828
+ metadata[:"x-goog-request-params"] ||= request_params_header
829
+
830
+ options.apply_defaults timeout: @config.rpcs.verify_connectivity.timeout,
831
+ metadata: metadata,
832
+ retry_policy: @config.rpcs.verify_connectivity.retry_policy
833
+
834
+ options.apply_defaults timeout: @config.timeout,
835
+ metadata: @config.metadata,
836
+ retry_policy: @config.retry_policy
837
+
838
+ @ekm_service_stub.call_rpc :verify_connectivity, request, options: options do |response, operation|
839
+ yield response, operation if block_given?
840
+ return response
841
+ end
842
+ rescue ::GRPC::BadStatus => e
843
+ raise ::Google::Cloud::Error.from_error(e)
844
+ end
845
+
756
846
  ##
757
847
  # Configuration class for the EkmService API.
758
848
  #
@@ -835,7 +925,9 @@ module Google
835
925
  class Configuration
836
926
  extend ::Gapic::Config
837
927
 
838
- config_attr :endpoint, "cloudkms.googleapis.com", ::String
928
+ DEFAULT_ENDPOINT = "cloudkms.googleapis.com"
929
+
930
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
839
931
  config_attr :credentials, nil do |value|
840
932
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
841
933
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -918,6 +1010,11 @@ module Google
918
1010
  # @return [::Gapic::Config::Method]
919
1011
  #
920
1012
  attr_reader :update_ekm_config
1013
+ ##
1014
+ # RPC-specific configuration for `verify_connectivity`
1015
+ # @return [::Gapic::Config::Method]
1016
+ #
1017
+ attr_reader :verify_connectivity
921
1018
 
922
1019
  # @private
923
1020
  def initialize parent_rpcs = nil
@@ -933,6 +1030,8 @@ module Google
933
1030
  @get_ekm_config = ::Gapic::Config::Method.new get_ekm_config_config
934
1031
  update_ekm_config_config = parent_rpcs.update_ekm_config if parent_rpcs.respond_to? :update_ekm_config
935
1032
  @update_ekm_config = ::Gapic::Config::Method.new update_ekm_config_config
1033
+ verify_connectivity_config = parent_rpcs.verify_connectivity if parent_rpcs.respond_to? :verify_connectivity
1034
+ @verify_connectivity = ::Gapic::Config::Method.new verify_connectivity_config
936
1035
 
937
1036
  yield self if block_given?
938
1037
  end
@@ -145,7 +145,7 @@ module Google
145
145
  credentials = @config.credentials
146
146
  # Use self-signed JWT if the endpoint is unchanged from default,
147
147
  # but only if the default endpoint does not have a region prefix.
148
- enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
148
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
149
149
  !@config.endpoint.split(".").first.include?("-")
150
150
  credentials ||= Credentials.default scope: @config.scope,
151
151
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -604,6 +604,73 @@ module Google
604
604
  raise ::Google::Cloud::Error.from_error(e)
605
605
  end
606
606
 
607
+ ##
608
+ # Verifies that Cloud KMS can successfully connect to the external key
609
+ # manager specified by an {::Google::Cloud::Kms::V1::EkmConnection EkmConnection}.
610
+ # If there is an error connecting to the EKM, this method returns a
611
+ # FAILED_PRECONDITION status containing structured information as described
612
+ # at https://cloud.google.com/kms/docs/reference/ekm_errors.
613
+ #
614
+ # @overload verify_connectivity(request, options = nil)
615
+ # Pass arguments to `verify_connectivity` via a request object, either of type
616
+ # {::Google::Cloud::Kms::V1::VerifyConnectivityRequest} or an equivalent Hash.
617
+ #
618
+ # @param request [::Google::Cloud::Kms::V1::VerifyConnectivityRequest, ::Hash]
619
+ # A request object representing the call parameters. Required. To specify no
620
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
621
+ # @param options [::Gapic::CallOptions, ::Hash]
622
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
623
+ #
624
+ # @overload verify_connectivity(name: nil)
625
+ # Pass arguments to `verify_connectivity` via keyword arguments. Note that at
626
+ # least one keyword argument is required. To specify no parameters, or to keep all
627
+ # the default parameter values, pass an empty Hash as a request object (see above).
628
+ #
629
+ # @param name [::String]
630
+ # Required. The {::Google::Cloud::Kms::V1::EkmConnection#name name} of the
631
+ # {::Google::Cloud::Kms::V1::EkmConnection EkmConnection} to verify.
632
+ # @yield [result, operation] Access the result along with the TransportOperation object
633
+ # @yieldparam result [::Google::Cloud::Kms::V1::VerifyConnectivityResponse]
634
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
635
+ #
636
+ # @return [::Google::Cloud::Kms::V1::VerifyConnectivityResponse]
637
+ #
638
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
639
+ def verify_connectivity request, options = nil
640
+ raise ::ArgumentError, "request must be provided" if request.nil?
641
+
642
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::VerifyConnectivityRequest
643
+
644
+ # Converts hash and nil to an options object
645
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
646
+
647
+ # Customize the options with defaults
648
+ call_metadata = @config.rpcs.verify_connectivity.metadata.to_h
649
+
650
+ # Set x-goog-api-client and x-goog-user-project headers
651
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
652
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
653
+ gapic_version: ::Google::Cloud::Kms::V1::VERSION,
654
+ transports_version_send: [:rest]
655
+
656
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
657
+
658
+ options.apply_defaults timeout: @config.rpcs.verify_connectivity.timeout,
659
+ metadata: call_metadata,
660
+ retry_policy: @config.rpcs.verify_connectivity.retry_policy
661
+
662
+ options.apply_defaults timeout: @config.timeout,
663
+ metadata: @config.metadata,
664
+ retry_policy: @config.retry_policy
665
+
666
+ @ekm_service_stub.verify_connectivity request, options do |result, operation|
667
+ yield result, operation if block_given?
668
+ return result
669
+ end
670
+ rescue ::Gapic::Rest::Error => e
671
+ raise ::Google::Cloud::Error.from_error(e)
672
+ end
673
+
607
674
  ##
608
675
  # Configuration class for the EkmService REST API.
609
676
  #
@@ -677,7 +744,9 @@ module Google
677
744
  class Configuration
678
745
  extend ::Gapic::Config
679
746
 
680
- config_attr :endpoint, "cloudkms.googleapis.com", ::String
747
+ DEFAULT_ENDPOINT = "cloudkms.googleapis.com"
748
+
749
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
681
750
  config_attr :credentials, nil do |value|
682
751
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
683
752
  allowed.any? { |klass| klass === value }
@@ -764,6 +833,11 @@ module Google
764
833
  # @return [::Gapic::Config::Method]
765
834
  #
766
835
  attr_reader :update_ekm_config
836
+ ##
837
+ # RPC-specific configuration for `verify_connectivity`
838
+ # @return [::Gapic::Config::Method]
839
+ #
840
+ attr_reader :verify_connectivity
767
841
 
768
842
  # @private
769
843
  def initialize parent_rpcs = nil
@@ -779,6 +853,8 @@ module Google
779
853
  @get_ekm_config = ::Gapic::Config::Method.new get_ekm_config_config
780
854
  update_ekm_config_config = parent_rpcs.update_ekm_config if parent_rpcs.respond_to? :update_ekm_config
781
855
  @update_ekm_config = ::Gapic::Config::Method.new update_ekm_config_config
856
+ verify_connectivity_config = parent_rpcs.verify_connectivity if parent_rpcs.respond_to? :verify_connectivity
857
+ @verify_connectivity = ::Gapic::Config::Method.new verify_connectivity_config
782
858
 
783
859
  yield self if block_given?
784
860
  end
@@ -59,7 +59,7 @@ module Google
59
59
 
60
60
  verb, uri, query_string_params, body = ServiceStub.transcode_list_ekm_connections_request request_pb
61
61
  query_string_params = if query_string_params.any?
62
- query_string_params.to_h { |p| p.split("=", 2) }
62
+ query_string_params.to_h { |p| p.split "=", 2 }
63
63
  else
64
64
  {}
65
65
  end
@@ -97,7 +97,7 @@ module Google
97
97
 
98
98
  verb, uri, query_string_params, body = ServiceStub.transcode_get_ekm_connection_request request_pb
99
99
  query_string_params = if query_string_params.any?
100
- query_string_params.to_h { |p| p.split("=", 2) }
100
+ query_string_params.to_h { |p| p.split "=", 2 }
101
101
  else
102
102
  {}
103
103
  end
@@ -135,7 +135,7 @@ module Google
135
135
 
136
136
  verb, uri, query_string_params, body = ServiceStub.transcode_create_ekm_connection_request request_pb
137
137
  query_string_params = if query_string_params.any?
138
- query_string_params.to_h { |p| p.split("=", 2) }
138
+ query_string_params.to_h { |p| p.split "=", 2 }
139
139
  else
140
140
  {}
141
141
  end
@@ -173,7 +173,7 @@ module Google
173
173
 
174
174
  verb, uri, query_string_params, body = ServiceStub.transcode_update_ekm_connection_request request_pb
175
175
  query_string_params = if query_string_params.any?
176
- query_string_params.to_h { |p| p.split("=", 2) }
176
+ query_string_params.to_h { |p| p.split "=", 2 }
177
177
  else
178
178
  {}
179
179
  end
@@ -211,7 +211,7 @@ module Google
211
211
 
212
212
  verb, uri, query_string_params, body = ServiceStub.transcode_get_ekm_config_request request_pb
213
213
  query_string_params = if query_string_params.any?
214
- query_string_params.to_h { |p| p.split("=", 2) }
214
+ query_string_params.to_h { |p| p.split "=", 2 }
215
215
  else
216
216
  {}
217
217
  end
@@ -249,7 +249,7 @@ module Google
249
249
 
250
250
  verb, uri, query_string_params, body = ServiceStub.transcode_update_ekm_config_request request_pb
251
251
  query_string_params = if query_string_params.any?
252
- query_string_params.to_h { |p| p.split("=", 2) }
252
+ query_string_params.to_h { |p| p.split "=", 2 }
253
253
  else
254
254
  {}
255
255
  end
@@ -268,6 +268,44 @@ module Google
268
268
  result
269
269
  end
270
270
 
271
+ ##
272
+ # Baseline implementation for the verify_connectivity REST call
273
+ #
274
+ # @param request_pb [::Google::Cloud::Kms::V1::VerifyConnectivityRequest]
275
+ # A request object representing the call parameters. Required.
276
+ # @param options [::Gapic::CallOptions]
277
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
278
+ #
279
+ # @yield [result, operation] Access the result along with the TransportOperation object
280
+ # @yieldparam result [::Google::Cloud::Kms::V1::VerifyConnectivityResponse]
281
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
282
+ #
283
+ # @return [::Google::Cloud::Kms::V1::VerifyConnectivityResponse]
284
+ # A result object deserialized from the server's reply
285
+ def verify_connectivity request_pb, options = nil
286
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
287
+
288
+ verb, uri, query_string_params, body = ServiceStub.transcode_verify_connectivity_request request_pb
289
+ query_string_params = if query_string_params.any?
290
+ query_string_params.to_h { |p| p.split "=", 2 }
291
+ else
292
+ {}
293
+ end
294
+
295
+ response = @client_stub.make_http_request(
296
+ verb,
297
+ uri: uri,
298
+ body: body || "",
299
+ params: query_string_params,
300
+ options: options
301
+ )
302
+ operation = ::Gapic::Rest::TransportOperation.new response
303
+ result = ::Google::Cloud::Kms::V1::VerifyConnectivityResponse.decode_json response.body, ignore_unknown_fields: true
304
+
305
+ yield result, operation if block_given?
306
+ result
307
+ end
308
+
271
309
  ##
272
310
  # @private
273
311
  #
@@ -396,6 +434,27 @@ module Google
396
434
  )
397
435
  transcoder.transcode request_pb
398
436
  end
437
+
438
+ ##
439
+ # @private
440
+ #
441
+ # GRPC transcoding helper method for the verify_connectivity REST call
442
+ #
443
+ # @param request_pb [::Google::Cloud::Kms::V1::VerifyConnectivityRequest]
444
+ # A request object representing the call parameters. Required.
445
+ # @return [Array(String, [String, nil], Hash{String => String})]
446
+ # Uri, Body, Query string parameters
447
+ def self.transcode_verify_connectivity_request request_pb
448
+ transcoder = Gapic::Rest::GrpcTranscoder.new
449
+ .with_bindings(
450
+ uri_method: :get,
451
+ uri_template: "/v1/{name}:verifyConnectivity",
452
+ matches: [
453
+ ["name", %r{^projects/[^/]+/locations/[^/]+/ekmConnections/[^/]+/?$}, false]
454
+ ]
455
+ )
456
+ transcoder.transcode request_pb
457
+ end
399
458
  end
400
459
  end
401
460
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
3
  # source: google/cloud/kms/v1/ekm_service.proto
3
4
 
@@ -10,74 +11,33 @@ require 'google/api/resource_pb'
10
11
  require 'google/protobuf/field_mask_pb'
11
12
  require 'google/protobuf/timestamp_pb'
12
13
 
13
- Google::Protobuf::DescriptorPool.generated_pool.build do
14
- add_file("google/cloud/kms/v1/ekm_service.proto", :syntax => :proto3) do
15
- add_message "google.cloud.kms.v1.ListEkmConnectionsRequest" do
16
- optional :parent, :string, 1
17
- optional :page_size, :int32, 2
18
- optional :page_token, :string, 3
19
- optional :filter, :string, 4
20
- optional :order_by, :string, 5
21
- end
22
- add_message "google.cloud.kms.v1.ListEkmConnectionsResponse" do
23
- repeated :ekm_connections, :message, 1, "google.cloud.kms.v1.EkmConnection"
24
- optional :next_page_token, :string, 2
25
- optional :total_size, :int32, 3
26
- end
27
- add_message "google.cloud.kms.v1.GetEkmConnectionRequest" do
28
- optional :name, :string, 1
29
- end
30
- add_message "google.cloud.kms.v1.CreateEkmConnectionRequest" do
31
- optional :parent, :string, 1
32
- optional :ekm_connection_id, :string, 2
33
- optional :ekm_connection, :message, 3, "google.cloud.kms.v1.EkmConnection"
34
- end
35
- add_message "google.cloud.kms.v1.UpdateEkmConnectionRequest" do
36
- optional :ekm_connection, :message, 1, "google.cloud.kms.v1.EkmConnection"
37
- optional :update_mask, :message, 2, "google.protobuf.FieldMask"
38
- end
39
- add_message "google.cloud.kms.v1.GetEkmConfigRequest" do
40
- optional :name, :string, 1
41
- end
42
- add_message "google.cloud.kms.v1.UpdateEkmConfigRequest" do
43
- optional :ekm_config, :message, 1, "google.cloud.kms.v1.EkmConfig"
44
- optional :update_mask, :message, 2, "google.protobuf.FieldMask"
45
- end
46
- add_message "google.cloud.kms.v1.Certificate" do
47
- optional :raw_der, :bytes, 1
48
- optional :parsed, :bool, 2
49
- optional :issuer, :string, 3
50
- optional :subject, :string, 4
51
- repeated :subject_alternative_dns_names, :string, 5
52
- optional :not_before_time, :message, 6, "google.protobuf.Timestamp"
53
- optional :not_after_time, :message, 7, "google.protobuf.Timestamp"
54
- optional :serial_number, :string, 8
55
- optional :sha256_fingerprint, :string, 9
56
- end
57
- add_message "google.cloud.kms.v1.EkmConnection" do
58
- optional :name, :string, 1
59
- optional :create_time, :message, 2, "google.protobuf.Timestamp"
60
- repeated :service_resolvers, :message, 3, "google.cloud.kms.v1.EkmConnection.ServiceResolver"
61
- optional :etag, :string, 5
62
- optional :key_management_mode, :enum, 6, "google.cloud.kms.v1.EkmConnection.KeyManagementMode"
63
- optional :crypto_space_path, :string, 7
64
- end
65
- add_message "google.cloud.kms.v1.EkmConnection.ServiceResolver" do
66
- optional :service_directory_service, :string, 1
67
- optional :endpoint_filter, :string, 2
68
- optional :hostname, :string, 3
69
- repeated :server_certificates, :message, 4, "google.cloud.kms.v1.Certificate"
70
- end
71
- add_enum "google.cloud.kms.v1.EkmConnection.KeyManagementMode" do
72
- value :KEY_MANAGEMENT_MODE_UNSPECIFIED, 0
73
- value :MANUAL, 1
74
- value :CLOUD_KMS, 2
75
- end
76
- add_message "google.cloud.kms.v1.EkmConfig" do
77
- optional :name, :string, 1
78
- optional :default_ekm_connection, :string, 2
14
+
15
+ descriptor_data = "\n%google/cloud/kms/v1/ekm_service.proto\x12\x13google.cloud.kms.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb3\x01\n\x19ListEkmConnectionsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\"\x86\x01\n\x1aListEkmConnectionsResponse\x12;\n\x0f\x65km_connections\x18\x01 \x03(\x0b\x32\".google.cloud.kms.v1.EkmConnection\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"V\n\x17GetEkmConnectionRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%cloudkms.googleapis.com/EkmConnection\"\xb8\x01\n\x1a\x43reateEkmConnectionRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x1e\n\x11\x65km_connection_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12?\n\x0e\x65km_connection\x18\x03 \x01(\x0b\x32\".google.cloud.kms.v1.EkmConnectionB\x03\xe0\x41\x02\"\x93\x01\n\x1aUpdateEkmConnectionRequest\x12?\n\x0e\x65km_connection\x18\x01 \x01(\x0b\x32\".google.cloud.kms.v1.EkmConnectionB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"N\n\x13GetEkmConfigRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudkms.googleapis.com/EkmConfig\"\x87\x01\n\x16UpdateEkmConfigRequest\x12\x37\n\nekm_config\x18\x01 \x01(\x0b\x32\x1e.google.cloud.kms.v1.EkmConfigB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"\xbf\x02\n\x0b\x43\x65rtificate\x12\x14\n\x07raw_der\x18\x01 \x01(\x0c\x42\x03\xe0\x41\x02\x12\x13\n\x06parsed\x18\x02 \x01(\x08\x42\x03\xe0\x41\x03\x12\x13\n\x06issuer\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x07subject\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12*\n\x1dsubject_alternative_dns_names\x18\x05 \x03(\tB\x03\xe0\x41\x03\x12\x38\n\x0fnot_before_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x37\n\x0enot_after_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1a\n\rserial_number\x18\x08 \x01(\tB\x03\xe0\x41\x03\x12\x1f\n\x12sha256_fingerprint\x18\t \x01(\tB\x03\xe0\x41\x03\"\xdd\x05\n\rEkmConnection\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12M\n\x11service_resolvers\x18\x03 \x03(\x0b\x32\x32.google.cloud.kms.v1.EkmConnection.ServiceResolver\x12\x11\n\x04\x65tag\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12V\n\x13key_management_mode\x18\x06 \x01(\x0e\x32\x34.google.cloud.kms.v1.EkmConnection.KeyManagementModeB\x03\xe0\x41\x01\x12\x1e\n\x11\x63rypto_space_path\x18\x07 \x01(\tB\x03\xe0\x41\x01\x1a\xde\x01\n\x0fServiceResolver\x12R\n\x19service_directory_service\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'servicedirectory.googleapis.com/Service\x12\x1c\n\x0f\x65ndpoint_filter\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08hostname\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x42\n\x13server_certificates\x18\x04 \x03(\x0b\x32 .google.cloud.kms.v1.CertificateB\x03\xe0\x41\x02\"S\n\x11KeyManagementMode\x12#\n\x1fKEY_MANAGEMENT_MODE_UNSPECIFIED\x10\x00\x12\n\n\x06MANUAL\x10\x01\x12\r\n\tCLOUD_KMS\x10\x02:s\xea\x41p\n%cloudkms.googleapis.com/EkmConnection\x12Gprojects/{project}/locations/{location}/ekmConnections/{ekm_connection}\"\xc8\x01\n\tEkmConfig\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12M\n\x16\x64\x65\x66\x61ult_ekm_connection\x18\x02 \x01(\tB-\xe0\x41\x01\xfa\x41\'\n%cloudkms.googleapis.com/EkmConnection:Y\xea\x41V\n!cloudkms.googleapis.com/EkmConfig\x12\x31projects/{project}/locations/{location}/ekmConfig\"X\n\x19VerifyConnectivityRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%cloudkms.googleapis.com/EkmConnection\"\x1c\n\x1aVerifyConnectivityResponse2\xdc\x0b\n\nEkmService\x12\xba\x01\n\x12ListEkmConnections\x12..google.cloud.kms.v1.ListEkmConnectionsRequest\x1a/.google.cloud.kms.v1.ListEkmConnectionsResponse\"C\x82\xd3\xe4\x93\x02\x34\x12\x32/v1/{parent=projects/*/locations/*}/ekmConnections\xda\x41\x06parent\x12\xa7\x01\n\x10GetEkmConnection\x12,.google.cloud.kms.v1.GetEkmConnectionRequest\x1a\".google.cloud.kms.v1.EkmConnection\"A\x82\xd3\xe4\x93\x02\x34\x12\x32/v1/{name=projects/*/locations/*/ekmConnections/*}\xda\x41\x04name\x12\xe0\x01\n\x13\x43reateEkmConnection\x12/.google.cloud.kms.v1.CreateEkmConnectionRequest\x1a\".google.cloud.kms.v1.EkmConnection\"t\x82\xd3\xe4\x93\x02\x44\"2/v1/{parent=projects/*/locations/*}/ekmConnections:\x0e\x65km_connection\xda\x41\'parent,ekm_connection_id,ekm_connection\x12\xe2\x01\n\x13UpdateEkmConnection\x12/.google.cloud.kms.v1.UpdateEkmConnectionRequest\x1a\".google.cloud.kms.v1.EkmConnection\"v\x82\xd3\xe4\x93\x02S2A/v1/{ekm_connection.name=projects/*/locations/*/ekmConnections/*}:\x0e\x65km_connection\xda\x41\x1a\x65km_connection,update_mask\x12\x94\x01\n\x0cGetEkmConfig\x12(.google.cloud.kms.v1.GetEkmConfigRequest\x1a\x1e.google.cloud.kms.v1.EkmConfig\":\x82\xd3\xe4\x93\x02-\x12+/v1/{name=projects/*/locations/*/ekmConfig}\xda\x41\x04name\x12\xc3\x01\n\x0fUpdateEkmConfig\x12+.google.cloud.kms.v1.UpdateEkmConfigRequest\x1a\x1e.google.cloud.kms.v1.EkmConfig\"c\x82\xd3\xe4\x93\x02\x44\x32\x36/v1/{ekm_config.name=projects/*/locations/*/ekmConfig}:\nekm_config\xda\x41\x16\x65km_config,update_mask\x12\xcb\x01\n\x12VerifyConnectivity\x12..google.cloud.kms.v1.VerifyConnectivityRequest\x1a/.google.cloud.kms.v1.VerifyConnectivityResponse\"T\x82\xd3\xe4\x93\x02G\x12\x45/v1/{name=projects/*/locations/*/ekmConnections/*}:verifyConnectivity\xda\x41\x04name\x1at\xca\x41\x17\x63loudkms.googleapis.com\xd2\x41Whttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloudkmsB\x85\x02\n\x17\x63om.google.cloud.kms.v1B\x0f\x45kmServiceProtoP\x01Z)cloud.google.com/go/kms/apiv1/kmspb;kmspb\xf8\x01\x01\xaa\x02\x13Google.Cloud.Kms.V1\xca\x02\x13Google\\Cloud\\Kms\\V1\xea\x41|\n\'servicedirectory.googleapis.com/Service\x12Qprojects/{project}/locations/{location}/namespaces/{namespace}/services/{service}b\x06proto3"
16
+
17
+ pool = Google::Protobuf::DescriptorPool.generated_pool
18
+
19
+ begin
20
+ pool.add_serialized_file(descriptor_data)
21
+ rescue TypeError => e
22
+ # Compatibility code: will be removed in the next major version.
23
+ require 'google/protobuf/descriptor_pb'
24
+ parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
25
+ parsed.clear_dependency
26
+ serialized = parsed.class.encode(parsed)
27
+ file = pool.add_serialized_file(serialized)
28
+ warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
29
+ imports = [
30
+ ["google.protobuf.FieldMask", "google/protobuf/field_mask.proto"],
31
+ ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"],
32
+ ]
33
+ imports.each do |type_name, expected_filename|
34
+ import_file = pool.lookup(type_name).file_descriptor
35
+ if import_file.name != expected_filename
36
+ warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
79
37
  end
80
38
  end
39
+ warn "Each proto file must use a consistent fully-qualified name."
40
+ warn "This will become an error in the next major version."
81
41
  end
82
42
 
83
43
  module Google
@@ -96,6 +56,8 @@ module Google
96
56
  EkmConnection::ServiceResolver = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.EkmConnection.ServiceResolver").msgclass
97
57
  EkmConnection::KeyManagementMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.EkmConnection.KeyManagementMode").enummodule
98
58
  EkmConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.EkmConfig").msgclass
59
+ VerifyConnectivityRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.VerifyConnectivityRequest").msgclass
60
+ VerifyConnectivityResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.kms.v1.VerifyConnectivityResponse").msgclass
99
61
  end
100
62
  end
101
63
  end
@@ -53,6 +53,12 @@ module Google
53
53
  # Updates the [EkmConfig][google.cloud.kms.v1.EkmConfig] singleton resource
54
54
  # for a given project and location.
55
55
  rpc :UpdateEkmConfig, ::Google::Cloud::Kms::V1::UpdateEkmConfigRequest, ::Google::Cloud::Kms::V1::EkmConfig
56
+ # Verifies that Cloud KMS can successfully connect to the external key
57
+ # manager specified by an [EkmConnection][google.cloud.kms.v1.EkmConnection].
58
+ # If there is an error connecting to the EKM, this method returns a
59
+ # FAILED_PRECONDITION status containing structured information as described
60
+ # at https://cloud.google.com/kms/docs/reference/ekm_errors.
61
+ rpc :VerifyConnectivity, ::Google::Cloud::Kms::V1::VerifyConnectivityRequest, ::Google::Cloud::Kms::V1::VerifyConnectivityResponse
56
62
  end
57
63
 
58
64
  Stub = Service.rpc_stub_class
@@ -260,7 +260,7 @@ module Google
260
260
  credentials = @config.credentials
261
261
  # Use self-signed JWT if the endpoint is unchanged from default,
262
262
  # but only if the default endpoint does not have a region prefix.
263
- enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
263
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
264
264
  !@config.endpoint.split(".").first.include?("-")
265
265
  credentials ||= Credentials.default scope: @config.scope,
266
266
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -3217,7 +3217,9 @@ module Google
3217
3217
  class Configuration
3218
3218
  extend ::Gapic::Config
3219
3219
 
3220
- config_attr :endpoint, "cloudkms.googleapis.com", ::String
3220
+ DEFAULT_ENDPOINT = "cloudkms.googleapis.com"
3221
+
3222
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
3221
3223
  config_attr :credentials, nil do |value|
3222
3224
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
3223
3225
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -256,7 +256,7 @@ module Google
256
256
  credentials = @config.credentials
257
257
  # Use self-signed JWT if the endpoint is unchanged from default,
258
258
  # but only if the default endpoint does not have a region prefix.
259
- enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
259
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
260
260
  !@config.endpoint.split(".").first.include?("-")
261
261
  credentials ||= Credentials.default scope: @config.scope,
262
262
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -2587,7 +2587,9 @@ module Google
2587
2587
  class Configuration
2588
2588
  extend ::Gapic::Config
2589
2589
 
2590
- config_attr :endpoint, "cloudkms.googleapis.com", ::String
2590
+ DEFAULT_ENDPOINT = "cloudkms.googleapis.com"
2591
+
2592
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
2591
2593
  config_attr :credentials, nil do |value|
2592
2594
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
2593
2595
  allowed.any? { |klass| klass === value }