google-cloud-kms-v1 0.3.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.md +188 -190
- data/README.md +66 -2
- data/lib/google/cloud/kms/v1.rb +3 -0
- data/lib/google/cloud/kms/v1/iam_policy/client.rb +14 -8
- data/lib/google/cloud/kms/v1/key_management_service/client.rb +99 -92
- data/lib/google/cloud/kms/v1/resources_pb.rb +1 -0
- data/lib/google/cloud/kms/v1/service_services_pb.rb +26 -25
- data/lib/google/cloud/kms/v1/version.rb +1 -1
- data/lib/google/iam/v1/iam_policy_services_pb.rb +4 -4
- data/proto_docs/google/api/field_behavior.rb +6 -0
- data/proto_docs/google/api/resource.rb +50 -14
- data/proto_docs/google/cloud/kms/v1/resources.rb +4 -0
- data/proto_docs/google/protobuf/timestamp.rb +10 -1
- metadata +21 -13
data/lib/google/cloud/kms/v1.rb
CHANGED
@@ -82,7 +82,7 @@ module Google
|
|
82
82
|
parent_config = while namespace.any?
|
83
83
|
parent_name = namespace.join "::"
|
84
84
|
parent_const = const_get parent_name
|
85
|
-
break parent_const.configure if parent_const
|
85
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
86
86
|
namespace.pop
|
87
87
|
end
|
88
88
|
default_config = Client::Configuration.new parent_config
|
@@ -148,7 +148,13 @@ module Google
|
|
148
148
|
|
149
149
|
# Create credentials
|
150
150
|
credentials = @config.credentials
|
151
|
-
|
151
|
+
# Use self-signed JWT if the scope and endpoint are unchanged from default,
|
152
|
+
# but only if the default endpoint does not have a region prefix.
|
153
|
+
enable_self_signed_jwt = @config.scope == Client.configure.scope &&
|
154
|
+
@config.endpoint == Client.configure.endpoint &&
|
155
|
+
!@config.endpoint.split(".").first.include?("-")
|
156
|
+
credentials ||= Credentials.default scope: @config.scope,
|
157
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
152
158
|
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
153
159
|
credentials = Credentials.new credentials, scope: @config.scope
|
154
160
|
end
|
@@ -481,7 +487,7 @@ module Google
|
|
481
487
|
config_attr :scope, nil, ::String, ::Array, nil
|
482
488
|
config_attr :lib_name, nil, ::String, nil
|
483
489
|
config_attr :lib_version, nil, ::String, nil
|
484
|
-
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
|
490
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
485
491
|
config_attr :interceptors, nil, ::Array, nil
|
486
492
|
config_attr :timeout, nil, ::Numeric, nil
|
487
493
|
config_attr :metadata, nil, ::Hash, nil
|
@@ -502,7 +508,7 @@ module Google
|
|
502
508
|
def rpcs
|
503
509
|
@rpcs ||= begin
|
504
510
|
parent_rpcs = nil
|
505
|
-
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config
|
511
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
506
512
|
Rpcs.new parent_rpcs
|
507
513
|
end
|
508
514
|
end
|
@@ -514,7 +520,7 @@ module Google
|
|
514
520
|
# Each configuration object is of type `Gapic::Config::Method` and includes
|
515
521
|
# the following configuration fields:
|
516
522
|
#
|
517
|
-
# * `timeout` (*type:* `Numeric`) - The call timeout in
|
523
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
518
524
|
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
519
525
|
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
520
526
|
# include the following keys:
|
@@ -543,11 +549,11 @@ module Google
|
|
543
549
|
|
544
550
|
# @private
|
545
551
|
def initialize parent_rpcs = nil
|
546
|
-
set_iam_policy_config = parent_rpcs
|
552
|
+
set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy
|
547
553
|
@set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
|
548
|
-
get_iam_policy_config = parent_rpcs
|
554
|
+
get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy
|
549
555
|
@get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
|
550
|
-
test_iam_permissions_config = parent_rpcs
|
556
|
+
test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions
|
551
557
|
@test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config
|
552
558
|
|
553
559
|
yield self if block_given?
|
@@ -71,7 +71,7 @@ module Google
|
|
71
71
|
parent_config = while namespace.any?
|
72
72
|
parent_name = namespace.join "::"
|
73
73
|
parent_const = const_get parent_name
|
74
|
-
break parent_const.configure if parent_const
|
74
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
75
75
|
namespace.pop
|
76
76
|
end
|
77
77
|
default_config = Client::Configuration.new parent_config
|
@@ -79,89 +79,89 @@ module Google
|
|
79
79
|
default_config.rpcs.list_key_rings.timeout = 60.0
|
80
80
|
default_config.rpcs.list_key_rings.retry_policy = {
|
81
81
|
initial_delay: 0.1,
|
82
|
-
|
83
|
-
|
84
|
-
|
82
|
+
max_delay: 60.0,
|
83
|
+
multiplier: 1.3,
|
84
|
+
retry_codes: [14, 4]
|
85
85
|
}
|
86
86
|
|
87
87
|
default_config.rpcs.list_crypto_keys.timeout = 60.0
|
88
88
|
default_config.rpcs.list_crypto_keys.retry_policy = {
|
89
89
|
initial_delay: 0.1,
|
90
|
-
|
91
|
-
|
92
|
-
|
90
|
+
max_delay: 60.0,
|
91
|
+
multiplier: 1.3,
|
92
|
+
retry_codes: [14, 4]
|
93
93
|
}
|
94
94
|
|
95
95
|
default_config.rpcs.list_crypto_key_versions.timeout = 60.0
|
96
96
|
default_config.rpcs.list_crypto_key_versions.retry_policy = {
|
97
97
|
initial_delay: 0.1,
|
98
|
-
|
99
|
-
|
100
|
-
|
98
|
+
max_delay: 60.0,
|
99
|
+
multiplier: 1.3,
|
100
|
+
retry_codes: [14, 4]
|
101
101
|
}
|
102
102
|
|
103
103
|
default_config.rpcs.list_import_jobs.timeout = 60.0
|
104
104
|
default_config.rpcs.list_import_jobs.retry_policy = {
|
105
105
|
initial_delay: 0.1,
|
106
|
-
|
107
|
-
|
108
|
-
|
106
|
+
max_delay: 60.0,
|
107
|
+
multiplier: 1.3,
|
108
|
+
retry_codes: [14, 4]
|
109
109
|
}
|
110
110
|
|
111
111
|
default_config.rpcs.get_key_ring.timeout = 60.0
|
112
112
|
default_config.rpcs.get_key_ring.retry_policy = {
|
113
113
|
initial_delay: 0.1,
|
114
|
-
|
115
|
-
|
116
|
-
|
114
|
+
max_delay: 60.0,
|
115
|
+
multiplier: 1.3,
|
116
|
+
retry_codes: [14, 4]
|
117
117
|
}
|
118
118
|
|
119
119
|
default_config.rpcs.get_crypto_key.timeout = 60.0
|
120
120
|
default_config.rpcs.get_crypto_key.retry_policy = {
|
121
121
|
initial_delay: 0.1,
|
122
|
-
|
123
|
-
|
124
|
-
|
122
|
+
max_delay: 60.0,
|
123
|
+
multiplier: 1.3,
|
124
|
+
retry_codes: [14, 4]
|
125
125
|
}
|
126
126
|
|
127
127
|
default_config.rpcs.get_crypto_key_version.timeout = 60.0
|
128
128
|
default_config.rpcs.get_crypto_key_version.retry_policy = {
|
129
129
|
initial_delay: 0.1,
|
130
|
-
|
131
|
-
|
132
|
-
|
130
|
+
max_delay: 60.0,
|
131
|
+
multiplier: 1.3,
|
132
|
+
retry_codes: [14, 4]
|
133
133
|
}
|
134
134
|
|
135
135
|
default_config.rpcs.get_public_key.timeout = 60.0
|
136
136
|
default_config.rpcs.get_public_key.retry_policy = {
|
137
137
|
initial_delay: 0.1,
|
138
|
-
|
139
|
-
|
140
|
-
|
138
|
+
max_delay: 60.0,
|
139
|
+
multiplier: 1.3,
|
140
|
+
retry_codes: [14, 4]
|
141
141
|
}
|
142
142
|
|
143
143
|
default_config.rpcs.get_import_job.timeout = 60.0
|
144
144
|
default_config.rpcs.get_import_job.retry_policy = {
|
145
145
|
initial_delay: 0.1,
|
146
|
-
|
147
|
-
|
148
|
-
|
146
|
+
max_delay: 60.0,
|
147
|
+
multiplier: 1.3,
|
148
|
+
retry_codes: [14, 4]
|
149
149
|
}
|
150
150
|
|
151
151
|
default_config.rpcs.create_key_ring.timeout = 60.0
|
152
152
|
default_config.rpcs.create_key_ring.retry_policy = {
|
153
153
|
initial_delay: 0.1,
|
154
|
-
|
155
|
-
|
156
|
-
|
154
|
+
max_delay: 60.0,
|
155
|
+
multiplier: 1.3,
|
156
|
+
retry_codes: [14, 4]
|
157
157
|
}
|
158
158
|
|
159
159
|
default_config.rpcs.create_crypto_key.timeout = 60.0
|
160
160
|
default_config.rpcs.create_crypto_key.retry_policy = {
|
161
161
|
initial_delay: 0.1,
|
162
|
-
|
163
|
-
|
164
|
-
|
162
|
+
max_delay: 60.0,
|
163
|
+
multiplier: 1.3,
|
164
|
+
retry_codes: [14, 4]
|
165
165
|
}
|
166
166
|
|
167
167
|
default_config.rpcs.create_crypto_key_version.timeout = 60.0
|
@@ -171,81 +171,81 @@ module Google
|
|
171
171
|
default_config.rpcs.create_import_job.timeout = 60.0
|
172
172
|
default_config.rpcs.create_import_job.retry_policy = {
|
173
173
|
initial_delay: 0.1,
|
174
|
-
|
175
|
-
|
176
|
-
|
174
|
+
max_delay: 60.0,
|
175
|
+
multiplier: 1.3,
|
176
|
+
retry_codes: [14, 4]
|
177
177
|
}
|
178
178
|
|
179
179
|
default_config.rpcs.update_crypto_key.timeout = 60.0
|
180
180
|
default_config.rpcs.update_crypto_key.retry_policy = {
|
181
181
|
initial_delay: 0.1,
|
182
|
-
|
183
|
-
|
184
|
-
|
182
|
+
max_delay: 60.0,
|
183
|
+
multiplier: 1.3,
|
184
|
+
retry_codes: [14, 4]
|
185
185
|
}
|
186
186
|
|
187
187
|
default_config.rpcs.update_crypto_key_version.timeout = 60.0
|
188
188
|
default_config.rpcs.update_crypto_key_version.retry_policy = {
|
189
189
|
initial_delay: 0.1,
|
190
|
-
|
191
|
-
|
192
|
-
|
190
|
+
max_delay: 60.0,
|
191
|
+
multiplier: 1.3,
|
192
|
+
retry_codes: [14, 4]
|
193
193
|
}
|
194
194
|
|
195
195
|
default_config.rpcs.encrypt.timeout = 60.0
|
196
196
|
default_config.rpcs.encrypt.retry_policy = {
|
197
197
|
initial_delay: 0.1,
|
198
|
-
|
199
|
-
|
200
|
-
|
198
|
+
max_delay: 60.0,
|
199
|
+
multiplier: 1.3,
|
200
|
+
retry_codes: [14, 4]
|
201
201
|
}
|
202
202
|
|
203
203
|
default_config.rpcs.decrypt.timeout = 60.0
|
204
204
|
default_config.rpcs.decrypt.retry_policy = {
|
205
205
|
initial_delay: 0.1,
|
206
|
-
|
207
|
-
|
208
|
-
|
206
|
+
max_delay: 60.0,
|
207
|
+
multiplier: 1.3,
|
208
|
+
retry_codes: [14, 4]
|
209
209
|
}
|
210
210
|
|
211
211
|
default_config.rpcs.asymmetric_sign.timeout = 60.0
|
212
212
|
default_config.rpcs.asymmetric_sign.retry_policy = {
|
213
213
|
initial_delay: 0.1,
|
214
|
-
|
215
|
-
|
216
|
-
|
214
|
+
max_delay: 60.0,
|
215
|
+
multiplier: 1.3,
|
216
|
+
retry_codes: [14, 4]
|
217
217
|
}
|
218
218
|
|
219
219
|
default_config.rpcs.asymmetric_decrypt.timeout = 60.0
|
220
220
|
default_config.rpcs.asymmetric_decrypt.retry_policy = {
|
221
221
|
initial_delay: 0.1,
|
222
|
-
|
223
|
-
|
224
|
-
|
222
|
+
max_delay: 60.0,
|
223
|
+
multiplier: 1.3,
|
224
|
+
retry_codes: [14, 4]
|
225
225
|
}
|
226
226
|
|
227
227
|
default_config.rpcs.update_crypto_key_primary_version.timeout = 60.0
|
228
228
|
default_config.rpcs.update_crypto_key_primary_version.retry_policy = {
|
229
229
|
initial_delay: 0.1,
|
230
|
-
|
231
|
-
|
232
|
-
|
230
|
+
max_delay: 60.0,
|
231
|
+
multiplier: 1.3,
|
232
|
+
retry_codes: [14, 4]
|
233
233
|
}
|
234
234
|
|
235
235
|
default_config.rpcs.destroy_crypto_key_version.timeout = 60.0
|
236
236
|
default_config.rpcs.destroy_crypto_key_version.retry_policy = {
|
237
237
|
initial_delay: 0.1,
|
238
|
-
|
239
|
-
|
240
|
-
|
238
|
+
max_delay: 60.0,
|
239
|
+
multiplier: 1.3,
|
240
|
+
retry_codes: [14, 4]
|
241
241
|
}
|
242
242
|
|
243
243
|
default_config.rpcs.restore_crypto_key_version.timeout = 60.0
|
244
244
|
default_config.rpcs.restore_crypto_key_version.retry_policy = {
|
245
245
|
initial_delay: 0.1,
|
246
|
-
|
247
|
-
|
248
|
-
|
246
|
+
max_delay: 60.0,
|
247
|
+
multiplier: 1.3,
|
248
|
+
retry_codes: [14, 4]
|
249
249
|
}
|
250
250
|
|
251
251
|
default_config
|
@@ -309,7 +309,13 @@ module Google
|
|
309
309
|
|
310
310
|
# Create credentials
|
311
311
|
credentials = @config.credentials
|
312
|
-
|
312
|
+
# Use self-signed JWT if the scope and endpoint are unchanged from default,
|
313
|
+
# but only if the default endpoint does not have a region prefix.
|
314
|
+
enable_self_signed_jwt = @config.scope == Client.configure.scope &&
|
315
|
+
@config.endpoint == Client.configure.endpoint &&
|
316
|
+
!@config.endpoint.split(".").first.include?("-")
|
317
|
+
credentials ||= Credentials.default scope: @config.scope,
|
318
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
313
319
|
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
314
320
|
credentials = Credentials.new credentials, scope: @config.scope
|
315
321
|
end
|
@@ -1967,7 +1973,8 @@ module Google
|
|
1967
1973
|
##
|
1968
1974
|
# Update the version of a {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} that will be used in {::Google::Cloud::Kms::V1::KeyManagementService::Client#encrypt Encrypt}.
|
1969
1975
|
#
|
1970
|
-
# Returns an error if called on
|
1976
|
+
# Returns an error if called on a key whose purpose is not
|
1977
|
+
# {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::ENCRYPT_DECRYPT ENCRYPT_DECRYPT}.
|
1971
1978
|
#
|
1972
1979
|
# @overload update_crypto_key_primary_version(request, options = nil)
|
1973
1980
|
# Pass arguments to `update_crypto_key_primary_version` via a request object, either of type
|
@@ -2275,7 +2282,7 @@ module Google
|
|
2275
2282
|
config_attr :scope, nil, ::String, ::Array, nil
|
2276
2283
|
config_attr :lib_name, nil, ::String, nil
|
2277
2284
|
config_attr :lib_version, nil, ::String, nil
|
2278
|
-
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
|
2285
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
2279
2286
|
config_attr :interceptors, nil, ::Array, nil
|
2280
2287
|
config_attr :timeout, nil, ::Numeric, nil
|
2281
2288
|
config_attr :metadata, nil, ::Hash, nil
|
@@ -2296,7 +2303,7 @@ module Google
|
|
2296
2303
|
def rpcs
|
2297
2304
|
@rpcs ||= begin
|
2298
2305
|
parent_rpcs = nil
|
2299
|
-
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config
|
2306
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
2300
2307
|
Rpcs.new parent_rpcs
|
2301
2308
|
end
|
2302
2309
|
end
|
@@ -2308,7 +2315,7 @@ module Google
|
|
2308
2315
|
# Each configuration object is of type `Gapic::Config::Method` and includes
|
2309
2316
|
# the following configuration fields:
|
2310
2317
|
#
|
2311
|
-
# * `timeout` (*type:* `Numeric`) - The call timeout in
|
2318
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
2312
2319
|
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
2313
2320
|
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
2314
2321
|
# include the following keys:
|
@@ -2437,51 +2444,51 @@ module Google
|
|
2437
2444
|
|
2438
2445
|
# @private
|
2439
2446
|
def initialize parent_rpcs = nil
|
2440
|
-
list_key_rings_config = parent_rpcs
|
2447
|
+
list_key_rings_config = parent_rpcs.list_key_rings if parent_rpcs.respond_to? :list_key_rings
|
2441
2448
|
@list_key_rings = ::Gapic::Config::Method.new list_key_rings_config
|
2442
|
-
list_crypto_keys_config = parent_rpcs
|
2449
|
+
list_crypto_keys_config = parent_rpcs.list_crypto_keys if parent_rpcs.respond_to? :list_crypto_keys
|
2443
2450
|
@list_crypto_keys = ::Gapic::Config::Method.new list_crypto_keys_config
|
2444
|
-
list_crypto_key_versions_config = parent_rpcs
|
2451
|
+
list_crypto_key_versions_config = parent_rpcs.list_crypto_key_versions if parent_rpcs.respond_to? :list_crypto_key_versions
|
2445
2452
|
@list_crypto_key_versions = ::Gapic::Config::Method.new list_crypto_key_versions_config
|
2446
|
-
list_import_jobs_config = parent_rpcs
|
2453
|
+
list_import_jobs_config = parent_rpcs.list_import_jobs if parent_rpcs.respond_to? :list_import_jobs
|
2447
2454
|
@list_import_jobs = ::Gapic::Config::Method.new list_import_jobs_config
|
2448
|
-
get_key_ring_config = parent_rpcs
|
2455
|
+
get_key_ring_config = parent_rpcs.get_key_ring if parent_rpcs.respond_to? :get_key_ring
|
2449
2456
|
@get_key_ring = ::Gapic::Config::Method.new get_key_ring_config
|
2450
|
-
get_crypto_key_config = parent_rpcs
|
2457
|
+
get_crypto_key_config = parent_rpcs.get_crypto_key if parent_rpcs.respond_to? :get_crypto_key
|
2451
2458
|
@get_crypto_key = ::Gapic::Config::Method.new get_crypto_key_config
|
2452
|
-
get_crypto_key_version_config = parent_rpcs
|
2459
|
+
get_crypto_key_version_config = parent_rpcs.get_crypto_key_version if parent_rpcs.respond_to? :get_crypto_key_version
|
2453
2460
|
@get_crypto_key_version = ::Gapic::Config::Method.new get_crypto_key_version_config
|
2454
|
-
get_public_key_config = parent_rpcs
|
2461
|
+
get_public_key_config = parent_rpcs.get_public_key if parent_rpcs.respond_to? :get_public_key
|
2455
2462
|
@get_public_key = ::Gapic::Config::Method.new get_public_key_config
|
2456
|
-
get_import_job_config = parent_rpcs
|
2463
|
+
get_import_job_config = parent_rpcs.get_import_job if parent_rpcs.respond_to? :get_import_job
|
2457
2464
|
@get_import_job = ::Gapic::Config::Method.new get_import_job_config
|
2458
|
-
create_key_ring_config = parent_rpcs
|
2465
|
+
create_key_ring_config = parent_rpcs.create_key_ring if parent_rpcs.respond_to? :create_key_ring
|
2459
2466
|
@create_key_ring = ::Gapic::Config::Method.new create_key_ring_config
|
2460
|
-
create_crypto_key_config = parent_rpcs
|
2467
|
+
create_crypto_key_config = parent_rpcs.create_crypto_key if parent_rpcs.respond_to? :create_crypto_key
|
2461
2468
|
@create_crypto_key = ::Gapic::Config::Method.new create_crypto_key_config
|
2462
|
-
create_crypto_key_version_config = parent_rpcs
|
2469
|
+
create_crypto_key_version_config = parent_rpcs.create_crypto_key_version if parent_rpcs.respond_to? :create_crypto_key_version
|
2463
2470
|
@create_crypto_key_version = ::Gapic::Config::Method.new create_crypto_key_version_config
|
2464
|
-
import_crypto_key_version_config = parent_rpcs
|
2471
|
+
import_crypto_key_version_config = parent_rpcs.import_crypto_key_version if parent_rpcs.respond_to? :import_crypto_key_version
|
2465
2472
|
@import_crypto_key_version = ::Gapic::Config::Method.new import_crypto_key_version_config
|
2466
|
-
create_import_job_config = parent_rpcs
|
2473
|
+
create_import_job_config = parent_rpcs.create_import_job if parent_rpcs.respond_to? :create_import_job
|
2467
2474
|
@create_import_job = ::Gapic::Config::Method.new create_import_job_config
|
2468
|
-
update_crypto_key_config = parent_rpcs
|
2475
|
+
update_crypto_key_config = parent_rpcs.update_crypto_key if parent_rpcs.respond_to? :update_crypto_key
|
2469
2476
|
@update_crypto_key = ::Gapic::Config::Method.new update_crypto_key_config
|
2470
|
-
update_crypto_key_version_config = parent_rpcs
|
2477
|
+
update_crypto_key_version_config = parent_rpcs.update_crypto_key_version if parent_rpcs.respond_to? :update_crypto_key_version
|
2471
2478
|
@update_crypto_key_version = ::Gapic::Config::Method.new update_crypto_key_version_config
|
2472
|
-
encrypt_config = parent_rpcs
|
2479
|
+
encrypt_config = parent_rpcs.encrypt if parent_rpcs.respond_to? :encrypt
|
2473
2480
|
@encrypt = ::Gapic::Config::Method.new encrypt_config
|
2474
|
-
decrypt_config = parent_rpcs
|
2481
|
+
decrypt_config = parent_rpcs.decrypt if parent_rpcs.respond_to? :decrypt
|
2475
2482
|
@decrypt = ::Gapic::Config::Method.new decrypt_config
|
2476
|
-
asymmetric_sign_config = parent_rpcs
|
2483
|
+
asymmetric_sign_config = parent_rpcs.asymmetric_sign if parent_rpcs.respond_to? :asymmetric_sign
|
2477
2484
|
@asymmetric_sign = ::Gapic::Config::Method.new asymmetric_sign_config
|
2478
|
-
asymmetric_decrypt_config = parent_rpcs
|
2485
|
+
asymmetric_decrypt_config = parent_rpcs.asymmetric_decrypt if parent_rpcs.respond_to? :asymmetric_decrypt
|
2479
2486
|
@asymmetric_decrypt = ::Gapic::Config::Method.new asymmetric_decrypt_config
|
2480
|
-
update_crypto_key_primary_version_config = parent_rpcs
|
2487
|
+
update_crypto_key_primary_version_config = parent_rpcs.update_crypto_key_primary_version if parent_rpcs.respond_to? :update_crypto_key_primary_version
|
2481
2488
|
@update_crypto_key_primary_version = ::Gapic::Config::Method.new update_crypto_key_primary_version_config
|
2482
|
-
destroy_crypto_key_version_config = parent_rpcs
|
2489
|
+
destroy_crypto_key_version_config = parent_rpcs.destroy_crypto_key_version if parent_rpcs.respond_to? :destroy_crypto_key_version
|
2483
2490
|
@destroy_crypto_key_version = ::Gapic::Config::Method.new destroy_crypto_key_version_config
|
2484
|
-
restore_crypto_key_version_config = parent_rpcs
|
2491
|
+
restore_crypto_key_version_config = parent_rpcs.restore_crypto_key_version if parent_rpcs.respond_to? :restore_crypto_key_version
|
2485
2492
|
@restore_crypto_key_version = ::Gapic::Config::Method.new restore_crypto_key_version_config
|
2486
2493
|
|
2487
2494
|
yield self if block_given?
|
@@ -78,6 +78,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
78
78
|
value :RSA_DECRYPT_OAEP_4096_SHA512, 17
|
79
79
|
value :EC_SIGN_P256_SHA256, 12
|
80
80
|
value :EC_SIGN_P384_SHA384, 13
|
81
|
+
value :EC_SIGN_SECP256K1_SHA256, 31
|
81
82
|
value :EXTERNAL_SYMMETRIC_ENCRYPTION, 18
|
82
83
|
end
|
83
84
|
add_enum "google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState" do
|
@@ -38,60 +38,60 @@ module Google
|
|
38
38
|
# [Using gRPC with Cloud KMS](https://cloud.google.com/kms/docs/grpc).
|
39
39
|
class Service
|
40
40
|
|
41
|
-
include GRPC::GenericService
|
41
|
+
include ::GRPC::GenericService
|
42
42
|
|
43
43
|
self.marshal_class_method = :encode
|
44
44
|
self.unmarshal_class_method = :decode
|
45
45
|
self.service_name = 'google.cloud.kms.v1.KeyManagementService'
|
46
46
|
|
47
47
|
# Lists [KeyRings][google.cloud.kms.v1.KeyRing].
|
48
|
-
rpc :ListKeyRings, Google::Cloud::Kms::V1::ListKeyRingsRequest, Google::Cloud::Kms::V1::ListKeyRingsResponse
|
48
|
+
rpc :ListKeyRings, ::Google::Cloud::Kms::V1::ListKeyRingsRequest, ::Google::Cloud::Kms::V1::ListKeyRingsResponse
|
49
49
|
# Lists [CryptoKeys][google.cloud.kms.v1.CryptoKey].
|
50
|
-
rpc :ListCryptoKeys, Google::Cloud::Kms::V1::ListCryptoKeysRequest, Google::Cloud::Kms::V1::ListCryptoKeysResponse
|
50
|
+
rpc :ListCryptoKeys, ::Google::Cloud::Kms::V1::ListCryptoKeysRequest, ::Google::Cloud::Kms::V1::ListCryptoKeysResponse
|
51
51
|
# Lists [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion].
|
52
|
-
rpc :ListCryptoKeyVersions, Google::Cloud::Kms::V1::ListCryptoKeyVersionsRequest, Google::Cloud::Kms::V1::ListCryptoKeyVersionsResponse
|
52
|
+
rpc :ListCryptoKeyVersions, ::Google::Cloud::Kms::V1::ListCryptoKeyVersionsRequest, ::Google::Cloud::Kms::V1::ListCryptoKeyVersionsResponse
|
53
53
|
# Lists [ImportJobs][google.cloud.kms.v1.ImportJob].
|
54
|
-
rpc :ListImportJobs, Google::Cloud::Kms::V1::ListImportJobsRequest, Google::Cloud::Kms::V1::ListImportJobsResponse
|
54
|
+
rpc :ListImportJobs, ::Google::Cloud::Kms::V1::ListImportJobsRequest, ::Google::Cloud::Kms::V1::ListImportJobsResponse
|
55
55
|
# Returns metadata for a given [KeyRing][google.cloud.kms.v1.KeyRing].
|
56
|
-
rpc :GetKeyRing, Google::Cloud::Kms::V1::GetKeyRingRequest, Google::Cloud::Kms::V1::KeyRing
|
56
|
+
rpc :GetKeyRing, ::Google::Cloud::Kms::V1::GetKeyRingRequest, ::Google::Cloud::Kms::V1::KeyRing
|
57
57
|
# Returns metadata for a given [CryptoKey][google.cloud.kms.v1.CryptoKey], as well as its
|
58
58
|
# [primary][google.cloud.kms.v1.CryptoKey.primary] [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].
|
59
|
-
rpc :GetCryptoKey, Google::Cloud::Kms::V1::GetCryptoKeyRequest, Google::Cloud::Kms::V1::CryptoKey
|
59
|
+
rpc :GetCryptoKey, ::Google::Cloud::Kms::V1::GetCryptoKeyRequest, ::Google::Cloud::Kms::V1::CryptoKey
|
60
60
|
# Returns metadata for a given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].
|
61
|
-
rpc :GetCryptoKeyVersion, Google::Cloud::Kms::V1::GetCryptoKeyVersionRequest, Google::Cloud::Kms::V1::CryptoKeyVersion
|
61
|
+
rpc :GetCryptoKeyVersion, ::Google::Cloud::Kms::V1::GetCryptoKeyVersionRequest, ::Google::Cloud::Kms::V1::CryptoKeyVersion
|
62
62
|
# Returns the public key for the given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. The
|
63
63
|
# [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be
|
64
64
|
# [ASYMMETRIC_SIGN][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_SIGN] or
|
65
65
|
# [ASYMMETRIC_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_DECRYPT].
|
66
|
-
rpc :GetPublicKey, Google::Cloud::Kms::V1::GetPublicKeyRequest, Google::Cloud::Kms::V1::PublicKey
|
66
|
+
rpc :GetPublicKey, ::Google::Cloud::Kms::V1::GetPublicKeyRequest, ::Google::Cloud::Kms::V1::PublicKey
|
67
67
|
# Returns metadata for a given [ImportJob][google.cloud.kms.v1.ImportJob].
|
68
|
-
rpc :GetImportJob, Google::Cloud::Kms::V1::GetImportJobRequest, Google::Cloud::Kms::V1::ImportJob
|
68
|
+
rpc :GetImportJob, ::Google::Cloud::Kms::V1::GetImportJobRequest, ::Google::Cloud::Kms::V1::ImportJob
|
69
69
|
# Create a new [KeyRing][google.cloud.kms.v1.KeyRing] in a given Project and Location.
|
70
|
-
rpc :CreateKeyRing, Google::Cloud::Kms::V1::CreateKeyRingRequest, Google::Cloud::Kms::V1::KeyRing
|
70
|
+
rpc :CreateKeyRing, ::Google::Cloud::Kms::V1::CreateKeyRingRequest, ::Google::Cloud::Kms::V1::KeyRing
|
71
71
|
# Create a new [CryptoKey][google.cloud.kms.v1.CryptoKey] within a [KeyRing][google.cloud.kms.v1.KeyRing].
|
72
72
|
#
|
73
73
|
# [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] and
|
74
74
|
# [CryptoKey.version_template.algorithm][google.cloud.kms.v1.CryptoKeyVersionTemplate.algorithm]
|
75
75
|
# are required.
|
76
|
-
rpc :CreateCryptoKey, Google::Cloud::Kms::V1::CreateCryptoKeyRequest, Google::Cloud::Kms::V1::CryptoKey
|
76
|
+
rpc :CreateCryptoKey, ::Google::Cloud::Kms::V1::CreateCryptoKeyRequest, ::Google::Cloud::Kms::V1::CryptoKey
|
77
77
|
# Create a new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in a [CryptoKey][google.cloud.kms.v1.CryptoKey].
|
78
78
|
#
|
79
79
|
# The server will assign the next sequential id. If unset,
|
80
80
|
# [state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to
|
81
81
|
# [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED].
|
82
|
-
rpc :CreateCryptoKeyVersion, Google::Cloud::Kms::V1::CreateCryptoKeyVersionRequest, Google::Cloud::Kms::V1::CryptoKeyVersion
|
82
|
+
rpc :CreateCryptoKeyVersion, ::Google::Cloud::Kms::V1::CreateCryptoKeyVersionRequest, ::Google::Cloud::Kms::V1::CryptoKeyVersion
|
83
83
|
# Imports a new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] into an existing [CryptoKey][google.cloud.kms.v1.CryptoKey] using the
|
84
84
|
# wrapped key material provided in the request.
|
85
85
|
#
|
86
86
|
# The version ID will be assigned the next sequential id within the
|
87
87
|
# [CryptoKey][google.cloud.kms.v1.CryptoKey].
|
88
|
-
rpc :ImportCryptoKeyVersion, Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest, Google::Cloud::Kms::V1::CryptoKeyVersion
|
88
|
+
rpc :ImportCryptoKeyVersion, ::Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest, ::Google::Cloud::Kms::V1::CryptoKeyVersion
|
89
89
|
# Create a new [ImportJob][google.cloud.kms.v1.ImportJob] within a [KeyRing][google.cloud.kms.v1.KeyRing].
|
90
90
|
#
|
91
91
|
# [ImportJob.import_method][google.cloud.kms.v1.ImportJob.import_method] is required.
|
92
|
-
rpc :CreateImportJob, Google::Cloud::Kms::V1::CreateImportJobRequest, Google::Cloud::Kms::V1::ImportJob
|
92
|
+
rpc :CreateImportJob, ::Google::Cloud::Kms::V1::CreateImportJobRequest, ::Google::Cloud::Kms::V1::ImportJob
|
93
93
|
# Update a [CryptoKey][google.cloud.kms.v1.CryptoKey].
|
94
|
-
rpc :UpdateCryptoKey, Google::Cloud::Kms::V1::UpdateCryptoKeyRequest, Google::Cloud::Kms::V1::CryptoKey
|
94
|
+
rpc :UpdateCryptoKey, ::Google::Cloud::Kms::V1::UpdateCryptoKeyRequest, ::Google::Cloud::Kms::V1::CryptoKey
|
95
95
|
# Update a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s metadata.
|
96
96
|
#
|
97
97
|
# [state][google.cloud.kms.v1.CryptoKeyVersion.state] may be changed between
|
@@ -99,26 +99,27 @@ module Google
|
|
99
99
|
# [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED] using this
|
100
100
|
# method. See [DestroyCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.DestroyCryptoKeyVersion] and [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] to
|
101
101
|
# move between other states.
|
102
|
-
rpc :UpdateCryptoKeyVersion, Google::Cloud::Kms::V1::UpdateCryptoKeyVersionRequest, Google::Cloud::Kms::V1::CryptoKeyVersion
|
102
|
+
rpc :UpdateCryptoKeyVersion, ::Google::Cloud::Kms::V1::UpdateCryptoKeyVersionRequest, ::Google::Cloud::Kms::V1::CryptoKeyVersion
|
103
103
|
# Encrypts data, so that it can only be recovered by a call to [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt].
|
104
104
|
# The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be
|
105
105
|
# [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
|
106
|
-
rpc :Encrypt, Google::Cloud::Kms::V1::EncryptRequest, Google::Cloud::Kms::V1::EncryptResponse
|
106
|
+
rpc :Encrypt, ::Google::Cloud::Kms::V1::EncryptRequest, ::Google::Cloud::Kms::V1::EncryptResponse
|
107
107
|
# Decrypts data that was protected by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose]
|
108
108
|
# must be [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
|
109
|
-
rpc :Decrypt, Google::Cloud::Kms::V1::DecryptRequest, Google::Cloud::Kms::V1::DecryptResponse
|
109
|
+
rpc :Decrypt, ::Google::Cloud::Kms::V1::DecryptRequest, ::Google::Cloud::Kms::V1::DecryptResponse
|
110
110
|
# Signs data using a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose]
|
111
111
|
# ASYMMETRIC_SIGN, producing a signature that can be verified with the public
|
112
112
|
# key retrieved from [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey].
|
113
|
-
rpc :AsymmetricSign, Google::Cloud::Kms::V1::AsymmetricSignRequest, Google::Cloud::Kms::V1::AsymmetricSignResponse
|
113
|
+
rpc :AsymmetricSign, ::Google::Cloud::Kms::V1::AsymmetricSignRequest, ::Google::Cloud::Kms::V1::AsymmetricSignResponse
|
114
114
|
# Decrypts data that was encrypted with a public key retrieved from
|
115
115
|
# [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey] corresponding to a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with
|
116
116
|
# [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] ASYMMETRIC_DECRYPT.
|
117
|
-
rpc :AsymmetricDecrypt, Google::Cloud::Kms::V1::AsymmetricDecryptRequest, Google::Cloud::Kms::V1::AsymmetricDecryptResponse
|
117
|
+
rpc :AsymmetricDecrypt, ::Google::Cloud::Kms::V1::AsymmetricDecryptRequest, ::Google::Cloud::Kms::V1::AsymmetricDecryptResponse
|
118
118
|
# Update the version of a [CryptoKey][google.cloud.kms.v1.CryptoKey] that will be used in [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt].
|
119
119
|
#
|
120
|
-
# Returns an error if called on
|
121
|
-
|
120
|
+
# Returns an error if called on a key whose purpose is not
|
121
|
+
# [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT].
|
122
|
+
rpc :UpdateCryptoKeyPrimaryVersion, ::Google::Cloud::Kms::V1::UpdateCryptoKeyPrimaryVersionRequest, ::Google::Cloud::Kms::V1::CryptoKey
|
122
123
|
# Schedule a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] for destruction.
|
123
124
|
#
|
124
125
|
# Upon calling this method, [CryptoKeyVersion.state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to
|
@@ -131,7 +132,7 @@ module Google
|
|
131
132
|
#
|
132
133
|
# Before the [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] is reached,
|
133
134
|
# [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] may be called to reverse the process.
|
134
|
-
rpc :DestroyCryptoKeyVersion, Google::Cloud::Kms::V1::DestroyCryptoKeyVersionRequest, Google::Cloud::Kms::V1::CryptoKeyVersion
|
135
|
+
rpc :DestroyCryptoKeyVersion, ::Google::Cloud::Kms::V1::DestroyCryptoKeyVersionRequest, ::Google::Cloud::Kms::V1::CryptoKeyVersion
|
135
136
|
# Restore a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the
|
136
137
|
# [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED]
|
137
138
|
# state.
|
@@ -139,7 +140,7 @@ module Google
|
|
139
140
|
# Upon restoration of the CryptoKeyVersion, [state][google.cloud.kms.v1.CryptoKeyVersion.state]
|
140
141
|
# will be set to [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED],
|
141
142
|
# and [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] will be cleared.
|
142
|
-
rpc :RestoreCryptoKeyVersion, Google::Cloud::Kms::V1::RestoreCryptoKeyVersionRequest, Google::Cloud::Kms::V1::CryptoKeyVersion
|
143
|
+
rpc :RestoreCryptoKeyVersion, ::Google::Cloud::Kms::V1::RestoreCryptoKeyVersionRequest, ::Google::Cloud::Kms::V1::CryptoKeyVersion
|
143
144
|
end
|
144
145
|
|
145
146
|
Stub = Service.rpc_stub_class
|