@bitwarden/sdk-internal 0.2.0-main.230 → 0.2.0-main.231

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 CHANGED
@@ -1 +1 @@
1
- 212e190d2b69657f85ea04c2d7e9a5f30f7e58c1
1
+ 812865fe73b742f82360060430cb1003a9e0e3e5
@@ -136,6 +136,10 @@ export interface InitUserCryptoRequest {
136
136
  * The user\'s signing key
137
137
  */
138
138
  signingKey: EncString | undefined;
139
+ /**
140
+ * The user\'s security state
141
+ */
142
+ securityState: SignedSecurityState | undefined;
139
143
  /**
140
144
  * The initialization method to use
141
145
  */
@@ -273,49 +277,45 @@ export interface VerifyAsymmetricKeysResponse {
273
277
  }
274
278
 
275
279
  /**
276
- * A new signing key pair along with the signed public key
280
+ * Response for the `make_keys_for_user_crypto_v2`, containing a set of keys for a user
277
281
  */
278
- export interface MakeUserSigningKeysResponse {
282
+ export interface UserCryptoV2KeysResponse {
279
283
  /**
280
- * Base64 encoded verifying key
284
+ * User key
281
285
  */
282
- verifyingKey: string;
286
+ userKey: string;
283
287
  /**
284
- * Signing key, encrypted with the user\'s symmetric key
288
+ * Wrapped private key
285
289
  */
286
- signingKey: EncString;
290
+ privateKey: EncString;
287
291
  /**
288
- * The user\'s public key, signed by the signing key
292
+ * Public key
289
293
  */
290
- signedPublicKey: SignedPublicKey;
291
- }
292
-
293
- /**
294
- * A rotated set of account keys for a user
295
- */
296
- export interface RotateUserKeysResponse {
294
+ publicKey: string;
297
295
  /**
298
- * The verifying key
296
+ * The user\'s public key, signed by the signing key
299
297
  */
300
- verifyingKey: string;
298
+ signedPublicKey: SignedPublicKey;
301
299
  /**
302
- * Signing key, encrypted with a symmetric key (user key, org key)
300
+ * Signing key, encrypted with the user\'s symmetric key
303
301
  */
304
302
  signingKey: EncString;
305
303
  /**
306
- * The user\'s public key, signed by the signing key
304
+ * Base64 encoded verifying key
307
305
  */
308
- signedPublicKey: string;
306
+ verifyingKey: string;
309
307
  /**
310
- * The user\'s public key, without signature
308
+ * The user\'s signed security state
311
309
  */
312
- publicKey: string;
310
+ securityState: SignedSecurityState;
313
311
  /**
314
- * The user\'s private key, encrypted with the user key
312
+ * The security state\'s version
315
313
  */
316
- privateKey: EncString;
314
+ securityVersion: number;
317
315
  }
318
316
 
317
+ export type SignedSecurityState = string;
318
+
319
319
  /**
320
320
  * NewType wrapper for `OrganizationId`
321
321
  */
@@ -342,6 +342,13 @@ export interface CryptoClientError extends Error {
342
342
 
343
343
  export function isCryptoClientError(error: any): error is CryptoClientError;
344
344
 
345
+ export interface StatefulCryptoError extends Error {
346
+ name: "StatefulCryptoError";
347
+ variant: "MissingSecurityState" | "WrongAccountCryptoVersion" | "CryptoError";
348
+ }
349
+
350
+ export function isStatefulCryptoError(error: any): error is StatefulCryptoError;
351
+
345
352
  export interface EncryptionSettingsError extends Error {
346
353
  name: "EncryptionSettingsError";
347
354
  variant:
@@ -350,6 +357,7 @@ export interface EncryptionSettingsError extends Error {
350
357
  | "VaultLocked"
351
358
  | "InvalidPrivateKey"
352
359
  | "InvalidSigningKey"
360
+ | "InvalidSecurityState"
353
361
  | "MissingPrivateKey"
354
362
  | "UserIdAlreadySetError";
355
363
  }
@@ -1359,11 +1367,11 @@ export class CryptoClient {
1359
1367
  /**
1360
1368
  * Makes a new signing key pair and signs the public key for the user
1361
1369
  */
1362
- make_user_signing_keys_for_enrollment(): MakeUserSigningKeysResponse;
1370
+ make_keys_for_user_crypto_v2(): UserCryptoV2KeysResponse;
1363
1371
  /**
1364
1372
  * Creates a rotated set of account keys for the current state
1365
1373
  */
1366
- get_v2_rotated_account_keys(user_key: string): RotateUserKeysResponse;
1374
+ get_v2_rotated_account_keys(): UserCryptoV2KeysResponse;
1367
1375
  }
1368
1376
  export class ExporterClient {
1369
1377
  private constructor();
@@ -290,6 +290,19 @@ export function isCryptoClientError(error) {
290
290
  }
291
291
  }
292
292
 
293
+ /**
294
+ * @param {any} error
295
+ * @returns {boolean}
296
+ */
297
+ export function isStatefulCryptoError(error) {
298
+ try {
299
+ const ret = wasm.isStatefulCryptoError(addBorrowedObject(error));
300
+ return ret !== 0;
301
+ } finally {
302
+ heap[stack_pointer++] = undefined;
303
+ }
304
+ }
305
+
293
306
  /**
294
307
  * @param {any} error
295
308
  * @returns {boolean}
@@ -753,7 +766,7 @@ function __wbg_adapter_56(arg0, arg1, arg2) {
753
766
  );
754
767
  }
755
768
 
756
- function __wbg_adapter_280(arg0, arg1, arg2, arg3) {
769
+ function __wbg_adapter_281(arg0, arg1, arg2, arg3) {
757
770
  wasm.wasm_bindgen__convert__closures__invoke2_mut__h8776500d04a3e634(
758
771
  arg0,
759
772
  arg1,
@@ -1424,12 +1437,12 @@ export class CryptoClient {
1424
1437
  }
1425
1438
  /**
1426
1439
  * Makes a new signing key pair and signs the public key for the user
1427
- * @returns {MakeUserSigningKeysResponse}
1440
+ * @returns {UserCryptoV2KeysResponse}
1428
1441
  */
1429
- make_user_signing_keys_for_enrollment() {
1442
+ make_keys_for_user_crypto_v2() {
1430
1443
  try {
1431
1444
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1432
- wasm.cryptoclient_make_user_signing_keys_for_enrollment(retptr, this.__wbg_ptr);
1445
+ wasm.cryptoclient_make_keys_for_user_crypto_v2(retptr, this.__wbg_ptr);
1433
1446
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1434
1447
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1435
1448
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -1443,15 +1456,12 @@ export class CryptoClient {
1443
1456
  }
1444
1457
  /**
1445
1458
  * Creates a rotated set of account keys for the current state
1446
- * @param {string} user_key
1447
- * @returns {RotateUserKeysResponse}
1459
+ * @returns {UserCryptoV2KeysResponse}
1448
1460
  */
1449
- get_v2_rotated_account_keys(user_key) {
1461
+ get_v2_rotated_account_keys() {
1450
1462
  try {
1451
1463
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1452
- const ptr0 = passStringToWasm0(user_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1453
- const len0 = WASM_VECTOR_LEN;
1454
- wasm.cryptoclient_get_v2_rotated_account_keys(retptr, this.__wbg_ptr, ptr0, len0);
1464
+ wasm.cryptoclient_get_v2_rotated_account_keys(retptr, this.__wbg_ptr);
1455
1465
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1456
1466
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1457
1467
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -3409,19 +3419,7 @@ export function __wbg_getTime_46267b1c24877e30(arg0) {
3409
3419
  return ret;
3410
3420
  }
3411
3421
 
3412
- export function __wbg_get_67b2ba62fc30de12() {
3413
- return handleError(function (arg0, arg1) {
3414
- const ret = Reflect.get(getObject(arg0), getObject(arg1));
3415
- return addHeapObject(ret);
3416
- }, arguments);
3417
- }
3418
-
3419
- export function __wbg_get_b9b93047fe3cf45b(arg0, arg1) {
3420
- const ret = getObject(arg0)[arg1 >>> 0];
3421
- return addHeapObject(ret);
3422
- }
3423
-
3424
- export function __wbg_get_fe8b1fc2a9351d29() {
3422
+ export function __wbg_get_29fa07573edd0414() {
3425
3423
  return handleError(function (arg0, arg1, arg2) {
3426
3424
  let deferred0_0;
3427
3425
  let deferred0_1;
@@ -3436,7 +3434,19 @@ export function __wbg_get_fe8b1fc2a9351d29() {
3436
3434
  }, arguments);
3437
3435
  }
3438
3436
 
3439
- export function __wbg_getaccesstoken_add1fa985a1fcf9b(arg0) {
3437
+ export function __wbg_get_67b2ba62fc30de12() {
3438
+ return handleError(function (arg0, arg1) {
3439
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
3440
+ return addHeapObject(ret);
3441
+ }, arguments);
3442
+ }
3443
+
3444
+ export function __wbg_get_b9b93047fe3cf45b(arg0, arg1) {
3445
+ const ret = getObject(arg0)[arg1 >>> 0];
3446
+ return addHeapObject(ret);
3447
+ }
3448
+
3449
+ export function __wbg_getaccesstoken_c1ea3be055452912(arg0) {
3440
3450
  const ret = getObject(arg0).get_access_token();
3441
3451
  return addHeapObject(ret);
3442
3452
  }
@@ -3541,7 +3551,7 @@ export function __wbg_length_e2d2a49132c1b256(arg0) {
3541
3551
  return ret;
3542
3552
  }
3543
3553
 
3544
- export function __wbg_list_e78f0f65f8a26cd6() {
3554
+ export function __wbg_list_b393427351b308b4() {
3545
3555
  return handleError(function (arg0) {
3546
3556
  const ret = getObject(arg0).list();
3547
3557
  return addHeapObject(ret);
@@ -3576,7 +3586,7 @@ export function __wbg_new_23a2665fac83c611(arg0, arg1) {
3576
3586
  const a = state0.a;
3577
3587
  state0.a = 0;
3578
3588
  try {
3579
- return __wbg_adapter_280(a, state0.b, arg0, arg1);
3589
+ return __wbg_adapter_281(a, state0.b, arg0, arg1);
3580
3590
  } finally {
3581
3591
  state0.a = a;
3582
3592
  }
@@ -3718,7 +3728,7 @@ export function __wbg_randomFillSync_ac0988aba3254290() {
3718
3728
  }, arguments);
3719
3729
  }
3720
3730
 
3721
- export function __wbg_remove_ea8cb7fadc70e111() {
3731
+ export function __wbg_remove_39bec51fb6464483() {
3722
3732
  return handleError(function (arg0, arg1, arg2) {
3723
3733
  let deferred0_0;
3724
3734
  let deferred0_1;
@@ -3769,7 +3779,7 @@ export function __wbg_set_65595bdd868b3009(arg0, arg1, arg2) {
3769
3779
  getObject(arg0).set(getObject(arg1), arg2 >>> 0);
3770
3780
  }
3771
3781
 
3772
- export function __wbg_set_84a98f482fda77e5() {
3782
+ export function __wbg_set_dac2905b348768e9() {
3773
3783
  return handleError(function (arg0, arg1, arg2, arg3) {
3774
3784
  let deferred0_0;
3775
3785
  let deferred0_1;
@@ -3963,18 +3973,18 @@ export function __wbindgen_cb_drop(arg0) {
3963
3973
  return ret;
3964
3974
  }
3965
3975
 
3966
- export function __wbindgen_closure_wrapper2913(arg0, arg1, arg2) {
3967
- const ret = makeMutClosure(arg0, arg1, 920, __wbg_adapter_50);
3976
+ export function __wbindgen_closure_wrapper2952(arg0, arg1, arg2) {
3977
+ const ret = makeMutClosure(arg0, arg1, 928, __wbg_adapter_50);
3968
3978
  return addHeapObject(ret);
3969
3979
  }
3970
3980
 
3971
- export function __wbindgen_closure_wrapper3753(arg0, arg1, arg2) {
3972
- const ret = makeMutClosure(arg0, arg1, 1004, __wbg_adapter_53);
3981
+ export function __wbindgen_closure_wrapper3792(arg0, arg1, arg2) {
3982
+ const ret = makeMutClosure(arg0, arg1, 1012, __wbg_adapter_53);
3973
3983
  return addHeapObject(ret);
3974
3984
  }
3975
3985
 
3976
- export function __wbindgen_closure_wrapper4171(arg0, arg1, arg2) {
3977
- const ret = makeMutClosure(arg0, arg1, 1127, __wbg_adapter_56);
3986
+ export function __wbindgen_closure_wrapper4211(arg0, arg1, arg2) {
3987
+ const ret = makeMutClosure(arg0, arg1, 1134, __wbg_adapter_56);
3978
3988
  return addHeapObject(ret);
3979
3989
  }
3980
3990
 
Binary file
@@ -6,16 +6,12 @@ export const cryptoclient_initialize_user_crypto: (a: number, b: number) => numb
6
6
  export const cryptoclient_initialize_org_crypto: (a: number, b: number) => number;
7
7
  export const cryptoclient_make_key_pair: (a: number, b: number, c: number, d: number) => void;
8
8
  export const cryptoclient_verify_asymmetric_keys: (a: number, b: number, c: number) => void;
9
- export const cryptoclient_make_user_signing_keys_for_enrollment: (a: number, b: number) => void;
10
- export const cryptoclient_get_v2_rotated_account_keys: (
11
- a: number,
12
- b: number,
13
- c: number,
14
- d: number,
15
- ) => void;
9
+ export const cryptoclient_make_keys_for_user_crypto_v2: (a: number, b: number) => void;
10
+ export const cryptoclient_get_v2_rotated_account_keys: (a: number, b: number) => void;
16
11
  export const isDeriveKeyConnectorError: (a: number) => number;
17
12
  export const isEnrollAdminPasswordResetError: (a: number) => number;
18
13
  export const isCryptoClientError: (a: number) => number;
14
+ export const isStatefulCryptoError: (a: number) => number;
19
15
  export const isEncryptionSettingsError: (a: number) => number;
20
16
  export const isCryptoError: (a: number) => number;
21
17
  export const __wbg_exporterclient_free: (a: number, b: number) => void;