@scaleway/sdk-key-manager 2.20.0 → 2.21.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.
@@ -1,10 +1,10 @@
1
- import { CreateKeyRequest, DataKey, DataKeyAlgorithmSymmetricEncryption, DecryptRequest, DecryptResponse, DeleteKeyMaterialRequest, DeleteKeyRequest, DisableKeyRequest, EnableKeyRequest, EncryptRequest, EncryptResponse, GenerateDataKeyRequest, GenerateKeyMaterialImportParametersRequest, GenerateKeyMaterialImportParametersRequestWrappingAlgorithm, GenerateKeyMaterialImportParametersResponse, GetKeyRequest, GetPublicKeyRequest, ImportKeyMaterialRequest, Key, KeyAlgorithmAsymmetricEncryption, KeyAlgorithmAsymmetricSigning, KeyAlgorithmKeyEncapsulation, KeyAlgorithmSymmetricEncryption, KeyOrigin, KeyProtectionLevel, KeyRotation, KeyRotationPolicy, KeyRotationStatus, KeyState, KeyUsage, ListAlgorithmsRequest, ListAlgorithmsRequestUsage, ListAlgorithmsResponse, ListAlgorithmsResponseAlgorithm, ListKeyRotationsRequest, ListKeyRotationsRequestOrderBy, ListKeyRotationsResponse, ListKeysRequest, ListKeysRequestOrderBy, ListKeysRequestUsage, ListKeysResponse, ProtectKeyRequest, PublicKey, RestoreKeyRequest, RotateKeyRequest, SignRequest, SignResponse, UnprotectKeyRequest, UnwrapKeyRequest, UnwrapKeyResponse, UpdateKeyRequest, VerifyRequest, VerifyResponse, WrapKeyRequest, WrapKeyResponse } from "./types.gen.js";
1
+ import { CreateKeyRequest, DataKey, DataKeyAlgorithmSymmetricEncryption, DecryptRequest, DecryptResponse, DeleteKeyMaterialRequest, DeleteKeyRequest, DisableKeyRequest, EnableKeyRequest, EncryptRequest, EncryptResponse, GenerateDataKeyRequest, GenerateKeyMaterialImportParametersRequest, GenerateKeyMaterialImportParametersRequestWrappingAlgorithm, GenerateKeyMaterialImportParametersResponse, GetKeyRequest, GetPublicKeyRequest, ImportKeyMaterialRequest, ImportKeyMaterialRequestEncryptedKeyMaterial, Key, KeyAlgorithmAsymmetricEncryption, KeyAlgorithmAsymmetricSigning, KeyAlgorithmKeyEncapsulation, KeyAlgorithmSymmetricEncryption, KeyOrigin, KeyProtectionLevel, KeyRotation, KeyRotationPolicy, KeyRotationStatus, KeyState, KeyUsage, ListAlgorithmsRequest, ListAlgorithmsRequestUsage, ListAlgorithmsResponse, ListAlgorithmsResponseAlgorithm, ListKeyRotationsRequest, ListKeyRotationsRequestOrderBy, ListKeyRotationsResponse, ListKeysRequest, ListKeysRequestOrderBy, ListKeysRequestUsage, ListKeysResponse, ProtectKeyRequest, PublicKey, RestoreKeyRequest, RotateKeyRequest, SignRequest, SignResponse, UnprotectKeyRequest, UnwrapKeyRequest, UnwrapKeyResponse, UpdateKeyRequest, VerifyRequest, VerifyResponse, WrapKeyRequest, WrapKeyResponse } from "./types.gen.js";
2
2
  import { API } from "./api.gen.js";
