@scaleway/sdk-key-manager 2.2.0 → 2.2.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/dist/v1alpha1/api.gen.js
CHANGED
|
@@ -9,7 +9,11 @@ class API extends API$1 {
|
|
|
9
9
|
* type ∈ {'zone','region','global','unspecified'}
|
|
10
10
|
*/
|
|
11
11
|
static LOCALITY = toApiLocality({
|
|
12
|
-
regions: [
|
|
12
|
+
regions: [
|
|
13
|
+
"fr-par",
|
|
14
|
+
"nl-ams",
|
|
15
|
+
"pl-waw"
|
|
16
|
+
]
|
|
13
17
|
});
|
|
14
18
|
/**
|
|
15
19
|
* 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**.
|
|
@@ -76,10 +80,12 @@ class API extends API$1 {
|
|
|
76
80
|
*
|
|
77
81
|
* @param request - The request {@link DeleteKeyRequest}
|
|
78
82
|
*/
|
|
79
|
-
deleteKey = (request) => this.client.fetch(
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
+
deleteKey = (request) => this.client.fetch(
|
|
84
|
+
{
|
|
85
|
+
method: "DELETE",
|
|
86
|
+
path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}`
|
|
87
|
+
}
|
|
88
|
+
);
|
|
83
89
|
/**
|
|
84
90
|
* 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.
|
|
85
91
|
*
|
|
@@ -164,10 +170,7 @@ class API extends API$1 {
|
|
|
164
170
|
["order_by", request.orderBy],
|
|
165
171
|
["organization_id", request.organizationId],
|
|
166
172
|
["page", request.page],
|
|
167
|
-
[
|
|
168
|
-
"page_size",
|
|
169
|
-
request.pageSize ?? this.client.settings.defaultPageSize
|
|
170
|
-
],
|
|
173
|
+
["page_size", request.pageSize ?? this.client.settings.defaultPageSize],
|
|
171
174
|
["project_id", request.projectId],
|
|
172
175
|
["scheduled_for_deletion", request.scheduledForDeletion],
|
|
173
176
|
["tags", request.tags],
|
|
@@ -244,7 +247,9 @@ class API extends API$1 {
|
|
|
244
247
|
*/
|
|
245
248
|
sign = (request) => this.client.fetch(
|
|
246
249
|
{
|
|
247
|
-
body: JSON.stringify(
|
|
250
|
+
body: JSON.stringify(
|
|
251
|
+
marshalSignRequest(request, this.client.settings)
|
|
252
|
+
),
|
|
248
253
|
headers: jsonContentHeaders,
|
|
249
254
|
method: "POST",
|
|
250
255
|
path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam("keyId", request.keyId)}/sign`
|
|
@@ -290,12 +295,14 @@ class API extends API$1 {
|
|
|
290
295
|
*
|
|
291
296
|
* @param request - The request {@link DeleteKeyMaterialRequest}
|
|
292
297
|
*/
|
|
293
|
-
deleteKeyMaterial = (request) => this.client.fetch(
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
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
|
+
);
|
|
299
306
|
/**
|
|
300
307
|
* Restore a key. Restore a key and all its rotations scheduled for deletion specified by the `region` and `key_id` parameters.
|
|
301
308
|
*
|
|
@@ -321,7 +328,9 @@ class API extends API$1 {
|
|
|
321
328
|
{
|
|
322
329
|
method: "GET",
|
|
323
330
|
path: `/key-manager/v1alpha1/regions/${validatePathParam("region", request.region ?? this.client.settings.defaultRegion)}/algorithms`,
|
|
324
|
-
urlParams: urlParams(
|
|
331
|
+
urlParams: urlParams(
|
|
332
|
+
["usages", request.usages]
|
|
333
|
+
)
|
|
325
334
|
},
|
|
326
335
|
unmarshalListAlgorithmsResponse
|
|
327
336
|
);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { API } from './api.gen.js';
|
|
1
|
+
export { API, } from './api.gen.js';
|
|
2
2
|
export * from './marshalling.gen.js';
|
|
3
3
|
export type { CreateKeyRequest, DataKey, DataKeyAlgorithmSymmetricEncryption, DecryptRequest, DecryptResponse, DeleteKeyMaterialRequest, DeleteKeyRequest, DisableKeyRequest, EnableKeyRequest, EncryptRequest, EncryptResponse, GenerateDataKeyRequest, GetKeyRequest, GetPublicKeyRequest, ImportKeyMaterialRequest, Key, KeyAlgorithmAsymmetricEncryption, KeyAlgorithmAsymmetricSigning, KeyAlgorithmSymmetricEncryption, KeyOrigin, KeyRotationPolicy, KeyState, KeyUsage, ListAlgorithmsRequest, ListAlgorithmsRequestUsage, ListAlgorithmsResponse, ListAlgorithmsResponseAlgorithm, ListKeysRequest, ListKeysRequestOrderBy, ListKeysRequestUsage, ListKeysResponse, ProtectKeyRequest, PublicKey, RestoreKeyRequest, RotateKeyRequest, SignRequest, SignResponse, UnprotectKeyRequest, UpdateKeyRequest, VerifyRequest, VerifyResponse, } from './types.gen.js';
|
|
@@ -104,10 +104,7 @@ const unmarshalListAlgorithmsResponse = (data) => {
|
|
|
104
104
|
);
|
|
105
105
|
}
|
|
106
106
|
return {
|
|
107
|
-
algorithms: unmarshalArrayOfObject(
|
|
108
|
-
data.algorithms,
|
|
109
|
-
unmarshalListAlgorithmsResponseAlgorithm
|
|
110
|
-
)
|
|
107
|
+
algorithms: unmarshalArrayOfObject(data.algorithms, unmarshalListAlgorithmsResponseAlgorithm)
|
|
111
108
|
};
|
|
112
109
|
};
|
|
113
110
|
const unmarshalListKeysResponse = (data) => {
|
|
@@ -159,9 +156,18 @@ const marshalKeyRotationPolicy = (request, defaults) => ({
|
|
|
159
156
|
});
|
|
160
157
|
const marshalKeyUsage = (request, defaults) => ({
|
|
161
158
|
...resolveOneOf([
|
|
162
|
-
{
|
|
163
|
-
|
|
164
|
-
|
|
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
|
+
}
|
|
165
171
|
])
|
|
166
172
|
});
|
|
167
173
|
const marshalCreateKeyRequest = (request, defaults) => ({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scaleway/sdk-key-manager",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"description": "Scaleway SDK key-manager",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"files": [
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@scaleway/random-name": "5.1.2",
|
|
30
|
-
"@scaleway/sdk-std": "2.1.
|
|
30
|
+
"@scaleway/sdk-std": "2.1.1"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"@scaleway/sdk-client": "^2.1.0"
|