@scaleway/sdk-key-manager 2.2.1 → 2.3.1
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.
- package/README.md +1 -1
- package/dist/_virtual/_rolldown/runtime.js +11 -0
- package/dist/index.gen.js +2 -4
- package/dist/v1alpha1/api.gen.js +252 -339
- package/dist/v1alpha1/index.gen.js +23 -21
- package/dist/v1alpha1/marshalling.gen.js +120 -194
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -83,6 +83,7 @@ const api = new KeyManager.v1.API(client)
|
|
|
83
83
|
## Support
|
|
84
84
|
|
|
85
85
|
We love feedback! Feel free to reach us on:
|
|
86
|
+
|
|
86
87
|
- [Scaleway Slack community](https://slack.scaleway.com/) - Join us on [#opensource](https://scaleway-community.slack.com/app_redirect?channel=opensource)
|
|
87
88
|
- [GitHub Issues](https://github.com/scaleway/scaleway-sdk-js/issues)
|
|
88
89
|
|
|
@@ -93,4 +94,3 @@ This repository is at its early stage and is still in active development. If you
|
|
|
93
94
|
## License
|
|
94
95
|
|
|
95
96
|
This project is Apache 2.0 licensed. See the [LICENSE](https://github.com/scaleway/scaleway-sdk-js/blob/master/LICENSE) file for details.
|
|
96
|
-
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __exportAll = (all, no_symbols) => {
|
|
3
|
+
let target = {};
|
|
4
|
+
for (var name in all) __defProp(target, name, {
|
|
5
|
+
get: all[name],
|
|
6
|
+
enumerable: true
|
|
7
|
+
});
|
|
8
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
9
|
+
return target;
|
|
10
|
+
};
|
|
11
|
+
export { __exportAll };
|
package/dist/index.gen.js
CHANGED
package/dist/v1alpha1/api.gen.js
CHANGED
|
@@ -1,340 +1,253 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
),
|
|
253
|
-
headers: jsonContentHeaders,
|
|
254
|
-
method: "POST",
|
|
255
|
-
path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/sign`
|
|
256
|
-
},
|
|
257
|
-
unmarshalSignResponse
|
|
258
|
-
);
|
|
259
|
-
/**
|
|
260
|
-
* Verify a message signature. Use a given key to verify a message signature against a message digest. The key must have its usage set to `asymmetric_signing`. The message digest must be generated using the same digest algorithm that is defined in the key's algorithm configuration.
|
|
261
|
-
*
|
|
262
|
-
* @param request - The request {@link VerifyRequest}
|
|
263
|
-
* @returns A Promise of VerifyResponse
|
|
264
|
-
*/
|
|
265
|
-
verify = (request) => this.client.fetch(
|
|
266
|
-
{
|
|
267
|
-
body: JSON.stringify(
|
|
268
|
-
marshalVerifyRequest(request, this.client.settings)
|
|
269
|
-
),
|
|
270
|
-
headers: jsonContentHeaders,
|
|
271
|
-
method: "POST",
|
|
272
|
-
path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/verify`
|
|
273
|
-
},
|
|
274
|
-
unmarshalVerifyResponse
|
|
275
|
-
);
|
|
276
|
-
/**
|
|
277
|
-
* Import key material. Import externally generated key material into Key Manager to derive a new cryptographic key. The key's origin must be `external`.
|
|
278
|
-
*
|
|
279
|
-
* @param request - The request {@link ImportKeyMaterialRequest}
|
|
280
|
-
* @returns A Promise of Key
|
|
281
|
-
*/
|
|
282
|
-
importKeyMaterial = (request) => this.client.fetch(
|
|
283
|
-
{
|
|
284
|
-
body: JSON.stringify(
|
|
285
|
-
marshalImportKeyMaterialRequest(request, this.client.settings)
|
|
286
|
-
),
|
|
287
|
-
headers: jsonContentHeaders,
|
|
288
|
-
method: "POST",
|
|
289
|
-
path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/import-key-material`
|
|
290
|
-
},
|
|
291
|
-
unmarshalKey
|
|
292
|
-
);
|
|
293
|
-
/**
|
|
294
|
-
* Delete key material. Delete previously imported key material. This renders the associated cryptographic key unusable for any operation. The key's origin must be `external`.
|
|
295
|
-
*
|
|
296
|
-
* @param request - The request {@link DeleteKeyMaterialRequest}
|
|
297
|
-
*/
|
|
298
|
-
deleteKeyMaterial = (request) => this.client.fetch(
|
|
299
|
-
{
|
|
300
|
-
body: "{}",
|
|
301
|
-
headers: jsonContentHeaders,
|
|
302
|
-
method: "POST",
|
|
303
|
-
path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/delete-key-material`
|
|
304
|
-
}
|
|
305
|
-
);
|
|
306
|
-
/**
|
|
307
|
-
* Restore a key. Restore a key and all its rotations scheduled for deletion specified by the `region` and `key_id` parameters.
|
|
308
|
-
*
|
|
309
|
-
* @param request - The request {@link RestoreKeyRequest}
|
|
310
|
-
* @returns A Promise of Key
|
|
311
|
-
*/
|
|
312
|
-
restoreKey = (request) => this.client.fetch(
|
|
313
|
-
{
|
|
314
|
-
body: "{}",
|
|
315
|
-
headers: jsonContentHeaders,
|
|
316
|
-
method: "POST",
|
|
317
|
-
path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/restore`
|
|
318
|
-
},
|
|
319
|
-
unmarshalKey
|
|
320
|
-
);
|
|
321
|
-
/**
|
|
322
|
-
* List all available algorithms. Lists all cryptographic algorithms supported by the Key Manager service.
|
|
323
|
-
*
|
|
324
|
-
* @param request - The request {@link ListAlgorithmsRequest}
|
|
325
|
-
* @returns A Promise of ListAlgorithmsResponse
|
|
326
|
-
*/
|
|
327
|
-
listAlgorithms = (request = {}) => this.client.fetch(
|
|
328
|
-
{
|
|
329
|
-
method: "GET",
|
|
330
|
-
path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/algorithms`,
|
|
331
|
-
urlParams: urlParams(
|
|
332
|
-
["usages", request.usages]
|
|
333
|
-
)
|
|
334
|
-
},
|
|
335
|
-
unmarshalListAlgorithmsResponse
|
|
336
|
-
);
|
|
337
|
-
}
|
|
338
|
-
export {
|
|
339
|
-
API
|
|
1
|
+
import { marshalCreateKeyRequest, marshalDecryptRequest, marshalEncryptRequest, marshalGenerateDataKeyRequest, marshalImportKeyMaterialRequest, marshalSignRequest, marshalUpdateKeyRequest, marshalVerifyRequest, unmarshalDataKey, unmarshalDecryptResponse, unmarshalEncryptResponse, unmarshalKey, unmarshalListAlgorithmsResponse, unmarshalListKeysResponse, unmarshalPublicKey, unmarshalSignResponse, unmarshalVerifyResponse } from "./marshalling.gen.js";
|
|
2
|
+
import { API, enrichForPagination, toApiLocality, urlParams, validatePathParam } from "@scaleway/sdk-client";
|
|
3
|
+
var jsonContentHeaders = { "Content-Type": "application/json; charset=utf-8" };
|
|
4
|
+
/**
|
|
5
|
+
* Key Manager API.
|
|
6
|
+
|
|
7
|
+
This API allows you to create, manage and use cryptographic keys in a centralized and secure service.
|
|
8
|
+
*/
|
|
9
|
+
var API$1 = class extends API {
|
|
10
|
+
/**
|
|
11
|
+
* Locality of this API.
|
|
12
|
+
* type ∈ {'zone','region','global','unspecified'}
|
|
13
|
+
*/
|
|
14
|
+
static LOCALITY = toApiLocality({ regions: [
|
|
15
|
+
"fr-par",
|
|
16
|
+
"nl-ams",
|
|
17
|
+
"pl-waw"
|
|
18
|
+
] });
|
|
19
|
+
/**
|
|
20
|
+
* Create a key. Create a key in a given region specified by the `region` parameter. You can use keys to encrypt or decrypt arbitrary payloads, to sign and verify messages or to generate data encryption keys. **Data encryption keys are not stored in Key Manager**.
|
|
21
|
+
*
|
|
22
|
+
* @param request - The request {@link CreateKeyRequest}
|
|
23
|
+
* @returns A Promise of Key
|
|
24
|
+
*/
|
|
25
|
+
createKey = (request) => this.client.fetch({
|
|
26
|
+
body: JSON.stringify(marshalCreateKeyRequest(request, this.client.settings)),
|
|
27
|
+
headers: jsonContentHeaders,
|
|
28
|
+
method: "POST",
|
|
29
|
+
path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys`
|
|
30
|
+
}, unmarshalKey);
|
|
31
|
+
/**
|
|
32
|
+
* Get key metadata. Retrieve metadata for a specified key using the `region` and `key_id` parameters.
|
|
33
|
+
*
|
|
34
|
+
* @param request - The request {@link GetKeyRequest}
|
|
35
|
+
* @returns A Promise of Key
|
|
36
|
+
*/
|
|
37
|
+
getKey = (request) => this.client.fetch({
|
|
38
|
+
method: "GET",
|
|
39
|
+
path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}`
|
|
40
|
+
}, unmarshalKey);
|
|
41
|
+
/**
|
|
42
|
+
* Get the public key in PEM format.. Retrieves the public portion of an asymmetric cryptographic key in PEM format.
|
|
43
|
+
*
|
|
44
|
+
* @param request - The request {@link GetPublicKeyRequest}
|
|
45
|
+
* @returns A Promise of PublicKey
|
|
46
|
+
*/
|
|
47
|
+
getPublicKey = (request) => this.client.fetch({
|
|
48
|
+
method: "GET",
|
|
49
|
+
path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/public-key`
|
|
50
|
+
}, unmarshalPublicKey);
|
|
51
|
+
/**
|
|
52
|
+
* Update a key. Modify a key's metadata including name, description and tags, specified by the `key_id` and `region` parameters.
|
|
53
|
+
*
|
|
54
|
+
* @param request - The request {@link UpdateKeyRequest}
|
|
55
|
+
* @returns A Promise of Key
|
|
56
|
+
*/
|
|
57
|
+
updateKey = (request) => this.client.fetch({
|
|
58
|
+
body: JSON.stringify(marshalUpdateKeyRequest(request, this.client.settings)),
|
|
59
|
+
headers: jsonContentHeaders,
|
|
60
|
+
method: "PATCH",
|
|
61
|
+
path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}`
|
|
62
|
+
}, unmarshalKey);
|
|
63
|
+
/**
|
|
64
|
+
* Delete a key. Permanently delete a key specified by the `region` and `key_id` parameters. This action is irreversible. Any data encrypted with this key, including data encryption keys, will no longer be decipherable.
|
|
65
|
+
*
|
|
66
|
+
* @param request - The request {@link DeleteKeyRequest}
|
|
67
|
+
*/
|
|
68
|
+
deleteKey = (request) => this.client.fetch({
|
|
69
|
+
method: "DELETE",
|
|
70
|
+
path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}`
|
|
71
|
+
});
|
|
72
|
+
/**
|
|
73
|
+
* Rotate a key. Generate a new version of an existing key with new key material. Previous key versions remain usable to decrypt previously encrypted data, but the key's new version will be used for subsequent encryption operations and data key generation.
|
|
74
|
+
*
|
|
75
|
+
* @param request - The request {@link RotateKeyRequest}
|
|
76
|
+
* @returns A Promise of Key
|
|
77
|
+
*/
|
|
78
|
+
rotateKey = (request) => this.client.fetch({
|
|
79
|
+
body: "{}",
|
|
80
|
+
headers: jsonContentHeaders,
|
|
81
|
+
method: "POST",
|
|
82
|
+
path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/rotate`
|
|
83
|
+
}, unmarshalKey);
|
|
84
|
+
/**
|
|
85
|
+
* Apply key protection. Apply protection to a given key specified by the `key_id` parameter. Applying key protection means that your key can be used and modified, but it cannot be deleted.
|
|
86
|
+
*
|
|
87
|
+
* @param request - The request {@link ProtectKeyRequest}
|
|
88
|
+
* @returns A Promise of Key
|
|
89
|
+
*/
|
|
90
|
+
protectKey = (request) => this.client.fetch({
|
|
91
|
+
body: "{}",
|
|
92
|
+
headers: jsonContentHeaders,
|
|
93
|
+
method: "POST",
|
|
94
|
+
path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/protect`
|
|
95
|
+
}, unmarshalKey);
|
|
96
|
+
/**
|
|
97
|
+
* Remove key protection. Remove key protection from a given key specified by the `key_id` parameter. Removing key protection means that your key can be deleted anytime.
|
|
98
|
+
*
|
|
99
|
+
* @param request - The request {@link UnprotectKeyRequest}
|
|
100
|
+
* @returns A Promise of Key
|
|
101
|
+
*/
|
|
102
|
+
unprotectKey = (request) => this.client.fetch({
|
|
103
|
+
body: "{}",
|
|
104
|
+
headers: jsonContentHeaders,
|
|
105
|
+
method: "POST",
|
|
106
|
+
path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/unprotect`
|
|
107
|
+
}, unmarshalKey);
|
|
108
|
+
/**
|
|
109
|
+
* Enable key. Enable a given key to be used for cryptographic operations. Enabling a key allows you to make a disabled key usable again. You must specify the `region` and `key_id` parameters.
|
|
110
|
+
*
|
|
111
|
+
* @param request - The request {@link EnableKeyRequest}
|
|
112
|
+
* @returns A Promise of Key
|
|
113
|
+
*/
|
|
114
|
+
enableKey = (request) => this.client.fetch({
|
|
115
|
+
body: "{}",
|
|
116
|
+
headers: jsonContentHeaders,
|
|
117
|
+
method: "POST",
|
|
118
|
+
path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/enable`
|
|
119
|
+
}, unmarshalKey);
|
|
120
|
+
/**
|
|
121
|
+
* Disable key. Disable a given key, preventing it to be used for cryptographic operations. Disabling a key renders it unusable. You must specify the `region` and `key_id` parameters.
|
|
122
|
+
*
|
|
123
|
+
* @param request - The request {@link DisableKeyRequest}
|
|
124
|
+
* @returns A Promise of Key
|
|
125
|
+
*/
|
|
126
|
+
disableKey = (request) => this.client.fetch({
|
|
127
|
+
body: "{}",
|
|
128
|
+
headers: jsonContentHeaders,
|
|
129
|
+
method: "POST",
|
|
130
|
+
path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/disable`
|
|
131
|
+
}, unmarshalKey);
|
|
132
|
+
pageOfListKeys = (request) => this.client.fetch({
|
|
133
|
+
method: "GET",
|
|
134
|
+
path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys`,
|
|
135
|
+
urlParams: urlParams(["name", request.name], ["order_by", request.orderBy], ["organization_id", request.organizationId], ["page", request.page], ["page_size", request.pageSize ?? this.client.settings.defaultPageSize], ["project_id", request.projectId], ["scheduled_for_deletion", request.scheduledForDeletion], ["tags", request.tags], ["usage", request.usage])
|
|
136
|
+
}, unmarshalListKeysResponse);
|
|
137
|
+
/**
|
|
138
|
+
* List keys. Retrieve a list of keys across all Projects in an Organization or within a specific Project. You must specify the `region`, and either the `organization_id` or the `project_id`.
|
|
139
|
+
*
|
|
140
|
+
* @param request - The request {@link ListKeysRequest}
|
|
141
|
+
* @returns A Promise of ListKeysResponse
|
|
142
|
+
*/
|
|
143
|
+
listKeys = (request) => enrichForPagination("keys", this.pageOfListKeys, request);
|
|
144
|
+
/**
|
|
145
|
+
* Create a data encryption key. Create a new data encryption key for cryptographic operations outside of Key Manager. The data encryption key is encrypted and must be decrypted using the key you have created in Key Manager.
|
|
146
|
+
|
|
147
|
+
The data encryption key is returned in plaintext and ciphertext but it should only be stored in its encrypted form (ciphertext). Key Manager does not store your data encryption key. To retrieve your key's plaintext, use the `Decrypt` method with your key's ID and ciphertext.
|
|
148
|
+
*
|
|
149
|
+
* @param request - The request {@link GenerateDataKeyRequest}
|
|
150
|
+
* @returns A Promise of DataKey
|
|
151
|
+
*/
|
|
152
|
+
generateDataKey = (request) => this.client.fetch({
|
|
153
|
+
body: JSON.stringify(marshalGenerateDataKeyRequest(request, this.client.settings)),
|
|
154
|
+
headers: jsonContentHeaders,
|
|
155
|
+
method: "POST",
|
|
156
|
+
path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/generate-data-key`
|
|
157
|
+
}, unmarshalDataKey);
|
|
158
|
+
/**
|
|
159
|
+
* Encrypt a payload. Encrypt a payload using an existing key, specified by the `key_id` parameter. The maximum payload size that can be encrypted is 64 KB of plaintext.
|
|
160
|
+
*
|
|
161
|
+
* @param request - The request {@link EncryptRequest}
|
|
162
|
+
* @returns A Promise of EncryptResponse
|
|
163
|
+
*/
|
|
164
|
+
encrypt = (request) => this.client.fetch({
|
|
165
|
+
body: JSON.stringify(marshalEncryptRequest(request, this.client.settings)),
|
|
166
|
+
headers: jsonContentHeaders,
|
|
167
|
+
method: "POST",
|
|
168
|
+
path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/encrypt`
|
|
169
|
+
}, unmarshalEncryptResponse);
|
|
170
|
+
/**
|
|
171
|
+
* Decrypt an encrypted payload. Decrypt an encrypted payload using an existing key, specified by the `key_id` parameter. The maximum payload size that can be decrypted is equivalent to the encrypted output of 64 KB of data (around 131 KB).
|
|
172
|
+
*
|
|
173
|
+
* @param request - The request {@link DecryptRequest}
|
|
174
|
+
* @returns A Promise of DecryptResponse
|
|
175
|
+
*/
|
|
176
|
+
decrypt = (request) => this.client.fetch({
|
|
177
|
+
body: JSON.stringify(marshalDecryptRequest(request, this.client.settings)),
|
|
178
|
+
headers: jsonContentHeaders,
|
|
179
|
+
method: "POST",
|
|
180
|
+
path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/decrypt`
|
|
181
|
+
}, unmarshalDecryptResponse);
|
|
182
|
+
/**
|
|
183
|
+
* Sign a message digest. Use a given key to sign a message digest. The key must have its usage set to `asymmetric_signing`. The digest must be created using the same digest algorithm that is defined in the key's algorithm configuration.
|
|
184
|
+
*
|
|
185
|
+
* @param request - The request {@link SignRequest}
|
|
186
|
+
* @returns A Promise of SignResponse
|
|
187
|
+
*/
|
|
188
|
+
sign = (request) => this.client.fetch({
|
|
189
|
+
body: JSON.stringify(marshalSignRequest(request, this.client.settings)),
|
|
190
|
+
headers: jsonContentHeaders,
|
|
191
|
+
method: "POST",
|
|
192
|
+
path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/sign`
|
|
193
|
+
}, unmarshalSignResponse);
|
|
194
|
+
/**
|
|
195
|
+
* Verify a message signature. Use a given key to verify a message signature against a message digest. The key must have its usage set to `asymmetric_signing`. The message digest must be generated using the same digest algorithm that is defined in the key's algorithm configuration.
|
|
196
|
+
*
|
|
197
|
+
* @param request - The request {@link VerifyRequest}
|
|
198
|
+
* @returns A Promise of VerifyResponse
|
|
199
|
+
*/
|
|
200
|
+
verify = (request) => this.client.fetch({
|
|
201
|
+
body: JSON.stringify(marshalVerifyRequest(request, this.client.settings)),
|
|
202
|
+
headers: jsonContentHeaders,
|
|
203
|
+
method: "POST",
|
|
204
|
+
path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/verify`
|
|
205
|
+
}, unmarshalVerifyResponse);
|
|
206
|
+
/**
|
|
207
|
+
* Import key material. Import externally generated key material into Key Manager to derive a new cryptographic key. The key's origin must be `external`.
|
|
208
|
+
*
|
|
209
|
+
* @param request - The request {@link ImportKeyMaterialRequest}
|
|
210
|
+
* @returns A Promise of Key
|
|
211
|
+
*/
|
|
212
|
+
importKeyMaterial = (request) => this.client.fetch({
|
|
213
|
+
body: JSON.stringify(marshalImportKeyMaterialRequest(request, this.client.settings)),
|
|
214
|
+
headers: jsonContentHeaders,
|
|
215
|
+
method: "POST",
|
|
216
|
+
path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/import-key-material`
|
|
217
|
+
}, unmarshalKey);
|
|
218
|
+
/**
|
|
219
|
+
* Delete key material. Delete previously imported key material. This renders the associated cryptographic key unusable for any operation. The key's origin must be `external`.
|
|
220
|
+
*
|
|
221
|
+
* @param request - The request {@link DeleteKeyMaterialRequest}
|
|
222
|
+
*/
|
|
223
|
+
deleteKeyMaterial = (request) => this.client.fetch({
|
|
224
|
+
body: "{}",
|
|
225
|
+
headers: jsonContentHeaders,
|
|
226
|
+
method: "POST",
|
|
227
|
+
path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/delete-key-material`
|
|
228
|
+
});
|
|
229
|
+
/**
|
|
230
|
+
* Restore a key. Restore a key and all its rotations scheduled for deletion specified by the `region` and `key_id` parameters.
|
|
231
|
+
*
|
|
232
|
+
* @param request - The request {@link RestoreKeyRequest}
|
|
233
|
+
* @returns A Promise of Key
|
|
234
|
+
*/
|
|
235
|
+
restoreKey = (request) => this.client.fetch({
|
|
236
|
+
body: "{}",
|
|
237
|
+
headers: jsonContentHeaders,
|
|
238
|
+
method: "POST",
|
|
239
|
+
path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/restore`
|
|
240
|
+
}, unmarshalKey);
|
|
241
|
+
/**
|
|
242
|
+
* List all available algorithms. Lists all cryptographic algorithms supported by the Key Manager service.
|
|
243
|
+
*
|
|
244
|
+
* @param request - The request {@link ListAlgorithmsRequest}
|
|
245
|
+
* @returns A Promise of ListAlgorithmsResponse
|
|
246
|
+
*/
|
|
247
|
+
listAlgorithms = (request = {}) => this.client.fetch({
|
|
248
|
+
method: "GET",
|
|
249
|
+
path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/algorithms`,
|
|
250
|
+
urlParams: urlParams(["usages", request.usages])
|
|
251
|
+
}, unmarshalListAlgorithmsResponse);
|
|
340
252
|
};
|
|
253
|
+
export { API$1 as API };
|
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { marshalCreateKeyRequest, marshalDecryptRequest, marshalEncryptRequest, marshalGenerateDataKeyRequest, marshalImportKeyMaterialRequest, marshalSignRequest, marshalUpdateKeyRequest, marshalVerifyRequest, unmarshalDataKey, unmarshalDecryptResponse, unmarshalEncryptResponse, unmarshalKey, unmarshalListAlgorithmsResponse, unmarshalListKeysResponse, unmarshalPublicKey, unmarshalSignResponse, unmarshalVerifyResponse } from "./marshalling.gen.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
3
|
+
import { API } from "./api.gen.js";
|
|
4
|
+
var index_gen_exports = /* @__PURE__ */ __exportAll({
|
|
5
|
+
API: () => API,
|
|
6
|
+
marshalCreateKeyRequest: () => marshalCreateKeyRequest,
|
|
7
|
+
marshalDecryptRequest: () => marshalDecryptRequest,
|
|
8
|
+
marshalEncryptRequest: () => marshalEncryptRequest,
|
|
9
|
+
marshalGenerateDataKeyRequest: () => marshalGenerateDataKeyRequest,
|
|
10
|
+
marshalImportKeyMaterialRequest: () => marshalImportKeyMaterialRequest,
|
|
11
|
+
marshalSignRequest: () => marshalSignRequest,
|
|
12
|
+
marshalUpdateKeyRequest: () => marshalUpdateKeyRequest,
|
|
13
|
+
marshalVerifyRequest: () => marshalVerifyRequest,
|
|
14
|
+
unmarshalDataKey: () => unmarshalDataKey,
|
|
15
|
+
unmarshalDecryptResponse: () => unmarshalDecryptResponse,
|
|
16
|
+
unmarshalEncryptResponse: () => unmarshalEncryptResponse,
|
|
17
|
+
unmarshalKey: () => unmarshalKey,
|
|
18
|
+
unmarshalListAlgorithmsResponse: () => unmarshalListAlgorithmsResponse,
|
|
19
|
+
unmarshalListKeysResponse: () => unmarshalListKeysResponse,
|
|
20
|
+
unmarshalPublicKey: () => unmarshalPublicKey,
|
|
21
|
+
unmarshalSignResponse: () => unmarshalSignResponse,
|
|
22
|
+
unmarshalVerifyResponse: () => unmarshalVerifyResponse
|
|
23
|
+
});
|
|
24
|
+
export { index_gen_exports };
|
|
@@ -1,230 +1,156 @@
|
|
|
1
|
-
import { resolveOneOf,
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return {
|
|
9
|
-
nextRotationAt: unmarshalDate(data.next_rotation_at),
|
|
10
|
-
rotationPeriod: data.rotation_period
|
|
11
|
-
};
|
|
1
|
+
import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate } from "@scaleway/sdk-client";
|
|
2
|
+
var unmarshalKeyRotationPolicy = (data) => {
|
|
3
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'KeyRotationPolicy' failed as data isn't a dictionary.`);
|
|
4
|
+
return {
|
|
5
|
+
nextRotationAt: unmarshalDate(data.next_rotation_at),
|
|
6
|
+
rotationPeriod: data.rotation_period
|
|
7
|
+
};
|
|
12
8
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
asymmetricEncryption: data.asymmetric_encryption ? data.asymmetric_encryption : void 0,
|
|
21
|
-
asymmetricSigning: data.asymmetric_signing ? data.asymmetric_signing : void 0,
|
|
22
|
-
symmetricEncryption: data.symmetric_encryption ? data.symmetric_encryption : void 0
|
|
23
|
-
};
|
|
9
|
+
var unmarshalKeyUsage = (data) => {
|
|
10
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'KeyUsage' failed as data isn't a dictionary.`);
|
|
11
|
+
return {
|
|
12
|
+
asymmetricEncryption: data.asymmetric_encryption ? data.asymmetric_encryption : void 0,
|
|
13
|
+
asymmetricSigning: data.asymmetric_signing ? data.asymmetric_signing : void 0,
|
|
14
|
+
symmetricEncryption: data.symmetric_encryption ? data.symmetric_encryption : void 0
|
|
15
|
+
};
|
|
24
16
|
};
|
|
25
17
|
const unmarshalKey = (data) => {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
tags: data.tags,
|
|
47
|
-
updatedAt: unmarshalDate(data.updated_at),
|
|
48
|
-
usage: data.usage ? unmarshalKeyUsage(data.usage) : void 0
|
|
49
|
-
};
|
|
18
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'Key' failed as data isn't a dictionary.`);
|
|
19
|
+
return {
|
|
20
|
+
createdAt: unmarshalDate(data.created_at),
|
|
21
|
+
deletionRequestedAt: unmarshalDate(data.deletion_requested_at),
|
|
22
|
+
description: data.description,
|
|
23
|
+
id: data.id,
|
|
24
|
+
locked: data.locked,
|
|
25
|
+
name: data.name,
|
|
26
|
+
origin: data.origin,
|
|
27
|
+
projectId: data.project_id,
|
|
28
|
+
protected: data.protected,
|
|
29
|
+
region: data.region,
|
|
30
|
+
rotatedAt: unmarshalDate(data.rotated_at),
|
|
31
|
+
rotationCount: data.rotation_count,
|
|
32
|
+
rotationPolicy: data.rotation_policy ? unmarshalKeyRotationPolicy(data.rotation_policy) : void 0,
|
|
33
|
+
state: data.state,
|
|
34
|
+
tags: data.tags,
|
|
35
|
+
updatedAt: unmarshalDate(data.updated_at),
|
|
36
|
+
usage: data.usage ? unmarshalKeyUsage(data.usage) : void 0
|
|
37
|
+
};
|
|
50
38
|
};
|
|
51
39
|
const unmarshalDataKey = (data) => {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
createdAt: unmarshalDate(data.created_at),
|
|
61
|
-
keyId: data.key_id,
|
|
62
|
-
plaintext: data.plaintext
|
|
63
|
-
};
|
|
40
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'DataKey' failed as data isn't a dictionary.`);
|
|
41
|
+
return {
|
|
42
|
+
algorithm: data.algorithm,
|
|
43
|
+
ciphertext: data.ciphertext,
|
|
44
|
+
createdAt: unmarshalDate(data.created_at),
|
|
45
|
+
keyId: data.key_id,
|
|
46
|
+
plaintext: data.plaintext
|
|
47
|
+
};
|
|
64
48
|
};
|
|
65
49
|
const unmarshalDecryptResponse = (data) => {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
ciphertext: data.ciphertext,
|
|
73
|
-
keyId: data.key_id,
|
|
74
|
-
plaintext: data.plaintext
|
|
75
|
-
};
|
|
50
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'DecryptResponse' failed as data isn't a dictionary.`);
|
|
51
|
+
return {
|
|
52
|
+
ciphertext: data.ciphertext,
|
|
53
|
+
keyId: data.key_id,
|
|
54
|
+
plaintext: data.plaintext
|
|
55
|
+
};
|
|
76
56
|
};
|
|
77
57
|
const unmarshalEncryptResponse = (data) => {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
return {
|
|
84
|
-
ciphertext: data.ciphertext,
|
|
85
|
-
keyId: data.key_id
|
|
86
|
-
};
|
|
58
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'EncryptResponse' failed as data isn't a dictionary.`);
|
|
59
|
+
return {
|
|
60
|
+
ciphertext: data.ciphertext,
|
|
61
|
+
keyId: data.key_id
|
|
62
|
+
};
|
|
87
63
|
};
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
name: data.name,
|
|
96
|
-
recommended: data.recommended,
|
|
97
|
-
usage: data.usage
|
|
98
|
-
};
|
|
64
|
+
var unmarshalListAlgorithmsResponseAlgorithm = (data) => {
|
|
65
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListAlgorithmsResponseAlgorithm' failed as data isn't a dictionary.`);
|
|
66
|
+
return {
|
|
67
|
+
name: data.name,
|
|
68
|
+
recommended: data.recommended,
|
|
69
|
+
usage: data.usage
|
|
70
|
+
};
|
|
99
71
|
};
|
|
100
72
|
const unmarshalListAlgorithmsResponse = (data) => {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
`Unmarshalling the type 'ListAlgorithmsResponse' failed as data isn't a dictionary.`
|
|
104
|
-
);
|
|
105
|
-
}
|
|
106
|
-
return {
|
|
107
|
-
algorithms: unmarshalArrayOfObject(data.algorithms, unmarshalListAlgorithmsResponseAlgorithm)
|
|
108
|
-
};
|
|
73
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListAlgorithmsResponse' failed as data isn't a dictionary.`);
|
|
74
|
+
return { algorithms: unmarshalArrayOfObject(data.algorithms, unmarshalListAlgorithmsResponseAlgorithm) };
|
|
109
75
|
};
|
|
110
76
|
const unmarshalListKeysResponse = (data) => {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
return {
|
|
117
|
-
keys: unmarshalArrayOfObject(data.keys, unmarshalKey),
|
|
118
|
-
totalCount: data.total_count
|
|
119
|
-
};
|
|
77
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'ListKeysResponse' failed as data isn't a dictionary.`);
|
|
78
|
+
return {
|
|
79
|
+
keys: unmarshalArrayOfObject(data.keys, unmarshalKey),
|
|
80
|
+
totalCount: data.total_count
|
|
81
|
+
};
|
|
120
82
|
};
|
|
121
83
|
const unmarshalPublicKey = (data) => {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
`Unmarshalling the type 'PublicKey' failed as data isn't a dictionary.`
|
|
125
|
-
);
|
|
126
|
-
}
|
|
127
|
-
return {
|
|
128
|
-
pem: data.pem
|
|
129
|
-
};
|
|
84
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'PublicKey' failed as data isn't a dictionary.`);
|
|
85
|
+
return { pem: data.pem };
|
|
130
86
|
};
|
|
131
87
|
const unmarshalSignResponse = (data) => {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
return {
|
|
138
|
-
keyId: data.key_id,
|
|
139
|
-
signature: data.signature
|
|
140
|
-
};
|
|
88
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'SignResponse' failed as data isn't a dictionary.`);
|
|
89
|
+
return {
|
|
90
|
+
keyId: data.key_id,
|
|
91
|
+
signature: data.signature
|
|
92
|
+
};
|
|
141
93
|
};
|
|
142
94
|
const unmarshalVerifyResponse = (data) => {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
return {
|
|
149
|
-
keyId: data.key_id,
|
|
150
|
-
valid: data.valid
|
|
151
|
-
};
|
|
95
|
+
if (!isJSONObject(data)) throw new TypeError(`Unmarshalling the type 'VerifyResponse' failed as data isn't a dictionary.`);
|
|
96
|
+
return {
|
|
97
|
+
keyId: data.key_id,
|
|
98
|
+
valid: data.valid
|
|
99
|
+
};
|
|
152
100
|
};
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
});
|
|
157
|
-
const marshalKeyUsage = (request, defaults) => ({
|
|
158
|
-
...resolveOneOf([
|
|
159
|
-
{
|
|
160
|
-
param: "symmetric_encryption",
|
|
161
|
-
value: request.symmetricEncryption
|
|
162
|
-
},
|
|
163
|
-
{
|
|
164
|
-
param: "asymmetric_encryption",
|
|
165
|
-
value: request.asymmetricEncryption
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
param: "asymmetric_signing",
|
|
169
|
-
value: request.asymmetricSigning
|
|
170
|
-
}
|
|
171
|
-
])
|
|
101
|
+
var marshalKeyRotationPolicy = (request, defaults) => ({
|
|
102
|
+
next_rotation_at: request.nextRotationAt,
|
|
103
|
+
rotation_period: request.rotationPeriod
|
|
172
104
|
});
|
|
105
|
+
var marshalKeyUsage = (request, defaults) => ({ ...resolveOneOf([
|
|
106
|
+
{
|
|
107
|
+
param: "symmetric_encryption",
|
|
108
|
+
value: request.symmetricEncryption
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
param: "asymmetric_encryption",
|
|
112
|
+
value: request.asymmetricEncryption
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
param: "asymmetric_signing",
|
|
116
|
+
value: request.asymmetricSigning
|
|
117
|
+
}
|
|
118
|
+
]) });
|
|
173
119
|
const marshalCreateKeyRequest = (request, defaults) => ({
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
120
|
+
description: request.description,
|
|
121
|
+
name: request.name,
|
|
122
|
+
origin: request.origin,
|
|
123
|
+
project_id: request.projectId ?? defaults.defaultProjectId,
|
|
124
|
+
rotation_policy: request.rotationPolicy !== void 0 ? marshalKeyRotationPolicy(request.rotationPolicy, defaults) : void 0,
|
|
125
|
+
tags: request.tags,
|
|
126
|
+
unprotected: request.unprotected,
|
|
127
|
+
usage: request.usage !== void 0 ? marshalKeyUsage(request.usage, defaults) : void 0
|
|
182
128
|
});
|
|
183
129
|
const marshalDecryptRequest = (request, defaults) => ({
|
|
184
|
-
|
|
185
|
-
|
|
130
|
+
associated_data: request.associatedData,
|
|
131
|
+
ciphertext: request.ciphertext
|
|
186
132
|
});
|
|
187
133
|
const marshalEncryptRequest = (request, defaults) => ({
|
|
188
|
-
|
|
189
|
-
|
|
134
|
+
associated_data: request.associatedData,
|
|
135
|
+
plaintext: request.plaintext
|
|
190
136
|
});
|
|
191
137
|
const marshalGenerateDataKeyRequest = (request, defaults) => ({
|
|
192
|
-
|
|
193
|
-
|
|
138
|
+
algorithm: request.algorithm,
|
|
139
|
+
without_plaintext: request.withoutPlaintext
|
|
194
140
|
});
|
|
195
141
|
const marshalImportKeyMaterialRequest = (request, defaults) => ({
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
});
|
|
199
|
-
const marshalSignRequest = (request, defaults) => ({
|
|
200
|
-
digest: request.digest
|
|
142
|
+
key_material: request.keyMaterial,
|
|
143
|
+
salt: request.salt
|
|
201
144
|
});
|
|
145
|
+
const marshalSignRequest = (request, defaults) => ({ digest: request.digest });
|
|
202
146
|
const marshalUpdateKeyRequest = (request, defaults) => ({
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
147
|
+
description: request.description,
|
|
148
|
+
name: request.name,
|
|
149
|
+
rotation_policy: request.rotationPolicy !== void 0 ? marshalKeyRotationPolicy(request.rotationPolicy, defaults) : void 0,
|
|
150
|
+
tags: request.tags
|
|
207
151
|
});
|
|
208
152
|
const marshalVerifyRequest = (request, defaults) => ({
|
|
209
|
-
|
|
210
|
-
|
|
153
|
+
digest: request.digest,
|
|
154
|
+
signature: request.signature
|
|
211
155
|
});
|
|
212
|
-
export {
|
|
213
|
-
marshalCreateKeyRequest,
|
|
214
|
-
marshalDecryptRequest,
|
|
215
|
-
marshalEncryptRequest,
|
|
216
|
-
marshalGenerateDataKeyRequest,
|
|
217
|
-
marshalImportKeyMaterialRequest,
|
|
218
|
-
marshalSignRequest,
|
|
219
|
-
marshalUpdateKeyRequest,
|
|
220
|
-
marshalVerifyRequest,
|
|
221
|
-
unmarshalDataKey,
|
|
222
|
-
unmarshalDecryptResponse,
|
|
223
|
-
unmarshalEncryptResponse,
|
|
224
|
-
unmarshalKey,
|
|
225
|
-
unmarshalListAlgorithmsResponse,
|
|
226
|
-
unmarshalListKeysResponse,
|
|
227
|
-
unmarshalPublicKey,
|
|
228
|
-
unmarshalSignResponse,
|
|
229
|
-
unmarshalVerifyResponse
|
|
230
|
-
};
|
|
156
|
+
export { marshalCreateKeyRequest, marshalDecryptRequest, marshalEncryptRequest, marshalGenerateDataKeyRequest, marshalImportKeyMaterialRequest, marshalSignRequest, marshalUpdateKeyRequest, marshalVerifyRequest, unmarshalDataKey, unmarshalDecryptResponse, unmarshalEncryptResponse, unmarshalKey, unmarshalListAlgorithmsResponse, unmarshalListKeysResponse, unmarshalPublicKey, unmarshalSignResponse, unmarshalVerifyResponse };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scaleway/sdk-key-manager",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"description": "Scaleway SDK key-manager",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"files": [
|
|
@@ -27,13 +27,13 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@scaleway/random-name": "5.1.2",
|
|
30
|
-
"@scaleway/sdk-std": "2.
|
|
30
|
+
"@scaleway/sdk-std": "2.2.1"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@scaleway/sdk-client": "^2.1
|
|
33
|
+
"@scaleway/sdk-client": "^2.2.1"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@scaleway/sdk-client": "^2.1
|
|
36
|
+
"@scaleway/sdk-client": "^2.2.1"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"package:check": "pnpm publint",
|