3
3
  import { DATA_KEY_ALGORITHM_SYMMETRIC_ENCRYPTIONS, GENERATE_KEY_MATERIAL_IMPORT_PARAMETERS_REQUEST_WRAPPING_ALGORITHMS, KEY_ALGORITHM_ASYMMETRIC_ENCRYPTIONS, KEY_ALGORITHM_ASYMMETRIC_SIGNINGS, KEY_ALGORITHM_KEY_ENCAPSULATIONS, KEY_ALGORITHM_SYMMETRIC_ENCRYPTIONS, KEY_ORIGINS, KEY_PROTECTION_LEVELS, KEY_ROTATION_STATUSES, KEY_STATES, LIST_ALGORITHMS_REQUEST_USAGES, LIST_KEYS_REQUEST_ORDER_BIES, LIST_KEYS_REQUEST_USAGES, LIST_KEY_ROTATIONS_REQUEST_ORDER_BIES } from "./constants.gen.js";
4
4
  import { marshalCreateKeyRequest, marshalDecryptRequest, marshalDeleteKeyMaterialRequest, marshalEncryptRequest, marshalGenerateDataKeyRequest, marshalGenerateKeyMaterialImportParametersRequest, marshalImportKeyMaterialRequest, marshalSignRequest, marshalUnwrapKeyRequest, marshalUpdateKeyRequest, marshalVerifyRequest, marshalWrapKeyRequest, unmarshalDataKey, unmarshalDecryptResponse, unmarshalEncryptResponse, unmarshalGenerateKeyMaterialImportParametersResponse, unmarshalKey, unmarshalListAlgorithmsResponse, unmarshalListKeyRotationsResponse, unmarshalListKeysResponse, unmarshalPublicKey, unmarshalSignResponse, unmarshalUnwrapKeyResponse, unmarshalVerifyResponse, unmarshalWrapKeyResponse } from "./marshalling.gen.js";
5
5
  import { validation_rules_gen_d_exports } from "./validation-rules.gen.js";
