@bitwarden/sdk-internal 0.2.0-main.236 → 0.2.0-main.238
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/VERSION +1 -1
- package/bitwarden_wasm_internal.d.ts +19 -1
- package/bitwarden_wasm_internal_bg.js +76 -38
- package/bitwarden_wasm_internal_bg.wasm +0 -0
- package/bitwarden_wasm_internal_bg.wasm.d.ts +7 -0
- package/bitwarden_wasm_internal_bg.wasm.js +1 -1
- package/node/bitwarden_wasm_internal.d.ts +19 -1
- package/node/bitwarden_wasm_internal.js +76 -38
- package/node/bitwarden_wasm_internal_bg.wasm +0 -0
- package/node/bitwarden_wasm_internal_bg.wasm.d.ts +7 -0
- package/package.json +1 -1
|
@@ -1250,7 +1250,12 @@ export interface CipherPermissions {
|
|
|
1250
1250
|
|
|
1251
1251
|
export interface CipherError extends Error {
|
|
1252
1252
|
name: "CipherError";
|
|
1253
|
-
variant:
|
|
1253
|
+
variant:
|
|
1254
|
+
| "MissingFieldError"
|
|
1255
|
+
| "VaultLocked"
|
|
1256
|
+
| "CryptoError"
|
|
1257
|
+
| "EncryptError"
|
|
1258
|
+
| "AttachmentsWithoutKeys";
|
|
1254
1259
|
}
|
|
1255
1260
|
|
|
1256
1261
|
export function isCipherError(error: any): error is CipherError;
|
|
@@ -1384,6 +1389,19 @@ export class CiphersClient {
|
|
|
1384
1389
|
private constructor();
|
|
1385
1390
|
free(): void;
|
|
1386
1391
|
encrypt(cipher_view: CipherView): EncryptionContext;
|
|
1392
|
+
/**
|
|
1393
|
+
* Encrypt a cipher with the provided key. This should only be used when rotating encryption
|
|
1394
|
+
* keys in the Web client.
|
|
1395
|
+
*
|
|
1396
|
+
* Until key rotation is fully implemented in the SDK, this method must be provided the new
|
|
1397
|
+
* symmetric key in base64 format. See PM-23084
|
|
1398
|
+
*
|
|
1399
|
+
* If the cipher has a CipherKey, it will be re-encrypted with the new key.
|
|
1400
|
+
* If the cipher does not have a CipherKey and CipherKeyEncryption is enabled, one will be
|
|
1401
|
+
* generated using the new key. Otherwise, the cipher's data will be encrypted with the new
|
|
1402
|
+
* key directly.
|
|
1403
|
+
*/
|
|
1404
|
+
encrypt_cipher_for_rotation(cipher_view: CipherView, new_key_b64: string): EncryptionContext;
|
|
1387
1405
|
decrypt(cipher: Cipher): CipherView;
|
|
1388
1406
|
decrypt_list(ciphers: Cipher[]): CipherListView[];
|
|
1389
1407
|
/**
|
|
@@ -790,7 +790,7 @@ function __wbg_adapter_59(arg0, arg1, arg2) {
|
|
|
790
790
|
);
|
|
791
791
|
}
|
|
792
792
|
|
|
793
|
-
function
|
|
793
|
+
function __wbg_adapter_304(arg0, arg1, arg2, arg3) {
|
|
794
794
|
wasm.wasm_bindgen__convert__closures__invoke2_mut__h54a8613170fef18e(
|
|
795
795
|
arg0,
|
|
796
796
|
arg1,
|
|
@@ -1254,6 +1254,44 @@ class CiphersClient {
|
|
|
1254
1254
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1255
1255
|
}
|
|
1256
1256
|
}
|
|
1257
|
+
/**
|
|
1258
|
+
* Encrypt a cipher with the provided key. This should only be used when rotating encryption
|
|
1259
|
+
* keys in the Web client.
|
|
1260
|
+
*
|
|
1261
|
+
* Until key rotation is fully implemented in the SDK, this method must be provided the new
|
|
1262
|
+
* symmetric key in base64 format. See PM-23084
|
|
1263
|
+
*
|
|
1264
|
+
* If the cipher has a CipherKey, it will be re-encrypted with the new key.
|
|
1265
|
+
* If the cipher does not have a CipherKey and CipherKeyEncryption is enabled, one will be
|
|
1266
|
+
* generated using the new key. Otherwise, the cipher's data will be encrypted with the new
|
|
1267
|
+
* key directly.
|
|
1268
|
+
* @param {CipherView} cipher_view
|
|
1269
|
+
* @param {string} new_key_b64
|
|
1270
|
+
* @returns {EncryptionContext}
|
|
1271
|
+
*/
|
|
1272
|
+
encrypt_cipher_for_rotation(cipher_view, new_key_b64) {
|
|
1273
|
+
try {
|
|
1274
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1275
|
+
const ptr0 = passStringToWasm0(new_key_b64, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1276
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1277
|
+
wasm.ciphersclient_encrypt_cipher_for_rotation(
|
|
1278
|
+
retptr,
|
|
1279
|
+
this.__wbg_ptr,
|
|
1280
|
+
addHeapObject(cipher_view),
|
|
1281
|
+
ptr0,
|
|
1282
|
+
len0,
|
|
1283
|
+
);
|
|
1284
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1285
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1286
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1287
|
+
if (r2) {
|
|
1288
|
+
throw takeObject(r1);
|
|
1289
|
+
}
|
|
1290
|
+
return takeObject(r0);
|
|
1291
|
+
} finally {
|
|
1292
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1257
1295
|
/**
|
|
1258
1296
|
* @param {Cipher} cipher
|
|
1259
1297
|
* @returns {CipherView}
|
|
@@ -3609,7 +3647,14 @@ module.exports.__wbg_getTime_46267b1c24877e30 = function (arg0) {
|
|
|
3609
3647
|
return ret;
|
|
3610
3648
|
};
|
|
3611
3649
|
|
|
3612
|
-
module.exports.
|
|
3650
|
+
module.exports.__wbg_get_67b2ba62fc30de12 = function () {
|
|
3651
|
+
return handleError(function (arg0, arg1) {
|
|
3652
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
3653
|
+
return addHeapObject(ret);
|
|
3654
|
+
}, arguments);
|
|
3655
|
+
};
|
|
3656
|
+
|
|
3657
|
+
module.exports.__wbg_get_855e1bc0d4aa7606 = function () {
|
|
3613
3658
|
return handleError(function (arg0, arg1, arg2) {
|
|
3614
3659
|
let deferred0_0;
|
|
3615
3660
|
let deferred0_1;
|
|
@@ -3624,19 +3669,7 @@ module.exports.__wbg_get_3a1427c0878724ca = function () {
|
|
|
3624
3669
|
}, arguments);
|
|
3625
3670
|
};
|
|
3626
3671
|
|
|
3627
|
-
module.exports.
|
|
3628
|
-
return handleError(function (arg0, arg1) {
|
|
3629
|
-
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
3630
|
-
return addHeapObject(ret);
|
|
3631
|
-
}, arguments);
|
|
3632
|
-
};
|
|
3633
|
-
|
|
3634
|
-
module.exports.__wbg_get_b9b93047fe3cf45b = function (arg0, arg1) {
|
|
3635
|
-
const ret = getObject(arg0)[arg1 >>> 0];
|
|
3636
|
-
return addHeapObject(ret);
|
|
3637
|
-
};
|
|
3638
|
-
|
|
3639
|
-
module.exports.__wbg_get_d3918b747669680e = function () {
|
|
3672
|
+
module.exports.__wbg_get_9777d492540c5e0c = function () {
|
|
3640
3673
|
return handleError(function (arg0, arg1, arg2) {
|
|
3641
3674
|
let deferred0_0;
|
|
3642
3675
|
let deferred0_1;
|
|
@@ -3651,7 +3684,12 @@ module.exports.__wbg_get_d3918b747669680e = function () {
|
|
|
3651
3684
|
}, arguments);
|
|
3652
3685
|
};
|
|
3653
3686
|
|
|
3654
|
-
module.exports.
|
|
3687
|
+
module.exports.__wbg_get_b9b93047fe3cf45b = function (arg0, arg1) {
|
|
3688
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
3689
|
+
return addHeapObject(ret);
|
|
3690
|
+
};
|
|
3691
|
+
|
|
3692
|
+
module.exports.__wbg_getaccesstoken_ce2c612902767bce = function (arg0) {
|
|
3655
3693
|
const ret = getObject(arg0).get_access_token();
|
|
3656
3694
|
return addHeapObject(ret);
|
|
3657
3695
|
};
|
|
@@ -3756,14 +3794,14 @@ module.exports.__wbg_length_e2d2a49132c1b256 = function (arg0) {
|
|
|
3756
3794
|
return ret;
|
|
3757
3795
|
};
|
|
3758
3796
|
|
|
3759
|
-
module.exports.
|
|
3797
|
+
module.exports.__wbg_list_cf889d601f148450 = function () {
|
|
3760
3798
|
return handleError(function (arg0) {
|
|
3761
3799
|
const ret = getObject(arg0).list();
|
|
3762
3800
|
return addHeapObject(ret);
|
|
3763
3801
|
}, arguments);
|
|
3764
3802
|
};
|
|
3765
3803
|
|
|
3766
|
-
module.exports.
|
|
3804
|
+
module.exports.__wbg_list_da1d94c7e3ca0f96 = function () {
|
|
3767
3805
|
return handleError(function (arg0) {
|
|
3768
3806
|
const ret = getObject(arg0).list();
|
|
3769
3807
|
return addHeapObject(ret);
|
|
@@ -3798,7 +3836,7 @@ module.exports.__wbg_new_23a2665fac83c611 = function (arg0, arg1) {
|
|
|
3798
3836
|
const a = state0.a;
|
|
3799
3837
|
state0.a = 0;
|
|
3800
3838
|
try {
|
|
3801
|
-
return
|
|
3839
|
+
return __wbg_adapter_304(a, state0.b, arg0, arg1);
|
|
3802
3840
|
} finally {
|
|
3803
3841
|
state0.a = a;
|
|
3804
3842
|
}
|
|
@@ -3940,7 +3978,7 @@ module.exports.__wbg_randomFillSync_ac0988aba3254290 = function () {
|
|
|
3940
3978
|
}, arguments);
|
|
3941
3979
|
};
|
|
3942
3980
|
|
|
3943
|
-
module.exports.
|
|
3981
|
+
module.exports.__wbg_remove_7caeb180f1761e63 = function () {
|
|
3944
3982
|
return handleError(function (arg0, arg1, arg2) {
|
|
3945
3983
|
let deferred0_0;
|
|
3946
3984
|
let deferred0_1;
|
|
@@ -3955,7 +3993,7 @@ module.exports.__wbg_remove_13f511741431214a = function () {
|
|
|
3955
3993
|
}, arguments);
|
|
3956
3994
|
};
|
|
3957
3995
|
|
|
3958
|
-
module.exports.
|
|
3996
|
+
module.exports.__wbg_remove_aa8f346580209eb2 = function () {
|
|
3959
3997
|
return handleError(function (arg0, arg1, arg2) {
|
|
3960
3998
|
let deferred0_0;
|
|
3961
3999
|
let deferred0_1;
|
|
@@ -3994,7 +4032,19 @@ module.exports.__wbg_setTimeout_ca12ead8b48245e2 = function (arg0, arg1) {
|
|
|
3994
4032
|
return addHeapObject(ret);
|
|
3995
4033
|
};
|
|
3996
4034
|
|
|
3997
|
-
module.exports.
|
|
4035
|
+
module.exports.__wbg_set_37837023f3d740e8 = function (arg0, arg1, arg2) {
|
|
4036
|
+
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
|
4037
|
+
};
|
|
4038
|
+
|
|
4039
|
+
module.exports.__wbg_set_3f1d0b984ed272ed = function (arg0, arg1, arg2) {
|
|
4040
|
+
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
4041
|
+
};
|
|
4042
|
+
|
|
4043
|
+
module.exports.__wbg_set_65595bdd868b3009 = function (arg0, arg1, arg2) {
|
|
4044
|
+
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
4045
|
+
};
|
|
4046
|
+
|
|
4047
|
+
module.exports.__wbg_set_88bf4e7417396abd = function () {
|
|
3998
4048
|
return handleError(function (arg0, arg1, arg2, arg3) {
|
|
3999
4049
|
let deferred0_0;
|
|
4000
4050
|
let deferred0_1;
|
|
@@ -4009,19 +4059,7 @@ module.exports.__wbg_set_0b7a3fe7f70573c5 = function () {
|
|
|
4009
4059
|
}, arguments);
|
|
4010
4060
|
};
|
|
4011
4061
|
|
|
4012
|
-
module.exports.
|
|
4013
|
-
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
|
4014
|
-
};
|
|
4015
|
-
|
|
4016
|
-
module.exports.__wbg_set_3f1d0b984ed272ed = function (arg0, arg1, arg2) {
|
|
4017
|
-
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
4018
|
-
};
|
|
4019
|
-
|
|
4020
|
-
module.exports.__wbg_set_65595bdd868b3009 = function (arg0, arg1, arg2) {
|
|
4021
|
-
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
4022
|
-
};
|
|
4023
|
-
|
|
4024
|
-
module.exports.__wbg_set_c3bb1dc8c40a7b27 = function () {
|
|
4062
|
+
module.exports.__wbg_set_b83b392571188311 = function () {
|
|
4025
4063
|
return handleError(function (arg0, arg1, arg2, arg3) {
|
|
4026
4064
|
let deferred0_0;
|
|
4027
4065
|
let deferred0_1;
|
|
@@ -4224,17 +4262,17 @@ module.exports.__wbindgen_cb_drop = function (arg0) {
|
|
|
4224
4262
|
return ret;
|
|
4225
4263
|
};
|
|
4226
4264
|
|
|
4227
|
-
module.exports.
|
|
4265
|
+
module.exports.__wbindgen_closure_wrapper3189 = function (arg0, arg1, arg2) {
|
|
4228
4266
|
const ret = makeMutClosure(arg0, arg1, 254, __wbg_adapter_54);
|
|
4229
4267
|
return addHeapObject(ret);
|
|
4230
4268
|
};
|
|
4231
4269
|
|
|
4232
|
-
module.exports.
|
|
4270
|
+
module.exports.__wbindgen_closure_wrapper5440 = function (arg0, arg1, arg2) {
|
|
4233
4271
|
const ret = makeMutClosure(arg0, arg1, 279, __wbg_adapter_54);
|
|
4234
4272
|
return addHeapObject(ret);
|
|
4235
4273
|
};
|
|
4236
4274
|
|
|
4237
|
-
module.exports.
|
|
4275
|
+
module.exports.__wbindgen_closure_wrapper5799 = function (arg0, arg1, arg2) {
|
|
4238
4276
|
const ret = makeMutClosure(arg0, arg1, 304, __wbg_adapter_59);
|
|
4239
4277
|
return addHeapObject(ret);
|
|
4240
4278
|
};
|
|
Binary file
|
|
@@ -289,6 +289,13 @@ export const attachmentsclient_decrypt_buffer: (
|
|
|
289
289
|
f: number,
|
|
290
290
|
) => void;
|
|
291
291
|
export const ciphersclient_encrypt: (a: number, b: number, c: number) => void;
|
|
292
|
+
export const ciphersclient_encrypt_cipher_for_rotation: (
|
|
293
|
+
a: number,
|
|
294
|
+
b: number,
|
|
295
|
+
c: number,
|
|
296
|
+
d: number,
|
|
297
|
+
e: number,
|
|
298
|
+
) => void;
|
|
292
299
|
export const ciphersclient_decrypt: (a: number, b: number, c: number) => void;
|
|
293
300
|
export const ciphersclient_decrypt_list: (a: number, b: number, c: number, d: number) => void;
|
|
294
301
|
export const ciphersclient_decrypt_list_with_failures: (a: number, b: number, c: number) => number;
|