google-cloud-kms-v1 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 +4 -4
- data/AUTHENTICATION.md +8 -8
- data/README.md +1 -1
- data/lib/google/cloud/kms/v1/iam_policy/client.rb +39 -40
- data/lib/google/cloud/kms/v1/key_management_service/client.rb +501 -249
- data/lib/google/cloud/kms/v1/resources_pb.rb +6 -0
- data/lib/google/cloud/kms/v1/service_pb.rb +59 -12
- data/lib/google/cloud/kms/v1/service_services_pb.rb +28 -16
- data/lib/google/cloud/kms/v1/version.rb +1 -1
- data/proto_docs/google/api/field_behavior.rb +7 -1
- data/proto_docs/google/cloud/kms/v1/resources.rb +30 -1
- data/proto_docs/google/cloud/kms/v1/service.rb +238 -56
- data/proto_docs/google/type/expr.rb +35 -12
- metadata +15 -10
- data/lib/google/iam/v1/iam_policy_services_pb.rb +0 -81
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7845135f0cf3cc40097a3152db01361dd968b6b1a6ac5e06a99ebce4f684315
|
4
|
+
data.tar.gz: d740419d2d65dbdc4cdc48dc32aa06ea91eb11ebb0bc6bdfe17d8d7896474fb8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 673cfaf87298951002dc3a2db9a6880b1318f427538b8b621f5e386d18b5c71eb79e7736edb227c9102342852199c6ef91ef872b8dd4aaf80c5927c3e87f3af4
|
7
|
+
data.tar.gz: 06be810e1fd03110fb34b18496ddf8229c591de93f1da7cc5d41bcf21af0d1c5f32ec8785596d2bd5b9f2f1b5f40fe13bd5e92c02c272e97b0299db0236f8fd5
|
data/AUTHENTICATION.md
CHANGED
@@ -66,11 +66,11 @@ The environment variables that google-cloud-kms-v1
|
|
66
66
|
checks for credentials are configured on the service Credentials class (such as
|
67
67
|
{::Google::Cloud::Kms::V1::KeyManagementService::Credentials}):
|
68
68
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
69
|
+
* `KMS_CREDENTIALS` - Path to JSON file, or JSON contents
|
70
|
+
* `KMS_KEYFILE` - Path to JSON file, or JSON contents
|
71
|
+
* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
|
72
|
+
* `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
|
73
|
+
* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
|
74
74
|
|
75
75
|
```ruby
|
76
76
|
require "google/cloud/kms/v1"
|
@@ -82,8 +82,8 @@ client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new
|
|
82
82
|
|
83
83
|
### Configuration
|
84
84
|
|
85
|
-
The **Credentials JSON** can be configured instead of
|
86
|
-
environment
|
85
|
+
The path to the **Credentials JSON** file can be configured instead of storing
|
86
|
+
it in an environment variable. Either on an individual client initialization:
|
87
87
|
|
88
88
|
```ruby
|
89
89
|
require "google/cloud/kms/v1"
|
@@ -93,7 +93,7 @@ client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config|
|
|
93
93
|
end
|
94
94
|
```
|
95
95
|
|
96
|
-
Or
|
96
|
+
Or globally for all clients:
|
97
97
|
|
98
98
|
```ruby
|
99
99
|
require "google/cloud/kms/v1"
|
data/README.md
CHANGED
@@ -33,7 +33,7 @@ In order to use this library, you first need to go through the following steps:
|
|
33
33
|
require "google/cloud/kms/v1"
|
34
34
|
|
35
35
|
client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new
|
36
|
-
request =
|
36
|
+
request = ::Google::Cloud::Kms::V1::ListKeyRingsRequest.new # (request fields as keyword arguments...)
|
37
37
|
response = client.list_key_rings request
|
38
38
|
```
|
39
39
|
|
@@ -63,13 +63,12 @@ module Google
|
|
63
63
|
# See {::Google::Cloud::Kms::V1::IAMPolicy::Client::Configuration}
|
64
64
|
# for a description of the configuration fields.
|
65
65
|
#
|
66
|
-
#
|
66
|
+
# @example
|
67
67
|
#
|
68
|
-
#
|
69
|
-
#
|
70
|
-
#
|
71
|
-
#
|
72
|
-
# end
|
68
|
+
# # Modify the configuration for all IAMPolicy clients
|
69
|
+
# ::Google::Cloud::Kms::V1::IAMPolicy::Client.configure do |config|
|
70
|
+
# config.timeout = 10.0
|
71
|
+
# end
|
73
72
|
#
|
74
73
|
# @yield [config] Configure the Client client.
|
75
74
|
# @yieldparam config [Client::Configuration]
|
@@ -116,19 +115,15 @@ module Google
|
|
116
115
|
##
|
117
116
|
# Create a new IAMPolicy client object.
|
118
117
|
#
|
119
|
-
#
|
120
|
-
#
|
121
|
-
# To create a new IAMPolicy client with the default
|
122
|
-
# configuration:
|
123
|
-
#
|
124
|
-
# client = ::Google::Cloud::Kms::V1::IAMPolicy::Client.new
|
118
|
+
# @example
|
125
119
|
#
|
126
|
-
#
|
127
|
-
#
|
120
|
+
# # Create a client using the default configuration
|
121
|
+
# client = ::Google::Cloud::Kms::V1::IAMPolicy::Client.new
|
128
122
|
#
|
129
|
-
#
|
130
|
-
#
|
131
|
-
#
|
123
|
+
# # Create a client using a custom configuration
|
124
|
+
# client = ::Google::Cloud::Kms::V1::IAMPolicy::Client.new do |config|
|
125
|
+
# config.timeout = 10.0
|
126
|
+
# end
|
132
127
|
#
|
133
128
|
# @yield [config] Configure the IAMPolicy client.
|
134
129
|
# @yieldparam config [Client::Configuration]
|
@@ -148,14 +143,13 @@ module Google
|
|
148
143
|
|
149
144
|
# Create credentials
|
150
145
|
credentials = @config.credentials
|
151
|
-
# Use self-signed JWT if the
|
146
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
152
147
|
# but only if the default endpoint does not have a region prefix.
|
153
|
-
enable_self_signed_jwt = @config.
|
154
|
-
@config.endpoint == Client.configure.endpoint &&
|
148
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
155
149
|
!@config.endpoint.split(".").first.include?("-")
|
156
150
|
credentials ||= Credentials.default scope: @config.scope,
|
157
151
|
enable_self_signed_jwt: enable_self_signed_jwt
|
158
|
-
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
152
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
159
153
|
credentials = Credentials.new credentials, scope: @config.scope
|
160
154
|
end
|
161
155
|
@quota_project_id = @config.quota_project
|
@@ -234,7 +228,9 @@ module Google
|
|
234
228
|
options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
|
235
229
|
metadata: metadata,
|
236
230
|
retry_policy: @config.rpcs.set_iam_policy.retry_policy
|
237
|
-
|
231
|
+
|
232
|
+
options.apply_defaults timeout: @config.timeout,
|
233
|
+
metadata: @config.metadata,
|
238
234
|
retry_policy: @config.retry_policy
|
239
235
|
|
240
236
|
@iam_policy_stub.call_rpc :set_iam_policy, request, options: options do |response, operation|
|
@@ -306,7 +302,9 @@ module Google
|
|
306
302
|
options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
|
307
303
|
metadata: metadata,
|
308
304
|
retry_policy: @config.rpcs.get_iam_policy.retry_policy
|
309
|
-
|
305
|
+
|
306
|
+
options.apply_defaults timeout: @config.timeout,
|
307
|
+
metadata: @config.metadata,
|
310
308
|
retry_policy: @config.retry_policy
|
311
309
|
|
312
310
|
@iam_policy_stub.call_rpc :get_iam_policy, request, options: options do |response, operation|
|
@@ -384,7 +382,9 @@ module Google
|
|
384
382
|
options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout,
|
385
383
|
metadata: metadata,
|
386
384
|
retry_policy: @config.rpcs.test_iam_permissions.retry_policy
|
387
|
-
|
385
|
+
|
386
|
+
options.apply_defaults timeout: @config.timeout,
|
387
|
+
metadata: @config.metadata,
|
388
388
|
retry_policy: @config.retry_policy
|
389
389
|
|
390
390
|
@iam_policy_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation|
|
@@ -408,22 +408,21 @@ module Google
|
|
408
408
|
# Configuration can be applied globally to all clients, or to a single client
|
409
409
|
# on construction.
|
410
410
|
#
|
411
|
-
#
|
412
|
-
#
|
413
|
-
#
|
414
|
-
# to 20 seconds,
|
415
|
-
#
|
416
|
-
#
|
417
|
-
#
|
418
|
-
#
|
419
|
-
#
|
420
|
-
#
|
421
|
-
#
|
422
|
-
#
|
423
|
-
#
|
424
|
-
#
|
425
|
-
#
|
426
|
-
# end
|
411
|
+
# @example
|
412
|
+
#
|
413
|
+
# # Modify the global config, setting the timeout for
|
414
|
+
# # set_iam_policy to 20 seconds,
|
415
|
+
# # and all remaining timeouts to 10 seconds.
|
416
|
+
# ::Google::Cloud::Kms::V1::IAMPolicy::Client.configure do |config|
|
417
|
+
# config.timeout = 10.0
|
418
|
+
# config.rpcs.set_iam_policy.timeout = 20.0
|
419
|
+
# end
|
420
|
+
#
|
421
|
+
# # Apply the above configuration only to a new client.
|
422
|
+
# client = ::Google::Cloud::Kms::V1::IAMPolicy::Client.new do |config|
|
423
|
+
# config.timeout = 10.0
|
424
|
+
# config.rpcs.set_iam_policy.timeout = 20.0
|
425
|
+
# end
|
427
426
|
#
|
428
427
|
# @!attribute [rw] endpoint
|
429
428
|
# The hostname or hostname:port of the service endpoint.
|
@@ -52,13 +52,12 @@ module Google
|
|
52
52
|
# See {::Google::Cloud::Kms::V1::KeyManagementService::Client::Configuration}
|
53
53
|
# for a description of the configuration fields.
|
54
54
|
#
|
55
|
-
#
|
55
|
+
# @example
|
56
56
|
#
|
57
|
-
#
|
58
|
-
#
|
59
|
-
#
|
60
|
-
#
|
61
|
-
# end
|
57
|
+
# # Modify the configuration for all KeyManagementService clients
|
58
|
+
# ::Google::Cloud::Kms::V1::KeyManagementService::Client.configure do |config|
|
59
|
+
# config.timeout = 10.0
|
60
|
+
# end
|
62
61
|
#
|
63
62
|
# @yield [config] Configure the Client client.
|
64
63
|
# @yieldparam config [Client::Configuration]
|
@@ -78,90 +77,57 @@ module Google
|
|
78
77
|
|
79
78
|
default_config.rpcs.list_key_rings.timeout = 60.0
|
80
79
|
default_config.rpcs.list_key_rings.retry_policy = {
|
81
|
-
initial_delay: 0.1,
|
82
|
-
max_delay: 60.0,
|
83
|
-
multiplier: 1.3,
|
84
|
-
retry_codes: [14, 4]
|
80
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
|
85
81
|
}
|
86
82
|
|
87
83
|
default_config.rpcs.list_crypto_keys.timeout = 60.0
|
88
84
|
default_config.rpcs.list_crypto_keys.retry_policy = {
|
89
|
-
initial_delay: 0.1,
|
90
|
-
max_delay: 60.0,
|
91
|
-
multiplier: 1.3,
|
92
|
-
retry_codes: [14, 4]
|
85
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
|
93
86
|
}
|
94
87
|
|
95
88
|
default_config.rpcs.list_crypto_key_versions.timeout = 60.0
|
96
89
|
default_config.rpcs.list_crypto_key_versions.retry_policy = {
|
97
|
-
initial_delay: 0.1,
|
98
|
-
max_delay: 60.0,
|
99
|
-
multiplier: 1.3,
|
100
|
-
retry_codes: [14, 4]
|
90
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
|
101
91
|
}
|
102
92
|
|
103
93
|
default_config.rpcs.list_import_jobs.timeout = 60.0
|
104
94
|
default_config.rpcs.list_import_jobs.retry_policy = {
|
105
|
-
initial_delay: 0.1,
|
106
|
-
max_delay: 60.0,
|
107
|
-
multiplier: 1.3,
|
108
|
-
retry_codes: [14, 4]
|
95
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
|
109
96
|
}
|
110
97
|
|
111
98
|
default_config.rpcs.get_key_ring.timeout = 60.0
|
112
99
|
default_config.rpcs.get_key_ring.retry_policy = {
|
113
|
-
initial_delay: 0.1,
|
114
|
-
max_delay: 60.0,
|
115
|
-
multiplier: 1.3,
|
116
|
-
retry_codes: [14, 4]
|
100
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
|
117
101
|
}
|
118
102
|
|
119
103
|
default_config.rpcs.get_crypto_key.timeout = 60.0
|
120
104
|
default_config.rpcs.get_crypto_key.retry_policy = {
|
121
|
-
initial_delay: 0.1,
|
122
|
-
max_delay: 60.0,
|
123
|
-
multiplier: 1.3,
|
124
|
-
retry_codes: [14, 4]
|
105
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
|
125
106
|
}
|
126
107
|
|
127
108
|
default_config.rpcs.get_crypto_key_version.timeout = 60.0
|
128
109
|
default_config.rpcs.get_crypto_key_version.retry_policy = {
|
129
|
-
initial_delay: 0.1,
|
130
|
-
max_delay: 60.0,
|
131
|
-
multiplier: 1.3,
|
132
|
-
retry_codes: [14, 4]
|
110
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
|
133
111
|
}
|
134
112
|
|
135
113
|
default_config.rpcs.get_public_key.timeout = 60.0
|
136
114
|
default_config.rpcs.get_public_key.retry_policy = {
|
137
|
-
initial_delay: 0.1,
|
138
|
-
max_delay: 60.0,
|
139
|
-
multiplier: 1.3,
|
140
|
-
retry_codes: [14, 4]
|
115
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
|
141
116
|
}
|
142
117
|
|
143
118
|
default_config.rpcs.get_import_job.timeout = 60.0
|
144
119
|
default_config.rpcs.get_import_job.retry_policy = {
|
145
|
-
initial_delay: 0.1,
|
146
|
-
max_delay: 60.0,
|
147
|
-
multiplier: 1.3,
|
148
|
-
retry_codes: [14, 4]
|
120
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
|
149
121
|
}
|
150
122
|
|
151
123
|
default_config.rpcs.create_key_ring.timeout = 60.0
|
152
124
|
default_config.rpcs.create_key_ring.retry_policy = {
|
153
|
-
initial_delay: 0.1,
|
154
|
-
max_delay: 60.0,
|
155
|
-
multiplier: 1.3,
|
156
|
-
retry_codes: [14, 4]
|
125
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
|
157
126
|
}
|
158
127
|
|
159
128
|
default_config.rpcs.create_crypto_key.timeout = 60.0
|
160
129
|
default_config.rpcs.create_crypto_key.retry_policy = {
|
161
|
-
initial_delay: 0.1,
|
162
|
-
max_delay: 60.0,
|
163
|
-
multiplier: 1.3,
|
164
|
-
retry_codes: [14, 4]
|
130
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
|
165
131
|
}
|
166
132
|
|
167
133
|
default_config.rpcs.create_crypto_key_version.timeout = 60.0
|
@@ -170,82 +136,52 @@ module Google
|
|
170
136
|
|
171
137
|
default_config.rpcs.create_import_job.timeout = 60.0
|
172
138
|
default_config.rpcs.create_import_job.retry_policy = {
|
173
|
-
initial_delay: 0.1,
|
174
|
-
max_delay: 60.0,
|
175
|
-
multiplier: 1.3,
|
176
|
-
retry_codes: [14, 4]
|
139
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
|
177
140
|
}
|
178
141
|
|
179
142
|
default_config.rpcs.update_crypto_key.timeout = 60.0
|
180
143
|
default_config.rpcs.update_crypto_key.retry_policy = {
|
181
|
-
initial_delay: 0.1,
|
182
|
-
max_delay: 60.0,
|
183
|
-
multiplier: 1.3,
|
184
|
-
retry_codes: [14, 4]
|
144
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
|
185
145
|
}
|
186
146
|
|
187
147
|
default_config.rpcs.update_crypto_key_version.timeout = 60.0
|
188
148
|
default_config.rpcs.update_crypto_key_version.retry_policy = {
|
189
|
-
initial_delay: 0.1,
|
190
|
-
|
191
|
-
|
192
|
-
|
149
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
|
150
|
+
}
|
151
|
+
|
152
|
+
default_config.rpcs.update_crypto_key_primary_version.timeout = 60.0
|
153
|
+
default_config.rpcs.update_crypto_key_primary_version.retry_policy = {
|
154
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
|
155
|
+
}
|
156
|
+
|
157
|
+
default_config.rpcs.destroy_crypto_key_version.timeout = 60.0
|
158
|
+
default_config.rpcs.destroy_crypto_key_version.retry_policy = {
|
159
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
|
160
|
+
}
|
161
|
+
|
162
|
+
default_config.rpcs.restore_crypto_key_version.timeout = 60.0
|
163
|
+
default_config.rpcs.restore_crypto_key_version.retry_policy = {
|
164
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
|
193
165
|
}
|
194
166
|
|
195
167
|
default_config.rpcs.encrypt.timeout = 60.0
|
196
168
|
default_config.rpcs.encrypt.retry_policy = {
|
197
|
-
initial_delay: 0.1,
|
198
|
-
max_delay: 60.0,
|
199
|
-
multiplier: 1.3,
|
200
|
-
retry_codes: [14, 4]
|
169
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
|
201
170
|
}
|
202
171
|
|
203
172
|
default_config.rpcs.decrypt.timeout = 60.0
|
204
173
|
default_config.rpcs.decrypt.retry_policy = {
|
205
|
-
initial_delay: 0.1,
|
206
|
-
max_delay: 60.0,
|
207
|
-
multiplier: 1.3,
|
208
|
-
retry_codes: [14, 4]
|
174
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
|
209
175
|
}
|
210
176
|
|
211
177
|
default_config.rpcs.asymmetric_sign.timeout = 60.0
|
212
178
|
default_config.rpcs.asymmetric_sign.retry_policy = {
|
213
|
-
initial_delay: 0.1,
|
214
|
-
max_delay: 60.0,
|
215
|
-
multiplier: 1.3,
|
216
|
-
retry_codes: [14, 4]
|
179
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
|
217
180
|
}
|
218
181
|
|
219
182
|
default_config.rpcs.asymmetric_decrypt.timeout = 60.0
|
220
183
|
default_config.rpcs.asymmetric_decrypt.retry_policy = {
|
221
|
-
initial_delay: 0.1,
|
222
|
-
max_delay: 60.0,
|
223
|
-
multiplier: 1.3,
|
224
|
-
retry_codes: [14, 4]
|
225
|
-
}
|
226
|
-
|
227
|
-
default_config.rpcs.update_crypto_key_primary_version.timeout = 60.0
|
228
|
-
default_config.rpcs.update_crypto_key_primary_version.retry_policy = {
|
229
|
-
initial_delay: 0.1,
|
230
|
-
max_delay: 60.0,
|
231
|
-
multiplier: 1.3,
|
232
|
-
retry_codes: [14, 4]
|
233
|
-
}
|
234
|
-
|
235
|
-
default_config.rpcs.destroy_crypto_key_version.timeout = 60.0
|
236
|
-
default_config.rpcs.destroy_crypto_key_version.retry_policy = {
|
237
|
-
initial_delay: 0.1,
|
238
|
-
max_delay: 60.0,
|
239
|
-
multiplier: 1.3,
|
240
|
-
retry_codes: [14, 4]
|
241
|
-
}
|
242
|
-
|
243
|
-
default_config.rpcs.restore_crypto_key_version.timeout = 60.0
|
244
|
-
default_config.rpcs.restore_crypto_key_version.retry_policy = {
|
245
|
-
initial_delay: 0.1,
|
246
|
-
max_delay: 60.0,
|
247
|
-
multiplier: 1.3,
|
248
|
-
retry_codes: [14, 4]
|
184
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
|
249
185
|
}
|
250
186
|
|
251
187
|
default_config
|
@@ -277,19 +213,15 @@ module Google
|
|
277
213
|
##
|
278
214
|
# Create a new KeyManagementService client object.
|
279
215
|
#
|
280
|
-
#
|
281
|
-
#
|
282
|
-
# To create a new KeyManagementService client with the default
|
283
|
-
# configuration:
|
216
|
+
# @example
|
284
217
|
#
|
285
|
-
#
|
218
|
+
# # Create a client using the default configuration
|
219
|
+
# client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new
|
286
220
|
#
|
287
|
-
#
|
288
|
-
#
|
289
|
-
#
|
290
|
-
#
|
291
|
-
# config.timeout = 10.0
|
292
|
-
# end
|
221
|
+
# # Create a client using a custom configuration
|
222
|
+
# client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config|
|
223
|
+
# config.timeout = 10.0
|
224
|
+
# end
|
293
225
|
#
|
294
226
|
# @yield [config] Configure the KeyManagementService client.
|
295
227
|
# @yieldparam config [Client::Configuration]
|
@@ -309,14 +241,13 @@ module Google
|
|
309
241
|
|
310
242
|
# Create credentials
|
311
243
|
credentials = @config.credentials
|
312
|
-
# Use self-signed JWT if the
|
244
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
313
245
|
# but only if the default endpoint does not have a region prefix.
|
314
|
-
enable_self_signed_jwt = @config.
|
315
|
-
@config.endpoint == Client.configure.endpoint &&
|
246
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
316
247
|
!@config.endpoint.split(".").first.include?("-")
|
317
248
|
credentials ||= Credentials.default scope: @config.scope,
|
318
249
|
enable_self_signed_jwt: enable_self_signed_jwt
|
319
|
-
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
250
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
320
251
|
credentials = Credentials.new credentials, scope: @config.scope
|
321
252
|
end
|
322
253
|
@quota_project_id = @config.quota_project
|
@@ -407,7 +338,9 @@ module Google
|
|
407
338
|
options.apply_defaults timeout: @config.rpcs.list_key_rings.timeout,
|
408
339
|
metadata: metadata,
|
409
340
|
retry_policy: @config.rpcs.list_key_rings.retry_policy
|
410
|
-
|
341
|
+
|
342
|
+
options.apply_defaults timeout: @config.timeout,
|
343
|
+
metadata: @config.metadata,
|
411
344
|
retry_policy: @config.retry_policy
|
412
345
|
|
413
346
|
@key_management_service_stub.call_rpc :list_key_rings, request, options: options do |response, operation|
|
@@ -495,7 +428,9 @@ module Google
|
|
495
428
|
options.apply_defaults timeout: @config.rpcs.list_crypto_keys.timeout,
|
496
429
|
metadata: metadata,
|
497
430
|
retry_policy: @config.rpcs.list_crypto_keys.retry_policy
|
498
|
-
|
431
|
+
|
432
|
+
options.apply_defaults timeout: @config.timeout,
|
433
|
+
metadata: @config.metadata,
|
499
434
|
retry_policy: @config.retry_policy
|
500
435
|
|
501
436
|
@key_management_service_stub.call_rpc :list_crypto_keys, request, options: options do |response, operation|
|
@@ -584,7 +519,9 @@ module Google
|
|
584
519
|
options.apply_defaults timeout: @config.rpcs.list_crypto_key_versions.timeout,
|
585
520
|
metadata: metadata,
|
586
521
|
retry_policy: @config.rpcs.list_crypto_key_versions.retry_policy
|
587
|
-
|
522
|
+
|
523
|
+
options.apply_defaults timeout: @config.timeout,
|
524
|
+
metadata: @config.metadata,
|
588
525
|
retry_policy: @config.retry_policy
|
589
526
|
|
590
527
|
@key_management_service_stub.call_rpc :list_crypto_key_versions, request, options: options do |response, operation|
|
@@ -670,7 +607,9 @@ module Google
|
|
670
607
|
options.apply_defaults timeout: @config.rpcs.list_import_jobs.timeout,
|
671
608
|
metadata: metadata,
|
672
609
|
retry_policy: @config.rpcs.list_import_jobs.retry_policy
|
673
|
-
|
610
|
+
|
611
|
+
options.apply_defaults timeout: @config.timeout,
|
612
|
+
metadata: @config.metadata,
|
674
613
|
retry_policy: @config.retry_policy
|
675
614
|
|
676
615
|
@key_management_service_stub.call_rpc :list_import_jobs, request, options: options do |response, operation|
|
@@ -737,7 +676,9 @@ module Google
|
|
737
676
|
options.apply_defaults timeout: @config.rpcs.get_key_ring.timeout,
|
738
677
|
metadata: metadata,
|
739
678
|
retry_policy: @config.rpcs.get_key_ring.retry_policy
|
740
|
-
|
679
|
+
|
680
|
+
options.apply_defaults timeout: @config.timeout,
|
681
|
+
metadata: @config.metadata,
|
741
682
|
retry_policy: @config.retry_policy
|
742
683
|
|
743
684
|
@key_management_service_stub.call_rpc :get_key_ring, request, options: options do |response, operation|
|
@@ -804,7 +745,9 @@ module Google
|
|
804
745
|
options.apply_defaults timeout: @config.rpcs.get_crypto_key.timeout,
|
805
746
|
metadata: metadata,
|
806
747
|
retry_policy: @config.rpcs.get_crypto_key.retry_policy
|
807
|
-
|
748
|
+
|
749
|
+
options.apply_defaults timeout: @config.timeout,
|
750
|
+
metadata: @config.metadata,
|
808
751
|
retry_policy: @config.retry_policy
|
809
752
|
|
810
753
|
@key_management_service_stub.call_rpc :get_crypto_key, request, options: options do |response, operation|
|
@@ -870,7 +813,9 @@ module Google
|
|
870
813
|
options.apply_defaults timeout: @config.rpcs.get_crypto_key_version.timeout,
|
871
814
|
metadata: metadata,
|
872
815
|
retry_policy: @config.rpcs.get_crypto_key_version.retry_policy
|
873
|
-
|
816
|
+
|
817
|
+
options.apply_defaults timeout: @config.timeout,
|
818
|
+
metadata: @config.metadata,
|
874
819
|
retry_policy: @config.retry_policy
|
875
820
|
|
876
821
|
@key_management_service_stub.call_rpc :get_crypto_key_version, request, options: options do |response, operation|
|
@@ -940,7 +885,9 @@ module Google
|
|
940
885
|
options.apply_defaults timeout: @config.rpcs.get_public_key.timeout,
|
941
886
|
metadata: metadata,
|
942
887
|
retry_policy: @config.rpcs.get_public_key.retry_policy
|
943
|
-
|
888
|
+
|
889
|
+
options.apply_defaults timeout: @config.timeout,
|
890
|
+
metadata: @config.metadata,
|
944
891
|
retry_policy: @config.retry_policy
|
945
892
|
|
946
893
|
@key_management_service_stub.call_rpc :get_public_key, request, options: options do |response, operation|
|
@@ -1006,7 +953,9 @@ module Google
|
|
1006
953
|
options.apply_defaults timeout: @config.rpcs.get_import_job.timeout,
|
1007
954
|
metadata: metadata,
|
1008
955
|
retry_policy: @config.rpcs.get_import_job.retry_policy
|
1009
|
-
|
956
|
+
|
957
|
+
options.apply_defaults timeout: @config.timeout,
|
958
|
+
metadata: @config.metadata,
|
1010
959
|
retry_policy: @config.retry_policy
|
1011
960
|
|
1012
961
|
@key_management_service_stub.call_rpc :get_import_job, request, options: options do |response, operation|
|
@@ -1078,7 +1027,9 @@ module Google
|
|
1078
1027
|
options.apply_defaults timeout: @config.rpcs.create_key_ring.timeout,
|
1079
1028
|
metadata: metadata,
|
1080
1029
|
retry_policy: @config.rpcs.create_key_ring.retry_policy
|
1081
|
-
|
1030
|
+
|
1031
|
+
options.apply_defaults timeout: @config.timeout,
|
1032
|
+
metadata: @config.metadata,
|
1082
1033
|
retry_policy: @config.retry_policy
|
1083
1034
|
|
1084
1035
|
@key_management_service_stub.call_rpc :create_key_ring, request, options: options do |response, operation|
|
@@ -1160,7 +1111,9 @@ module Google
|
|
1160
1111
|
options.apply_defaults timeout: @config.rpcs.create_crypto_key.timeout,
|
1161
1112
|
metadata: metadata,
|
1162
1113
|
retry_policy: @config.rpcs.create_crypto_key.retry_policy
|
1163
|
-
|
1114
|
+
|
1115
|
+
options.apply_defaults timeout: @config.timeout,
|
1116
|
+
metadata: @config.metadata,
|
1164
1117
|
retry_policy: @config.retry_policy
|
1165
1118
|
|
1166
1119
|
@key_management_service_stub.call_rpc :create_crypto_key, request, options: options do |response, operation|
|
@@ -1233,7 +1186,9 @@ module Google
|
|
1233
1186
|
options.apply_defaults timeout: @config.rpcs.create_crypto_key_version.timeout,
|
1234
1187
|
metadata: metadata,
|
1235
1188
|
retry_policy: @config.rpcs.create_crypto_key_version.retry_policy
|
1236
|
-
|
1189
|
+
|
1190
|
+
options.apply_defaults timeout: @config.timeout,
|
1191
|
+
metadata: @config.metadata,
|
1237
1192
|
retry_policy: @config.retry_policy
|
1238
1193
|
|
1239
1194
|
@key_management_service_stub.call_rpc :create_crypto_key_version, request, options: options do |response, operation|
|
@@ -1336,7 +1291,9 @@ module Google
|
|
1336
1291
|
options.apply_defaults timeout: @config.rpcs.import_crypto_key_version.timeout,
|
1337
1292
|
metadata: metadata,
|
1338
1293
|
retry_policy: @config.rpcs.import_crypto_key_version.retry_policy
|
1339
|
-
|
1294
|
+
|
1295
|
+
options.apply_defaults timeout: @config.timeout,
|
1296
|
+
metadata: @config.metadata,
|
1340
1297
|
retry_policy: @config.retry_policy
|
1341
1298
|
|
1342
1299
|
@key_management_service_stub.call_rpc :import_crypto_key_version, request, options: options do |response, operation|
|
@@ -1410,7 +1367,9 @@ module Google
|
|
1410
1367
|
options.apply_defaults timeout: @config.rpcs.create_import_job.timeout,
|
1411
1368
|
metadata: metadata,
|
1412
1369
|
retry_policy: @config.rpcs.create_import_job.retry_policy
|
1413
|
-
|
1370
|
+
|
1371
|
+
options.apply_defaults timeout: @config.timeout,
|
1372
|
+
metadata: @config.metadata,
|
1414
1373
|
retry_policy: @config.retry_policy
|
1415
1374
|
|
1416
1375
|
@key_management_service_stub.call_rpc :create_import_job, request, options: options do |response, operation|
|
@@ -1478,7 +1437,9 @@ module Google
|
|
1478
1437
|
options.apply_defaults timeout: @config.rpcs.update_crypto_key.timeout,
|
1479
1438
|
metadata: metadata,
|
1480
1439
|
retry_policy: @config.rpcs.update_crypto_key.retry_policy
|
1481
|
-
|
1440
|
+
|
1441
|
+
options.apply_defaults timeout: @config.timeout,
|
1442
|
+
metadata: @config.metadata,
|
1482
1443
|
retry_policy: @config.retry_policy
|
1483
1444
|
|
1484
1445
|
@key_management_service_stub.call_rpc :update_crypto_key, request, options: options do |response, operation|
|
@@ -1552,7 +1513,9 @@ module Google
|
|
1552
1513
|
options.apply_defaults timeout: @config.rpcs.update_crypto_key_version.timeout,
|
1553
1514
|
metadata: metadata,
|
1554
1515
|
retry_policy: @config.rpcs.update_crypto_key_version.retry_policy
|
1555
|
-
|
1516
|
+
|
1517
|
+
options.apply_defaults timeout: @config.timeout,
|
1518
|
+
metadata: @config.metadata,
|
1556
1519
|
retry_policy: @config.retry_policy
|
1557
1520
|
|
1558
1521
|
@key_management_service_stub.call_rpc :update_crypto_key_version, request, options: options do |response, operation|
|
@@ -1563,6 +1526,232 @@ module Google
|
|
1563
1526
|
raise ::Google::Cloud::Error.from_error(e)
|
1564
1527
|
end
|
1565
1528
|
|
1529
|
+
##
|
1530
|
+
# Update the version of a {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} that will be used in {::Google::Cloud::Kms::V1::KeyManagementService::Client#encrypt Encrypt}.
|
1531
|
+
#
|
1532
|
+
# Returns an error if called on a key whose purpose is not
|
1533
|
+
# {::Google::Cloud::Kms::V1::CryptoKey::CryptoKeyPurpose::ENCRYPT_DECRYPT ENCRYPT_DECRYPT}.
|
1534
|
+
#
|
1535
|
+
# @overload update_crypto_key_primary_version(request, options = nil)
|
1536
|
+
# Pass arguments to `update_crypto_key_primary_version` via a request object, either of type
|
1537
|
+
# {::Google::Cloud::Kms::V1::UpdateCryptoKeyPrimaryVersionRequest} or an equivalent Hash.
|
1538
|
+
#
|
1539
|
+
# @param request [::Google::Cloud::Kms::V1::UpdateCryptoKeyPrimaryVersionRequest, ::Hash]
|
1540
|
+
# A request object representing the call parameters. Required. To specify no
|
1541
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1542
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1543
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1544
|
+
#
|
1545
|
+
# @overload update_crypto_key_primary_version(name: nil, crypto_key_version_id: nil)
|
1546
|
+
# Pass arguments to `update_crypto_key_primary_version` via keyword arguments. Note that at
|
1547
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1548
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1549
|
+
#
|
1550
|
+
# @param name [::String]
|
1551
|
+
# Required. The resource name of the {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} to update.
|
1552
|
+
# @param crypto_key_version_id [::String]
|
1553
|
+
# Required. The id of the child {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use as primary.
|
1554
|
+
#
|
1555
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1556
|
+
# @yieldparam response [::Google::Cloud::Kms::V1::CryptoKey]
|
1557
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1558
|
+
#
|
1559
|
+
# @return [::Google::Cloud::Kms::V1::CryptoKey]
|
1560
|
+
#
|
1561
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1562
|
+
#
|
1563
|
+
def update_crypto_key_primary_version request, options = nil
|
1564
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1565
|
+
|
1566
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::UpdateCryptoKeyPrimaryVersionRequest
|
1567
|
+
|
1568
|
+
# Converts hash and nil to an options object
|
1569
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1570
|
+
|
1571
|
+
# Customize the options with defaults
|
1572
|
+
metadata = @config.rpcs.update_crypto_key_primary_version.metadata.to_h
|
1573
|
+
|
1574
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1575
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1576
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1577
|
+
gapic_version: ::Google::Cloud::Kms::V1::VERSION
|
1578
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1579
|
+
|
1580
|
+
header_params = {
|
1581
|
+
"name" => request.name
|
1582
|
+
}
|
1583
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1584
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1585
|
+
|
1586
|
+
options.apply_defaults timeout: @config.rpcs.update_crypto_key_primary_version.timeout,
|
1587
|
+
metadata: metadata,
|
1588
|
+
retry_policy: @config.rpcs.update_crypto_key_primary_version.retry_policy
|
1589
|
+
|
1590
|
+
options.apply_defaults timeout: @config.timeout,
|
1591
|
+
metadata: @config.metadata,
|
1592
|
+
retry_policy: @config.retry_policy
|
1593
|
+
|
1594
|
+
@key_management_service_stub.call_rpc :update_crypto_key_primary_version, request, options: options do |response, operation|
|
1595
|
+
yield response, operation if block_given?
|
1596
|
+
return response
|
1597
|
+
end
|
1598
|
+
rescue ::GRPC::BadStatus => e
|
1599
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1600
|
+
end
|
1601
|
+
|
1602
|
+
##
|
1603
|
+
# Schedule a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} for destruction.
|
1604
|
+
#
|
1605
|
+
# Upon calling this method, {::Google::Cloud::Kms::V1::CryptoKeyVersion#state CryptoKeyVersion.state} will be set to
|
1606
|
+
# {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DESTROY_SCHEDULED DESTROY_SCHEDULED}
|
1607
|
+
# and {::Google::Cloud::Kms::V1::CryptoKeyVersion#destroy_time destroy_time} will be set to a time 24
|
1608
|
+
# hours in the future, at which point the {::Google::Cloud::Kms::V1::CryptoKeyVersion#state state}
|
1609
|
+
# will be changed to
|
1610
|
+
# {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DESTROYED DESTROYED}, and the key
|
1611
|
+
# material will be irrevocably destroyed.
|
1612
|
+
#
|
1613
|
+
# Before the {::Google::Cloud::Kms::V1::CryptoKeyVersion#destroy_time destroy_time} is reached,
|
1614
|
+
# {::Google::Cloud::Kms::V1::KeyManagementService::Client#restore_crypto_key_version RestoreCryptoKeyVersion} may be called to reverse the process.
|
1615
|
+
#
|
1616
|
+
# @overload destroy_crypto_key_version(request, options = nil)
|
1617
|
+
# Pass arguments to `destroy_crypto_key_version` via a request object, either of type
|
1618
|
+
# {::Google::Cloud::Kms::V1::DestroyCryptoKeyVersionRequest} or an equivalent Hash.
|
1619
|
+
#
|
1620
|
+
# @param request [::Google::Cloud::Kms::V1::DestroyCryptoKeyVersionRequest, ::Hash]
|
1621
|
+
# A request object representing the call parameters. Required. To specify no
|
1622
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1623
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1624
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1625
|
+
#
|
1626
|
+
# @overload destroy_crypto_key_version(name: nil)
|
1627
|
+
# Pass arguments to `destroy_crypto_key_version` via keyword arguments. Note that at
|
1628
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1629
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1630
|
+
#
|
1631
|
+
# @param name [::String]
|
1632
|
+
# Required. The resource name of the {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to destroy.
|
1633
|
+
#
|
1634
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1635
|
+
# @yieldparam response [::Google::Cloud::Kms::V1::CryptoKeyVersion]
|
1636
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1637
|
+
#
|
1638
|
+
# @return [::Google::Cloud::Kms::V1::CryptoKeyVersion]
|
1639
|
+
#
|
1640
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1641
|
+
#
|
1642
|
+
def destroy_crypto_key_version request, options = nil
|
1643
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1644
|
+
|
1645
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::DestroyCryptoKeyVersionRequest
|
1646
|
+
|
1647
|
+
# Converts hash and nil to an options object
|
1648
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1649
|
+
|
1650
|
+
# Customize the options with defaults
|
1651
|
+
metadata = @config.rpcs.destroy_crypto_key_version.metadata.to_h
|
1652
|
+
|
1653
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1654
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1655
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1656
|
+
gapic_version: ::Google::Cloud::Kms::V1::VERSION
|
1657
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1658
|
+
|
1659
|
+
header_params = {
|
1660
|
+
"name" => request.name
|
1661
|
+
}
|
1662
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1663
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1664
|
+
|
1665
|
+
options.apply_defaults timeout: @config.rpcs.destroy_crypto_key_version.timeout,
|
1666
|
+
metadata: metadata,
|
1667
|
+
retry_policy: @config.rpcs.destroy_crypto_key_version.retry_policy
|
1668
|
+
|
1669
|
+
options.apply_defaults timeout: @config.timeout,
|
1670
|
+
metadata: @config.metadata,
|
1671
|
+
retry_policy: @config.retry_policy
|
1672
|
+
|
1673
|
+
@key_management_service_stub.call_rpc :destroy_crypto_key_version, request, options: options do |response, operation|
|
1674
|
+
yield response, operation if block_given?
|
1675
|
+
return response
|
1676
|
+
end
|
1677
|
+
rescue ::GRPC::BadStatus => e
|
1678
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1679
|
+
end
|
1680
|
+
|
1681
|
+
##
|
1682
|
+
# Restore a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} in the
|
1683
|
+
# {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DESTROY_SCHEDULED DESTROY_SCHEDULED}
|
1684
|
+
# state.
|
1685
|
+
#
|
1686
|
+
# Upon restoration of the CryptoKeyVersion, {::Google::Cloud::Kms::V1::CryptoKeyVersion#state state}
|
1687
|
+
# will be set to {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DISABLED DISABLED},
|
1688
|
+
# and {::Google::Cloud::Kms::V1::CryptoKeyVersion#destroy_time destroy_time} will be cleared.
|
1689
|
+
#
|
1690
|
+
# @overload restore_crypto_key_version(request, options = nil)
|
1691
|
+
# Pass arguments to `restore_crypto_key_version` via a request object, either of type
|
1692
|
+
# {::Google::Cloud::Kms::V1::RestoreCryptoKeyVersionRequest} or an equivalent Hash.
|
1693
|
+
#
|
1694
|
+
# @param request [::Google::Cloud::Kms::V1::RestoreCryptoKeyVersionRequest, ::Hash]
|
1695
|
+
# A request object representing the call parameters. Required. To specify no
|
1696
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1697
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1698
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1699
|
+
#
|
1700
|
+
# @overload restore_crypto_key_version(name: nil)
|
1701
|
+
# Pass arguments to `restore_crypto_key_version` via keyword arguments. Note that at
|
1702
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1703
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1704
|
+
#
|
1705
|
+
# @param name [::String]
|
1706
|
+
# Required. The resource name of the {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to restore.
|
1707
|
+
#
|
1708
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1709
|
+
# @yieldparam response [::Google::Cloud::Kms::V1::CryptoKeyVersion]
|
1710
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1711
|
+
#
|
1712
|
+
# @return [::Google::Cloud::Kms::V1::CryptoKeyVersion]
|
1713
|
+
#
|
1714
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1715
|
+
#
|
1716
|
+
def restore_crypto_key_version request, options = nil
|
1717
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1718
|
+
|
1719
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::RestoreCryptoKeyVersionRequest
|
1720
|
+
|
1721
|
+
# Converts hash and nil to an options object
|
1722
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1723
|
+
|
1724
|
+
# Customize the options with defaults
|
1725
|
+
metadata = @config.rpcs.restore_crypto_key_version.metadata.to_h
|
1726
|
+
|
1727
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1728
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1729
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1730
|
+
gapic_version: ::Google::Cloud::Kms::V1::VERSION
|
1731
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1732
|
+
|
1733
|
+
header_params = {
|
1734
|
+
"name" => request.name
|
1735
|
+
}
|
1736
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1737
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1738
|
+
|
1739
|
+
options.apply_defaults timeout: @config.rpcs.restore_crypto_key_version.timeout,
|
1740
|
+
metadata: metadata,
|
1741
|
+
retry_policy: @config.rpcs.restore_crypto_key_version.retry_policy
|
1742
|
+
|
1743
|
+
options.apply_defaults timeout: @config.timeout,
|
1744
|
+
metadata: @config.metadata,
|
1745
|
+
retry_policy: @config.retry_policy
|
1746
|
+
|
1747
|
+
@key_management_service_stub.call_rpc :restore_crypto_key_version, request, options: options do |response, operation|
|
1748
|
+
yield response, operation if block_given?
|
1749
|
+
return response
|
1750
|
+
end
|
1751
|
+
rescue ::GRPC::BadStatus => e
|
1752
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1753
|
+
end
|
1754
|
+
|
1566
1755
|
##
|
1567
1756
|
# Encrypts data, so that it can only be recovered by a call to {::Google::Cloud::Kms::V1::KeyManagementService::Client#decrypt Decrypt}.
|
1568
1757
|
# The {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose} must be
|
@@ -1622,8 +1811,6 @@ module Google
|
|
1622
1811
|
# different languages. However, it is a non-negative integer, which will
|
1623
1812
|
# never exceed 2^32-1, and can be safely downconverted to uint32 in languages
|
1624
1813
|
# that support this type.
|
1625
|
-
#
|
1626
|
-
# NOTE: This field is in Beta.
|
1627
1814
|
# @param additional_authenticated_data_crc32c [::Google::Protobuf::Int64Value, ::Hash]
|
1628
1815
|
# Optional. An optional CRC32C checksum of the
|
1629
1816
|
# {::Google::Cloud::Kms::V1::EncryptRequest#additional_authenticated_data EncryptRequest.additional_authenticated_data}. If specified,
|
@@ -1640,8 +1827,6 @@ module Google
|
|
1640
1827
|
# never exceed 2^32-1, and can be safely downconverted to uint32 in languages
|
1641
1828
|
# that support this type.
|
1642
1829
|
#
|
1643
|
-
# NOTE: This field is in Beta.
|
1644
|
-
#
|
1645
1830
|
# @yield [response, operation] Access the result along with the RPC operation
|
1646
1831
|
# @yieldparam response [::Google::Cloud::Kms::V1::EncryptResponse]
|
1647
1832
|
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
@@ -1676,7 +1861,9 @@ module Google
|
|
1676
1861
|
options.apply_defaults timeout: @config.rpcs.encrypt.timeout,
|
1677
1862
|
metadata: metadata,
|
1678
1863
|
retry_policy: @config.rpcs.encrypt.retry_policy
|
1679
|
-
|
1864
|
+
|
1865
|
+
options.apply_defaults timeout: @config.timeout,
|
1866
|
+
metadata: @config.metadata,
|
1680
1867
|
retry_policy: @config.retry_policy
|
1681
1868
|
|
1682
1869
|
@key_management_service_stub.call_rpc :encrypt, request, options: options do |response, operation|
|
@@ -1729,8 +1916,6 @@ module Google
|
|
1729
1916
|
# different languages. However, it is a non-negative integer, which will
|
1730
1917
|
# never exceed 2^32-1, and can be safely downconverted to uint32 in languages
|
1731
1918
|
# that support this type.
|
1732
|
-
#
|
1733
|
-
# NOTE: This field is in Beta.
|
1734
1919
|
# @param additional_authenticated_data_crc32c [::Google::Protobuf::Int64Value, ::Hash]
|
1735
1920
|
# Optional. An optional CRC32C checksum of the
|
1736
1921
|
# {::Google::Cloud::Kms::V1::DecryptRequest#additional_authenticated_data DecryptRequest.additional_authenticated_data}. If specified,
|
@@ -1747,8 +1932,6 @@ module Google
|
|
1747
1932
|
# never exceed 2^32-1, and can be safely downconverted to uint32 in languages
|
1748
1933
|
# that support this type.
|
1749
1934
|
#
|
1750
|
-
# NOTE: This field is in Beta.
|
1751
|
-
#
|
1752
1935
|
# @yield [response, operation] Access the result along with the RPC operation
|
1753
1936
|
# @yieldparam response [::Google::Cloud::Kms::V1::DecryptResponse]
|
1754
1937
|
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
@@ -1783,7 +1966,9 @@ module Google
|
|
1783
1966
|
options.apply_defaults timeout: @config.rpcs.decrypt.timeout,
|
1784
1967
|
metadata: metadata,
|
1785
1968
|
retry_policy: @config.rpcs.decrypt.retry_policy
|
1786
|
-
|
1969
|
+
|
1970
|
+
options.apply_defaults timeout: @config.timeout,
|
1971
|
+
metadata: @config.metadata,
|
1787
1972
|
retry_policy: @config.retry_policy
|
1788
1973
|
|
1789
1974
|
@key_management_service_stub.call_rpc :decrypt, request, options: options do |response, operation|
|
@@ -1835,8 +2020,6 @@ module Google
|
|
1835
2020
|
# never exceed 2^32-1, and can be safely downconverted to uint32 in languages
|
1836
2021
|
# that support this type.
|
1837
2022
|
#
|
1838
|
-
# NOTE: This field is in Beta.
|
1839
|
-
#
|
1840
2023
|
# @yield [response, operation] Access the result along with the RPC operation
|
1841
2024
|
# @yieldparam response [::Google::Cloud::Kms::V1::AsymmetricSignResponse]
|
1842
2025
|
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
@@ -1871,7 +2054,9 @@ module Google
|
|
1871
2054
|
options.apply_defaults timeout: @config.rpcs.asymmetric_sign.timeout,
|
1872
2055
|
metadata: metadata,
|
1873
2056
|
retry_policy: @config.rpcs.asymmetric_sign.retry_policy
|
1874
|
-
|
2057
|
+
|
2058
|
+
options.apply_defaults timeout: @config.timeout,
|
2059
|
+
metadata: @config.metadata,
|
1875
2060
|
retry_policy: @config.retry_policy
|
1876
2061
|
|
1877
2062
|
@key_management_service_stub.call_rpc :asymmetric_sign, request, options: options do |response, operation|
|
@@ -1923,8 +2108,6 @@ module Google
|
|
1923
2108
|
# never exceed 2^32-1, and can be safely downconverted to uint32 in languages
|
1924
2109
|
# that support this type.
|
1925
2110
|
#
|
1926
|
-
# NOTE: This field is in Beta.
|
1927
|
-
#
|
1928
2111
|
# @yield [response, operation] Access the result along with the RPC operation
|
1929
2112
|
# @yieldparam response [::Google::Cloud::Kms::V1::AsymmetricDecryptResponse]
|
1930
2113
|
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
@@ -1959,7 +2142,9 @@ module Google
|
|
1959
2142
|
options.apply_defaults timeout: @config.rpcs.asymmetric_decrypt.timeout,
|
1960
2143
|
metadata: metadata,
|
1961
2144
|
retry_policy: @config.rpcs.asymmetric_decrypt.retry_policy
|
1962
|
-
|
2145
|
+
|
2146
|
+
options.apply_defaults timeout: @config.timeout,
|
2147
|
+
metadata: @config.metadata,
|
1963
2148
|
retry_policy: @config.retry_policy
|
1964
2149
|
|
1965
2150
|
@key_management_service_stub.call_rpc :asymmetric_decrypt, request, options: options do |response, operation|
|
@@ -1971,48 +2156,63 @@ module Google
|
|
1971
2156
|
end
|
1972
2157
|
|
1973
2158
|
##
|
1974
|
-
#
|
2159
|
+
# Signs data using a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} with {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose}
|
2160
|
+
# MAC, producing a tag that can be verified by another source with the
|
2161
|
+
# same key.
|
1975
2162
|
#
|
1976
|
-
#
|
2163
|
+
# @overload mac_sign(request, options = nil)
|
2164
|
+
# Pass arguments to `mac_sign` via a request object, either of type
|
2165
|
+
# {::Google::Cloud::Kms::V1::MacSignRequest} or an equivalent Hash.
|
1977
2166
|
#
|
1978
|
-
#
|
1979
|
-
# Pass arguments to `update_crypto_key_primary_version` via a request object, either of type
|
1980
|
-
# {::Google::Cloud::Kms::V1::UpdateCryptoKeyPrimaryVersionRequest} or an equivalent Hash.
|
1981
|
-
#
|
1982
|
-
# @param request [::Google::Cloud::Kms::V1::UpdateCryptoKeyPrimaryVersionRequest, ::Hash]
|
2167
|
+
# @param request [::Google::Cloud::Kms::V1::MacSignRequest, ::Hash]
|
1983
2168
|
# A request object representing the call parameters. Required. To specify no
|
1984
2169
|
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1985
2170
|
# @param options [::Gapic::CallOptions, ::Hash]
|
1986
2171
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1987
2172
|
#
|
1988
|
-
# @overload
|
1989
|
-
# Pass arguments to `
|
2173
|
+
# @overload mac_sign(name: nil, data: nil, data_crc32c: nil)
|
2174
|
+
# Pass arguments to `mac_sign` via keyword arguments. Note that at
|
1990
2175
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
1991
2176
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
1992
2177
|
#
|
1993
2178
|
# @param name [::String]
|
1994
|
-
# Required. The resource name of the {::Google::Cloud::Kms::V1::
|
1995
|
-
# @param
|
1996
|
-
# Required. The
|
2179
|
+
# Required. The resource name of the {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for signing.
|
2180
|
+
# @param data [::String]
|
2181
|
+
# Required. The data to sign. The MAC tag is computed over this data field based on
|
2182
|
+
# the specific algorithm.
|
2183
|
+
# @param data_crc32c [::Google::Protobuf::Int64Value, ::Hash]
|
2184
|
+
# Optional. An optional CRC32C checksum of the {::Google::Cloud::Kms::V1::MacSignRequest#data MacSignRequest.data}. If
|
2185
|
+
# specified, {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will verify the integrity of the
|
2186
|
+
# received {::Google::Cloud::Kms::V1::MacSignRequest#data MacSignRequest.data} using this checksum.
|
2187
|
+
# {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will report an error if the checksum verification
|
2188
|
+
# fails. If you receive a checksum error, your client should verify that
|
2189
|
+
# CRC32C({::Google::Cloud::Kms::V1::MacSignRequest#data MacSignRequest.data}) is equal to
|
2190
|
+
# {::Google::Cloud::Kms::V1::MacSignRequest#data_crc32c MacSignRequest.data_crc32c}, and if so, perform a limited
|
2191
|
+
# number of retries. A persistent mismatch may indicate an issue in your
|
2192
|
+
# computation of the CRC32C checksum.
|
2193
|
+
# Note: This field is defined as int64 for reasons of compatibility across
|
2194
|
+
# different languages. However, it is a non-negative integer, which will
|
2195
|
+
# never exceed 2^32-1, and can be safely downconverted to uint32 in languages
|
2196
|
+
# that support this type.
|
1997
2197
|
#
|
1998
2198
|
# @yield [response, operation] Access the result along with the RPC operation
|
1999
|
-
# @yieldparam response [::Google::Cloud::Kms::V1::
|
2199
|
+
# @yieldparam response [::Google::Cloud::Kms::V1::MacSignResponse]
|
2000
2200
|
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2001
2201
|
#
|
2002
|
-
# @return [::Google::Cloud::Kms::V1::
|
2202
|
+
# @return [::Google::Cloud::Kms::V1::MacSignResponse]
|
2003
2203
|
#
|
2004
2204
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2005
2205
|
#
|
2006
|
-
def
|
2206
|
+
def mac_sign request, options = nil
|
2007
2207
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
2008
2208
|
|
2009
|
-
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::
|
2209
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::MacSignRequest
|
2010
2210
|
|
2011
2211
|
# Converts hash and nil to an options object
|
2012
2212
|
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2013
2213
|
|
2014
2214
|
# Customize the options with defaults
|
2015
|
-
metadata = @config.rpcs.
|
2215
|
+
metadata = @config.rpcs.mac_sign.metadata.to_h
|
2016
2216
|
|
2017
2217
|
# Set x-goog-api-client and x-goog-user-project headers
|
2018
2218
|
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
@@ -2026,13 +2226,15 @@ module Google
|
|
2026
2226
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2027
2227
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
2028
2228
|
|
2029
|
-
options.apply_defaults timeout: @config.rpcs.
|
2229
|
+
options.apply_defaults timeout: @config.rpcs.mac_sign.timeout,
|
2030
2230
|
metadata: metadata,
|
2031
|
-
retry_policy: @config.rpcs.
|
2032
|
-
|
2231
|
+
retry_policy: @config.rpcs.mac_sign.retry_policy
|
2232
|
+
|
2233
|
+
options.apply_defaults timeout: @config.timeout,
|
2234
|
+
metadata: @config.metadata,
|
2033
2235
|
retry_policy: @config.retry_policy
|
2034
2236
|
|
2035
|
-
@key_management_service_stub.call_rpc :
|
2237
|
+
@key_management_service_stub.call_rpc :mac_sign, request, options: options do |response, operation|
|
2036
2238
|
yield response, operation if block_given?
|
2037
2239
|
return response
|
2038
2240
|
end
|
@@ -2041,55 +2243,79 @@ module Google
|
|
2041
2243
|
end
|
2042
2244
|
|
2043
2245
|
##
|
2044
|
-
#
|
2045
|
-
#
|
2046
|
-
#
|
2047
|
-
# {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DESTROY_SCHEDULED DESTROY_SCHEDULED}
|
2048
|
-
# and {::Google::Cloud::Kms::V1::CryptoKeyVersion#destroy_time destroy_time} will be set to a time 24
|
2049
|
-
# hours in the future, at which point the {::Google::Cloud::Kms::V1::CryptoKeyVersion#state state}
|
2050
|
-
# will be changed to
|
2051
|
-
# {::Google::Cloud::Kms::V1::CryptoKeyVersion::CryptoKeyVersionState::DESTROYED DESTROYED}, and the key
|
2052
|
-
# material will be irrevocably destroyed.
|
2246
|
+
# Verifies MAC tag using a {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} with {::Google::Cloud::Kms::V1::CryptoKey#purpose CryptoKey.purpose}
|
2247
|
+
# MAC, and returns a response that indicates whether or not the verification
|
2248
|
+
# was successful.
|
2053
2249
|
#
|
2054
|
-
#
|
2055
|
-
#
|
2250
|
+
# @overload mac_verify(request, options = nil)
|
2251
|
+
# Pass arguments to `mac_verify` via a request object, either of type
|
2252
|
+
# {::Google::Cloud::Kms::V1::MacVerifyRequest} or an equivalent Hash.
|
2056
2253
|
#
|
2057
|
-
#
|
2058
|
-
# Pass arguments to `destroy_crypto_key_version` via a request object, either of type
|
2059
|
-
# {::Google::Cloud::Kms::V1::DestroyCryptoKeyVersionRequest} or an equivalent Hash.
|
2060
|
-
#
|
2061
|
-
# @param request [::Google::Cloud::Kms::V1::DestroyCryptoKeyVersionRequest, ::Hash]
|
2254
|
+
# @param request [::Google::Cloud::Kms::V1::MacVerifyRequest, ::Hash]
|
2062
2255
|
# A request object representing the call parameters. Required. To specify no
|
2063
2256
|
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2064
2257
|
# @param options [::Gapic::CallOptions, ::Hash]
|
2065
2258
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2066
2259
|
#
|
2067
|
-
# @overload
|
2068
|
-
# Pass arguments to `
|
2260
|
+
# @overload mac_verify(name: nil, data: nil, data_crc32c: nil, mac: nil, mac_crc32c: nil)
|
2261
|
+
# Pass arguments to `mac_verify` via keyword arguments. Note that at
|
2069
2262
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
2070
2263
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
2071
2264
|
#
|
2072
2265
|
# @param name [::String]
|
2073
|
-
# Required. The resource name of the {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to
|
2266
|
+
# Required. The resource name of the {::Google::Cloud::Kms::V1::CryptoKeyVersion CryptoKeyVersion} to use for verification.
|
2267
|
+
# @param data [::String]
|
2268
|
+
# Required. The data used previously as a {::Google::Cloud::Kms::V1::MacSignRequest#data MacSignRequest.data} to generate the MAC
|
2269
|
+
# tag.
|
2270
|
+
# @param data_crc32c [::Google::Protobuf::Int64Value, ::Hash]
|
2271
|
+
# Optional. An optional CRC32C checksum of the {::Google::Cloud::Kms::V1::MacVerifyRequest#data MacVerifyRequest.data}. If
|
2272
|
+
# specified, {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will verify the integrity of the
|
2273
|
+
# received {::Google::Cloud::Kms::V1::MacVerifyRequest#data MacVerifyRequest.data} using this checksum.
|
2274
|
+
# {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will report an error if the checksum verification
|
2275
|
+
# fails. If you receive a checksum error, your client should verify that
|
2276
|
+
# CRC32C({::Google::Cloud::Kms::V1::MacVerifyRequest#data MacVerifyRequest.data}) is equal to
|
2277
|
+
# {::Google::Cloud::Kms::V1::MacVerifyRequest#data_crc32c MacVerifyRequest.data_crc32c}, and if so, perform a limited
|
2278
|
+
# number of retries. A persistent mismatch may indicate an issue in your
|
2279
|
+
# computation of the CRC32C checksum.
|
2280
|
+
# Note: This field is defined as int64 for reasons of compatibility across
|
2281
|
+
# different languages. However, it is a non-negative integer, which will
|
2282
|
+
# never exceed 2^32-1, and can be safely downconverted to uint32 in languages
|
2283
|
+
# that support this type.
|
2284
|
+
# @param mac [::String]
|
2285
|
+
# Required. The signature to verify.
|
2286
|
+
# @param mac_crc32c [::Google::Protobuf::Int64Value, ::Hash]
|
2287
|
+
# Optional. An optional CRC32C checksum of the {::Google::Cloud::Kms::V1::MacVerifyRequest#mac MacVerifyRequest.mac}. If
|
2288
|
+
# specified, {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will verify the integrity of the
|
2289
|
+
# received {::Google::Cloud::Kms::V1::MacVerifyRequest#mac MacVerifyRequest.mac} using this checksum.
|
2290
|
+
# {::Google::Cloud::Kms::V1::KeyManagementService::Client KeyManagementService} will report an error if the checksum verification
|
2291
|
+
# fails. If you receive a checksum error, your client should verify that
|
2292
|
+
# CRC32C([MacVerifyRequest.tag][]) is equal to
|
2293
|
+
# {::Google::Cloud::Kms::V1::MacVerifyRequest#mac_crc32c MacVerifyRequest.mac_crc32c}, and if so, perform a limited
|
2294
|
+
# number of retries. A persistent mismatch may indicate an issue in your
|
2295
|
+
# computation of the CRC32C checksum.
|
2296
|
+
# Note: This field is defined as int64 for reasons of compatibility across
|
2297
|
+
# different languages. However, it is a non-negative integer, which will
|
2298
|
+
# never exceed 2^32-1, and can be safely downconverted to uint32 in languages
|
2299
|
+
# that support this type.
|
2074
2300
|
#
|
2075
2301
|
# @yield [response, operation] Access the result along with the RPC operation
|
2076
|
-
# @yieldparam response [::Google::Cloud::Kms::V1::
|
2302
|
+
# @yieldparam response [::Google::Cloud::Kms::V1::MacVerifyResponse]
|
2077
2303
|
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2078
2304
|
#
|
2079
|
-
# @return [::Google::Cloud::Kms::V1::
|
2305
|
+
# @return [::Google::Cloud::Kms::V1::MacVerifyResponse]
|
2080
2306
|
#
|
2081
2307
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2082
2308
|
#
|
2083
|
-
def
|
2309
|
+
def mac_verify request, options = nil
|
2084
2310
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
2085
2311
|
|
2086
|
-
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::
|
2312
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::MacVerifyRequest
|
2087
2313
|
|
2088
2314
|
# Converts hash and nil to an options object
|
2089
2315
|
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2090
2316
|
|
2091
2317
|
# Customize the options with defaults
|
2092
|
-
metadata = @config.rpcs.
|
2318
|
+
metadata = @config.rpcs.mac_verify.metadata.to_h
|
2093
2319
|
|
2094
2320
|
# Set x-goog-api-client and x-goog-user-project headers
|
2095
2321
|
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
@@ -2103,13 +2329,15 @@ module Google
|
|
2103
2329
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2104
2330
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
2105
2331
|
|
2106
|
-
options.apply_defaults timeout: @config.rpcs.
|
2332
|
+
options.apply_defaults timeout: @config.rpcs.mac_verify.timeout,
|
2107
2333
|
metadata: metadata,
|
2108
|
-
retry_policy: @config.rpcs.
|
2109
|
-
|
2334
|
+
retry_policy: @config.rpcs.mac_verify.retry_policy
|
2335
|
+
|
2336
|
+
options.apply_defaults timeout: @config.timeout,
|
2337
|
+
metadata: @config.metadata,
|
2110
2338
|
retry_policy: @config.retry_policy
|
2111
2339
|
|
2112
|
-
@key_management_service_stub.call_rpc :
|
2340
|
+
@key_management_service_stub.call_rpc :mac_verify, request, options: options do |response, operation|
|
2113
2341
|
yield response, operation if block_given?
|
2114
2342
|
return response
|
2115
2343
|
end
|
@@ -2118,50 +2346,52 @@ module Google
|
|
2118
2346
|
end
|
2119
2347
|
|
2120
2348
|
##
|
2121
|
-
#
|
2122
|
-
#
|
2123
|
-
# state.
|
2349
|
+
# Generate random bytes using the Cloud KMS randomness source in the provided
|
2350
|
+
# location.
|
2124
2351
|
#
|
2125
|
-
#
|
2126
|
-
#
|
2127
|
-
#
|
2128
|
-
#
|
2129
|
-
# @overload restore_crypto_key_version(request, options = nil)
|
2130
|
-
# Pass arguments to `restore_crypto_key_version` via a request object, either of type
|
2131
|
-
# {::Google::Cloud::Kms::V1::RestoreCryptoKeyVersionRequest} or an equivalent Hash.
|
2352
|
+
# @overload generate_random_bytes(request, options = nil)
|
2353
|
+
# Pass arguments to `generate_random_bytes` via a request object, either of type
|
2354
|
+
# {::Google::Cloud::Kms::V1::GenerateRandomBytesRequest} or an equivalent Hash.
|
2132
2355
|
#
|
2133
|
-
# @param request [::Google::Cloud::Kms::V1::
|
2356
|
+
# @param request [::Google::Cloud::Kms::V1::GenerateRandomBytesRequest, ::Hash]
|
2134
2357
|
# A request object representing the call parameters. Required. To specify no
|
2135
2358
|
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2136
2359
|
# @param options [::Gapic::CallOptions, ::Hash]
|
2137
2360
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2138
2361
|
#
|
2139
|
-
# @overload
|
2140
|
-
# Pass arguments to `
|
2362
|
+
# @overload generate_random_bytes(location: nil, length_bytes: nil, protection_level: nil)
|
2363
|
+
# Pass arguments to `generate_random_bytes` via keyword arguments. Note that at
|
2141
2364
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
2142
2365
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
2143
2366
|
#
|
2144
|
-
# @param
|
2145
|
-
#
|
2367
|
+
# @param location [::String]
|
2368
|
+
# The project-specific location in which to generate random bytes.
|
2369
|
+
# For example, "projects/my-project/locations/us-central1".
|
2370
|
+
# @param length_bytes [::Integer]
|
2371
|
+
# The length in bytes of the amount of randomness to retrieve. Minimum 8
|
2372
|
+
# bytes, maximum 1024 bytes.
|
2373
|
+
# @param protection_level [::Google::Cloud::Kms::V1::ProtectionLevel]
|
2374
|
+
# The {::Google::Cloud::Kms::V1::ProtectionLevel ProtectionLevel} to use when generating the random data. Defaults to
|
2375
|
+
# {::Google::Cloud::Kms::V1::ProtectionLevel::SOFTWARE SOFTWARE}.
|
2146
2376
|
#
|
2147
2377
|
# @yield [response, operation] Access the result along with the RPC operation
|
2148
|
-
# @yieldparam response [::Google::Cloud::Kms::V1::
|
2378
|
+
# @yieldparam response [::Google::Cloud::Kms::V1::GenerateRandomBytesResponse]
|
2149
2379
|
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2150
2380
|
#
|
2151
|
-
# @return [::Google::Cloud::Kms::V1::
|
2381
|
+
# @return [::Google::Cloud::Kms::V1::GenerateRandomBytesResponse]
|
2152
2382
|
#
|
2153
2383
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2154
2384
|
#
|
2155
|
-
def
|
2385
|
+
def generate_random_bytes request, options = nil
|
2156
2386
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
2157
2387
|
|
2158
|
-
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::
|
2388
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Kms::V1::GenerateRandomBytesRequest
|
2159
2389
|
|
2160
2390
|
# Converts hash and nil to an options object
|
2161
2391
|
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2162
2392
|
|
2163
2393
|
# Customize the options with defaults
|
2164
|
-
metadata = @config.rpcs.
|
2394
|
+
metadata = @config.rpcs.generate_random_bytes.metadata.to_h
|
2165
2395
|
|
2166
2396
|
# Set x-goog-api-client and x-goog-user-project headers
|
2167
2397
|
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
@@ -2170,18 +2400,20 @@ module Google
|
|
2170
2400
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2171
2401
|
|
2172
2402
|
header_params = {
|
2173
|
-
"
|
2403
|
+
"location" => request.location
|
2174
2404
|
}
|
2175
2405
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2176
2406
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
2177
2407
|
|
2178
|
-
options.apply_defaults timeout: @config.rpcs.
|
2408
|
+
options.apply_defaults timeout: @config.rpcs.generate_random_bytes.timeout,
|
2179
2409
|
metadata: metadata,
|
2180
|
-
retry_policy: @config.rpcs.
|
2181
|
-
|
2410
|
+
retry_policy: @config.rpcs.generate_random_bytes.retry_policy
|
2411
|
+
|
2412
|
+
options.apply_defaults timeout: @config.timeout,
|
2413
|
+
metadata: @config.metadata,
|
2182
2414
|
retry_policy: @config.retry_policy
|
2183
2415
|
|
2184
|
-
@key_management_service_stub.call_rpc :
|
2416
|
+
@key_management_service_stub.call_rpc :generate_random_bytes, request, options: options do |response, operation|
|
2185
2417
|
yield response, operation if block_given?
|
2186
2418
|
return response
|
2187
2419
|
end
|
@@ -2202,22 +2434,21 @@ module Google
|
|
2202
2434
|
# Configuration can be applied globally to all clients, or to a single client
|
2203
2435
|
# on construction.
|
2204
2436
|
#
|
2205
|
-
#
|
2206
|
-
#
|
2207
|
-
# To modify the global config, setting the timeout for list_key_rings
|
2208
|
-
# to 20 seconds, and all remaining timeouts to 10 seconds:
|
2437
|
+
# @example
|
2209
2438
|
#
|
2210
|
-
#
|
2211
|
-
#
|
2212
|
-
#
|
2213
|
-
#
|
2439
|
+
# # Modify the global config, setting the timeout for
|
2440
|
+
# # list_key_rings to 20 seconds,
|
2441
|
+
# # and all remaining timeouts to 10 seconds.
|
2442
|
+
# ::Google::Cloud::Kms::V1::KeyManagementService::Client.configure do |config|
|
2443
|
+
# config.timeout = 10.0
|
2444
|
+
# config.rpcs.list_key_rings.timeout = 20.0
|
2445
|
+
# end
|
2214
2446
|
#
|
2215
|
-
#
|
2216
|
-
#
|
2217
|
-
#
|
2218
|
-
#
|
2219
|
-
#
|
2220
|
-
# end
|
2447
|
+
# # Apply the above configuration only to a new client.
|
2448
|
+
# client = ::Google::Cloud::Kms::V1::KeyManagementService::Client.new do |config|
|
2449
|
+
# config.timeout = 10.0
|
2450
|
+
# config.rpcs.list_key_rings.timeout = 20.0
|
2451
|
+
# end
|
2221
2452
|
#
|
2222
2453
|
# @!attribute [rw] endpoint
|
2223
2454
|
# The hostname or hostname:port of the service endpoint.
|
@@ -2406,6 +2637,21 @@ module Google
|
|
2406
2637
|
#
|
2407
2638
|
attr_reader :update_crypto_key_version
|
2408
2639
|
##
|
2640
|
+
# RPC-specific configuration for `update_crypto_key_primary_version`
|
2641
|
+
# @return [::Gapic::Config::Method]
|
2642
|
+
#
|
2643
|
+
attr_reader :update_crypto_key_primary_version
|
2644
|
+
##
|
2645
|
+
# RPC-specific configuration for `destroy_crypto_key_version`
|
2646
|
+
# @return [::Gapic::Config::Method]
|
2647
|
+
#
|
2648
|
+
attr_reader :destroy_crypto_key_version
|
2649
|
+
##
|
2650
|
+
# RPC-specific configuration for `restore_crypto_key_version`
|
2651
|
+
# @return [::Gapic::Config::Method]
|
2652
|
+
#
|
2653
|
+
attr_reader :restore_crypto_key_version
|
2654
|
+
##
|
2409
2655
|
# RPC-specific configuration for `encrypt`
|
2410
2656
|
# @return [::Gapic::Config::Method]
|
2411
2657
|
#
|
@@ -2426,20 +2672,20 @@ module Google
|
|
2426
2672
|
#
|
2427
2673
|
attr_reader :asymmetric_decrypt
|
2428
2674
|
##
|
2429
|
-
# RPC-specific configuration for `
|
2675
|
+
# RPC-specific configuration for `mac_sign`
|
2430
2676
|
# @return [::Gapic::Config::Method]
|
2431
2677
|
#
|
2432
|
-
attr_reader :
|
2678
|
+
attr_reader :mac_sign
|
2433
2679
|
##
|
2434
|
-
# RPC-specific configuration for `
|
2680
|
+
# RPC-specific configuration for `mac_verify`
|
2435
2681
|
# @return [::Gapic::Config::Method]
|
2436
2682
|
#
|
2437
|
-
attr_reader :
|
2683
|
+
attr_reader :mac_verify
|
2438
2684
|
##
|
2439
|
-
# RPC-specific configuration for `
|
2685
|
+
# RPC-specific configuration for `generate_random_bytes`
|
2440
2686
|
# @return [::Gapic::Config::Method]
|
2441
2687
|
#
|
2442
|
-
attr_reader :
|
2688
|
+
attr_reader :generate_random_bytes
|
2443
2689
|
|
2444
2690
|
# @private
|
2445
2691
|
def initialize parent_rpcs = nil
|
@@ -2475,6 +2721,12 @@ module Google
|
|
2475
2721
|
@update_crypto_key = ::Gapic::Config::Method.new update_crypto_key_config
|
2476
2722
|
update_crypto_key_version_config = parent_rpcs.update_crypto_key_version if parent_rpcs.respond_to? :update_crypto_key_version
|
2477
2723
|
@update_crypto_key_version = ::Gapic::Config::Method.new update_crypto_key_version_config
|
2724
|
+
update_crypto_key_primary_version_config = parent_rpcs.update_crypto_key_primary_version if parent_rpcs.respond_to? :update_crypto_key_primary_version
|
2725
|
+
@update_crypto_key_primary_version = ::Gapic::Config::Method.new update_crypto_key_primary_version_config
|
2726
|
+
destroy_crypto_key_version_config = parent_rpcs.destroy_crypto_key_version if parent_rpcs.respond_to? :destroy_crypto_key_version
|
2727
|
+
@destroy_crypto_key_version = ::Gapic::Config::Method.new destroy_crypto_key_version_config
|
2728
|
+
restore_crypto_key_version_config = parent_rpcs.restore_crypto_key_version if parent_rpcs.respond_to? :restore_crypto_key_version
|
2729
|
+
@restore_crypto_key_version = ::Gapic::Config::Method.new restore_crypto_key_version_config
|
2478
2730
|
encrypt_config = parent_rpcs.encrypt if parent_rpcs.respond_to? :encrypt
|
2479
2731
|
@encrypt = ::Gapic::Config::Method.new encrypt_config
|
2480
2732
|
decrypt_config = parent_rpcs.decrypt if parent_rpcs.respond_to? :decrypt
|
@@ -2483,12 +2735,12 @@ module Google
|
|
2483
2735
|
@asymmetric_sign = ::Gapic::Config::Method.new asymmetric_sign_config
|
2484
2736
|
asymmetric_decrypt_config = parent_rpcs.asymmetric_decrypt if parent_rpcs.respond_to? :asymmetric_decrypt
|
2485
2737
|
@asymmetric_decrypt = ::Gapic::Config::Method.new asymmetric_decrypt_config
|
2486
|
-
|
2487
|
-
@
|
2488
|
-
|
2489
|
-
@
|
2490
|
-
|
2491
|
-
@
|
2738
|
+
mac_sign_config = parent_rpcs.mac_sign if parent_rpcs.respond_to? :mac_sign
|
2739
|
+
@mac_sign = ::Gapic::Config::Method.new mac_sign_config
|
2740
|
+
mac_verify_config = parent_rpcs.mac_verify if parent_rpcs.respond_to? :mac_verify
|
2741
|
+
@mac_verify = ::Gapic::Config::Method.new mac_verify_config
|
2742
|
+
generate_random_bytes_config = parent_rpcs.generate_random_bytes if parent_rpcs.respond_to? :generate_random_bytes
|
2743
|
+
@generate_random_bytes = ::Gapic::Config::Method.new generate_random_bytes_config
|
2492
2744
|
|
2493
2745
|
yield self if block_given?
|
2494
2746
|
end
|