6
6
  declare namespace index_gen_d_exports {
7
- export { API, CreateKeyRequest, DATA_KEY_ALGORITHM_SYMMETRIC_ENCRYPTIONS, DataKey, DataKeyAlgorithmSymmetricEncryption, DecryptRequest, DecryptResponse, DeleteKeyMaterialRequest, DeleteKeyRequest, DisableKeyRequest, EnableKeyRequest, EncryptRequest, EncryptResponse, GENERATE_KEY_MATERIAL_IMPORT_PARAMETERS_REQUEST_WRAPPING_ALGORITHMS, GenerateDataKeyRequest, GenerateKeyMaterialImportParametersRequest, GenerateKeyMaterialImportParametersRequestWrappingAlgorithm, GenerateKeyMaterialImportParametersResponse, GetKeyRequest, GetPublicKeyRequest, ImportKeyMaterialRequest, KEY_ALGORITHM_ASYMMETRIC_ENCRYPTIONS, KEY_ALGORITHM_ASYMMETRIC_SIGNINGS, KEY_ALGORITHM_KEY_ENCAPSULATIONS, KEY_ALGORITHM_SYMMETRIC_ENCRYPTIONS, KEY_ORIGINS, KEY_PROTECTION_LEVELS, KEY_ROTATION_STATUSES, KEY_STATES, Key, KeyAlgorithmAsymmetricEncryption, KeyAlgorithmAsymmetricSigning, KeyAlgorithmKeyEncapsulation, KeyAlgorithmSymmetricEncryption, KeyOrigin, KeyProtectionLevel, KeyRotation, KeyRotationPolicy, KeyRotationStatus, KeyState, KeyUsage, LIST_ALGORITHMS_REQUEST_USAGES, LIST_KEYS_REQUEST_ORDER_BIES, LIST_KEYS_REQUEST_USAGES, LIST_KEY_ROTATIONS_REQUEST_ORDER_BIES, ListAlgorithmsRequest, ListAlgorithmsRequestUsage, ListAlgorithmsResponse, ListAlgorithmsResponseAlgorithm, ListKeyRotationsRequest, ListKeyRotationsRequestOrderBy, ListKeyRotationsResponse, ListKeysRequest, ListKeysRequestOrderBy, ListKeysRequestUsage, ListKeysResponse, ProtectKeyRequest, PublicKey, RestoreKeyRequest, RotateKeyRequest, SignRequest, SignResponse, UnprotectKeyRequest, UnwrapKeyRequest, UnwrapKeyResponse, UpdateKeyRequest, validation_rules_gen_d_exports as ValidationRules, VerifyRequest, VerifyResponse, WrapKeyRequest, WrapKeyResponse, marshalCreateKeyRequest, marshalDecryptRequest, marshalDeleteKeyMaterialRequest, marshalEncryptRequest, marshalGenerateDataKeyRequest, marshalGenerateKeyMaterialImportParametersRequest, marshalImportKeyMaterialRequest, marshalSignRequest, marshalUnwrapKeyRequest, marshalUpdateKeyRequest, marshalVerifyRequest, marshalWrapKeyRequest, unmarshalDataKey, unmarshalDecryptResponse, unmarshalEncryptResponse, unmarshalGenerateKeyMaterialImportParametersResponse, unmarshalKey, unmarshalListAlgorithmsResponse, unmarshalListKeyRotationsResponse, unmarshalListKeysResponse, unmarshalPublicKey, unmarshalSignResponse, unmarshalUnwrapKeyResponse, unmarshalVerifyResponse, unmarshalWrapKeyResponse };
7
+ export { API, CreateKeyRequest, DATA_KEY_ALGORITHM_SYMMETRIC_ENCRYPTIONS, DataKey, DataKeyAlgorithmSymmetricEncryption, DecryptRequest, DecryptResponse, DeleteKeyMaterialRequest, DeleteKeyRequest, DisableKeyRequest, EnableKeyRequest, EncryptRequest, EncryptResponse, GENERATE_KEY_MATERIAL_IMPORT_PARAMETERS_REQUEST_WRAPPING_ALGORITHMS, GenerateDataKeyRequest, GenerateKeyMaterialImportParametersRequest, GenerateKeyMaterialImportParametersRequestWrappingAlgorithm, GenerateKeyMaterialImportParametersResponse, GetKeyRequest, GetPublicKeyRequest, ImportKeyMaterialRequest, ImportKeyMaterialRequestEncryptedKeyMaterial, KEY_ALGORITHM_ASYMMETRIC_ENCRYPTIONS, KEY_ALGORITHM_ASYMMETRIC_SIGNINGS, KEY_ALGORITHM_KEY_ENCAPSULATIONS, KEY_ALGORITHM_SYMMETRIC_ENCRYPTIONS, KEY_ORIGINS, KEY_PROTECTION_LEVELS, KEY_ROTATION_STATUSES, KEY_STATES, Key, KeyAlgorithmAsymmetricEncryption, KeyAlgorithmAsymmetricSigning, KeyAlgorithmKeyEncapsulation, KeyAlgorithmSymmetricEncryption, KeyOrigin, KeyProtectionLevel, KeyRotation, KeyRotationPolicy, KeyRotationStatus, KeyState, KeyUsage, LIST_ALGORITHMS_REQUEST_USAGES, LIST_KEYS_REQUEST_ORDER_BIES, LIST_KEYS_REQUEST_USAGES, LIST_KEY_ROTATIONS_REQUEST_ORDER_BIES, ListAlgorithmsRequest, ListAlgorithmsRequestUsage, ListAlgorithmsResponse, ListAlgorithmsResponseAlgorithm, ListKeyRotationsRequest, ListKeyRotationsRequestOrderBy, ListKeyRotationsResponse, ListKeysRequest, ListKeysRequestOrderBy, ListKeysRequestUsage, ListKeysResponse, ProtectKeyRequest, PublicKey, RestoreKeyRequest, RotateKeyRequest, SignRequest, SignResponse, UnprotectKeyRequest, UnwrapKeyRequest, UnwrapKeyResponse, UpdateKeyRequest, validation_rules_gen_d_exports as ValidationRules, VerifyRequest, VerifyResponse, WrapKeyRequest, WrapKeyResponse, marshalCreateKeyRequest, marshalDecryptRequest, marshalDeleteKeyMaterialRequest, marshalEncryptRequest, marshalGenerateDataKeyRequest, marshalGenerateKeyMaterialImportParametersRequest, marshalImportKeyMaterialRequest, marshalSignRequest, marshalUnwrapKeyRequest, marshalUpdateKeyRequest, marshalVerifyRequest, marshalWrapKeyRequest, unmarshalDataKey, unmarshalDecryptResponse, unmarshalEncryptResponse, unmarshalGenerateKeyMaterialImportParametersResponse, unmarshalKey, unmarshalListAlgorithmsResponse, unmarshalListKeyRotationsResponse, unmarshalListKeysResponse, unmarshalPublicKey, unmarshalSignResponse, unmarshalUnwrapKeyResponse, unmarshalVerifyResponse, unmarshalWrapKeyResponse };
8
8
  }
9
9
  //#endregion
10
- export { API, type CreateKeyRequest, DATA_KEY_ALGORITHM_SYMMETRIC_ENCRYPTIONS, type DataKey, type DataKeyAlgorithmSymmetricEncryption, type DecryptRequest, type DecryptResponse, type DeleteKeyMaterialRequest, type DeleteKeyRequest, type DisableKeyRequest, type EnableKeyRequest, type EncryptRequest, type EncryptResponse, GENERATE_KEY_MATERIAL_IMPORT_PARAMETERS_REQUEST_WRAPPING_ALGORITHMS, type GenerateDataKeyRequest, type GenerateKeyMaterialImportParametersRequest, type GenerateKeyMaterialImportParametersRequestWrappingAlgorithm, type GenerateKeyMaterialImportParametersResponse, type GetKeyRequest, type GetPublicKeyRequest, type ImportKeyMaterialRequest, KEY_ALGORITHM_ASYMMETRIC_ENCRYPTIONS, KEY_ALGORITHM_ASYMMETRIC_SIGNINGS, KEY_ALGORITHM_KEY_ENCAPSULATIONS, KEY_ALGORITHM_SYMMETRIC_ENCRYPTIONS, KEY_ORIGINS, KEY_PROTECTION_LEVELS, KEY_ROTATION_STATUSES, KEY_STATES, type Key, type KeyAlgorithmAsymmetricEncryption, type KeyAlgorithmAsymmetricSigning, type KeyAlgorithmKeyEncapsulation, type KeyAlgorithmSymmetricEncryption, type KeyOrigin, type KeyProtectionLevel, type KeyRotation, type KeyRotationPolicy, type KeyRotationStatus, type KeyState, type KeyUsage, LIST_ALGORITHMS_REQUEST_USAGES, LIST_KEYS_REQUEST_ORDER_BIES, LIST_KEYS_REQUEST_USAGES, LIST_KEY_ROTATIONS_REQUEST_ORDER_BIES, type ListAlgorithmsRequest, type ListAlgorithmsRequestUsage, type ListAlgorithmsResponse, type ListAlgorithmsResponseAlgorithm, type ListKeyRotationsRequest, type ListKeyRotationsRequestOrderBy, type ListKeyRotationsResponse, type ListKeysRequest, type ListKeysRequestOrderBy, type ListKeysRequestUsage, type ListKeysResponse, type ProtectKeyRequest, type PublicKey, type RestoreKeyRequest, type RotateKeyRequest, type SignRequest, type SignResponse, type UnprotectKeyRequest, type UnwrapKeyRequest, type UnwrapKeyResponse, type UpdateKeyRequest, validation_rules_gen_d_exports as ValidationRules, type VerifyRequest, type VerifyResponse, type WrapKeyRequest, type WrapKeyResponse, index_gen_d_exports, marshalCreateKeyRequest, marshalDecryptRequest, marshalDeleteKeyMaterialRequest, marshalEncryptRequest, marshalGenerateDataKeyRequest, marshalGenerateKeyMaterialImportParametersRequest, marshalImportKeyMaterialRequest, marshalSignRequest, marshalUnwrapKeyRequest, marshalUpdateKeyRequest, marshalVerifyRequest, marshalWrapKeyRequest, unmarshalDataKey, unmarshalDecryptResponse, unmarshalEncryptResponse, unmarshalGenerateKeyMaterialImportParametersResponse, unmarshalKey, unmarshalListAlgorithmsResponse, unmarshalListKeyRotationsResponse, unmarshalListKeysResponse, unmarshalPublicKey, unmarshalSignResponse, unmarshalUnwrapKeyResponse, unmarshalVerifyResponse, unmarshalWrapKeyResponse };
10
+ export { API, type CreateKeyRequest, DATA_KEY_ALGORITHM_SYMMETRIC_ENCRYPTIONS, type DataKey, type DataKeyAlgorithmSymmetricEncryption, type DecryptRequest, type DecryptResponse, type DeleteKeyMaterialRequest, type DeleteKeyRequest, type DisableKeyRequest, type EnableKeyRequest, type EncryptRequest, type EncryptResponse, GENERATE_KEY_MATERIAL_IMPORT_PARAMETERS_REQUEST_WRAPPING_ALGORITHMS, type GenerateDataKeyRequest, type GenerateKeyMaterialImportParametersRequest, type GenerateKeyMaterialImportParametersRequestWrappingAlgorithm, type GenerateKeyMaterialImportParametersResponse, type GetKeyRequest, type GetPublicKeyRequest, type ImportKeyMaterialRequest, type ImportKeyMaterialRequestEncryptedKeyMaterial, KEY_ALGORITHM_ASYMMETRIC_ENCRYPTIONS, KEY_ALGORITHM_ASYMMETRIC_SIGNINGS, KEY_ALGORITHM_KEY_ENCAPSULATIONS, KEY_ALGORITHM_SYMMETRIC_ENCRYPTIONS, KEY_ORIGINS, KEY_PROTECTION_LEVELS, KEY_ROTATION_STATUSES, KEY_STATES, type Key, type KeyAlgorithmAsymmetricEncryption, type KeyAlgorithmAsymmetricSigning, type KeyAlgorithmKeyEncapsulation, type KeyAlgorithmSymmetricEncryption, type KeyOrigin, type KeyProtectionLevel, type KeyRotation, type KeyRotationPolicy, type KeyRotationStatus, type KeyState, type KeyUsage, LIST_ALGORITHMS_REQUEST_USAGES, LIST_KEYS_REQUEST_ORDER_BIES, LIST_KEYS_REQUEST_USAGES, LIST_KEY_ROTATIONS_REQUEST_ORDER_BIES, type ListAlgorithmsRequest, type ListAlgorithmsRequestUsage, type ListAlgorithmsResponse, type ListAlgorithmsResponseAlgorithm, type ListKeyRotationsRequest, type ListKeyRotationsRequestOrderBy, type ListKeyRotationsResponse, type ListKeysRequest, type ListKeysRequestOrderBy, type ListKeysRequestUsage, type ListKeysResponse, type ProtectKeyRequest, type PublicKey, type RestoreKeyRequest, type RotateKeyRequest, type SignRequest, type SignResponse, type UnprotectKeyRequest, type UnwrapKeyRequest, type UnwrapKeyResponse, type UpdateKeyRequest, validation_rules_gen_d_exports as ValidationRules, type VerifyRequest, type VerifyResponse, type WrapKeyRequest, type WrapKeyResponse, index_gen_d_exports, marshalCreateKeyRequest, marshalDecryptRequest, marshalDeleteKeyMaterialRequest, marshalEncryptRequest, marshalGenerateDataKeyRequest, marshalGenerateKeyMaterialImportParametersRequest, marshalImportKeyMaterialRequest, marshalSignRequest, marshalUnwrapKeyRequest, marshalUpdateKeyRequest, marshalVerifyRequest, marshalWrapKeyRequest, unmarshalDataKey, unmarshalDecryptResponse, unmarshalEncryptResponse, unmarshalGenerateKeyMaterialImportParametersResponse, unmarshalKey, unmarshalListAlgorithmsResponse, unmarshalListKeyRotationsResponse, unmarshalListKeysResponse, unmarshalPublicKey, unmarshalSignResponse, unmarshalUnwrapKeyResponse, unmarshalVerifyResponse, unmarshalWrapKeyResponse };
@@ -191,9 +191,19 @@ const marshalGenerateDataKeyRequest = (request, defaults) => ({
191
191
  without_plaintext: request.withoutPlaintext
192
192
  });
193
193
  const marshalGenerateKeyMaterialImportParametersRequest = (request, defaults) => ({ wrapping_algorithm: request.wrappingAlgorithm });
194
+ const marshalImportKeyMaterialRequestEncryptedKeyMaterial = (request, defaults) => ({
195
+ data: request.data,
196
+ import_token: request.importToken
197
+ });
194
198
  const marshalImportKeyMaterialRequest = (request, defaults) => ({
195
- key_material: request.keyMaterial,
196
- salt: request.salt
199
+ salt: request.salt,
200
+ ...resolveOneOf([{
201
+ param: "key_material",
202
+ value: request.keyMaterial
203
+ }, {
204
+ param: "encrypted_key_material",
205
+ value: request.encryptedKeyMaterial !== void 0 ? marshalImportKeyMaterialRequestEncryptedKeyMaterial(request.encryptedKeyMaterial, defaults) : void 0
206
+ }])
197
207
  });
198
208
  const marshalSignRequest = (request, defaults) => ({ digest: request.digest });
199
209
  const marshalUnwrapKeyRequest = (request, defaults) => ({
@@ -50,6 +50,16 @@ export interface KeyUsage {
50
50
  */
51
51
  keyEncapsulation?: KeyAlgorithmKeyEncapsulation;
52
52
  }
53
+ export interface ImportKeyMaterialRequestEncryptedKeyMaterial {
54
+ /**
55
+ * This material must be encrypted using the public key and the exact wrapping algorithm returned by the `GetKeyMaterialImportParameters` method.
56
+ */
57
+ data: string;
58
+ /**
59
+ * The secure import token returned by the `GetKeyMaterialImportParameters` method.
60
+ */
61
+ importToken: string;
62
+ }
53
63
  export interface ListAlgorithmsResponseAlgorithm {
54
64
  usage: string;
55
65
  name: string;
@@ -409,13 +419,21 @@ export type ImportKeyMaterialRequest = {
409
419
  */
410
420
  keyId: string;
411
421
  /**
412
- * The key material is a random sequence of bytes used to derive a cryptographic key.
422
+ * @deprecated Deprecated. Use `encrypted_key_material` instead. The key material is a random sequence of bytes used to derive a cryptographic key.
423
+ *
424
+ * One-of ('material'): at most one of 'keyMaterial', 'encryptedKeyMaterial' could be set.
413
425
  */
414
- keyMaterial: string;
426
+ keyMaterial?: string;
415
427
  /**
416
428
  * A salt is random data added to key material to ensure unique derived keys, even if the input is similar. It helps strengthen security when the key material has low randomness (low entropy).
417
429
  */
418
430
  salt?: string;
431
+ /**
432
+ * This material must be encrypted using the public key and the exact wrapping algorithm returned by the `GetKeyMaterialImportParameters` method.
433
+ *
434
+ * One-of ('material'): at most one of 'keyMaterial', 'encryptedKeyMaterial' could be set.
435
+ */
436
+ encryptedKeyMaterial?: ImportKeyMaterialRequestEncryptedKeyMaterial;
419
437
  };
420
438
  export type ListAlgorithmsRequest = {
421
439
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/sdk-key-manager",
3
- "version": "2.20.0",
3
+ "version": "2.21.0",
4
4
  "description": "Scaleway SDK key-manager",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -33,14 +33,14 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@scaleway/random-name": "6.0.2",
36
- "@scaleway/sdk-std": "2.9.2"
36
+ "@scaleway/sdk-std": "2.9.3"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@repo/configs": "^0.1.1",
40
- "@scaleway/sdk-client": "^2.13.0"
40
+ "@scaleway/sdk-client": "^2.14.0"
41
41
  },
42
42
  "peerDependencies": {
43
- "@scaleway/sdk-client": "^2.13.0"
43
+ "@scaleway/sdk-client": "^2.14.0"
44
44
  },
45
45
  "scripts": {
46
46
  "package:check": "pnpm publint",