@metamask-previews/seedless-onboarding-controller 12.0.0-preview-c3ccf7def → 12.0.0-preview-270326558
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/CHANGELOG.md +27 -0
- package/dist/SeedlessOnboardingController-method-action-types.d.ts +105 -1
- package/dist/SeedlessOnboardingController-method-action-types.d.ts.map +1 -1
- package/dist/SeedlessOnboardingController-method-action-types.js.map +1 -1
- package/dist/SeedlessOnboardingController.d.ts +103 -0
- package/dist/SeedlessOnboardingController.d.ts.map +1 -1
- package/dist/SeedlessOnboardingController.js +777 -46
- package/dist/SeedlessOnboardingController.js.map +1 -1
- package/dist/constants.d.ts +8 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +7 -0
- package/dist/constants.js.map +1 -1
- package/dist/envelope/EnvelopeStore.d.ts +53 -0
- package/dist/envelope/EnvelopeStore.d.ts.map +1 -0
- package/dist/envelope/EnvelopeStore.js +141 -0
- package/dist/envelope/EnvelopeStore.js.map +1 -0
- package/dist/envelope/envelope-keys.d.ts +134 -0
- package/dist/envelope/envelope-keys.d.ts.map +1 -0
- package/dist/envelope/envelope-keys.js +251 -0
- package/dist/envelope/envelope-keys.js.map +1 -0
- package/dist/envelope/pending-migration.d.ts +40 -0
- package/dist/envelope/pending-migration.d.ts.map +1 -0
- package/dist/envelope/pending-migration.js +69 -0
- package/dist/envelope/pending-migration.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/mfa-recovery/recovery-session.d.ts +28 -0
- package/dist/mfa-recovery/recovery-session.d.ts.map +1 -0
- package/dist/mfa-recovery/recovery-session.js +42 -0
- package/dist/mfa-recovery/recovery-session.js.map +1 -0
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +18 -0
- package/dist/state.js.map +1 -1
- package/dist/types.d.ts +46 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/utils.d.ts +8 -0
- package/dist/utils/utils.d.ts.map +1 -1
- package/dist/utils/utils.js +11 -0
- package/dist/utils/utils.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
10
10
|
### Added
|
|
11
11
|
|
|
12
12
|
- Add support for Node.js 26 ([#10981](https://github.com/MetaMask/core/pull/10981))
|
|
13
|
+
- Add `authenticateForRecovery` and the `SeedlessOnboardingController:authenticateForRecovery` messenger action ([#11220](https://github.com/MetaMask/core/pull/11220))
|
|
14
|
+
- `authenticateForRecovery` takes `authConnectionId` and `groupedAuthConnectionId`, and uses the aal2 token as the id token and its `sub` as the user ID.
|
|
15
|
+
- Add non-persisted `recoverySession` state and the `RecoverySession` type. The session holds recovery-node tokens, expiry, profile ID, verifier IDs, and whether the nodes hold a recovery share, and is cleared on lock and `clearState` ([#11220](https://github.com/MetaMask/core/pull/11220))
|
|
16
|
+
- Add `migrateToEnvelope` and the `SeedlessOnboardingController:migrateToEnvelope` messenger action, which make the current vault keys the stable vault key set of the account ([#11220](https://github.com/MetaMask/core/pull/11220))
|
|
17
|
+
- Takes the 32-byte `recoverySecret` and no password. It requires an unlocked vault that is in sync with the global password, an aal2 session from `authenticateForRecovery`, and `migrationVersion` `V1` or later.
|
|
18
|
+
- Registers the Recovery Secret on the recovery verifier if the nodes hold no share for it yet.
|
|
19
|
+
- Writes the vault keys sealed for the Recovery Secret, plus a control record, as `KeyEnvelope` and `EnvelopeControl` data items in their own metadata partitions, under the vault's metadata lock. Secret data items and the vault are not changed.
|
|
20
|
+
- No envelope is written for the password, because the current password still derives the vault keys. The first `changePassword` after migration writes it.
|
|
21
|
+
- The sealed envelope is checkpointed before the first write, so a failed call can be retried with the same arguments. Does nothing if the vault is already envelope-managed, including when another device migrated it.
|
|
22
|
+
- Add `recoverWithRecoverySecret` and the `SeedlessOnboardingController:recoverWithRecoverySecret` messenger action, which restore an envelope-managed vault with the Recovery Secret instead of the password ([#11220](https://github.com/MetaMask/core/pull/11220))
|
|
23
|
+
- Takes the 32-byte `recoverySecret` and the `password` of the new local vault, and requires the social login session and an aal2 session from `authenticateForRecovery`.
|
|
24
|
+
- Opens the vault keys sealed for the Recovery Secret, fetches the secret data with them, creates the local vault under `password`, and returns the secret data.
|
|
25
|
+
- Discards any pending `pendingEnvelopeMigration` checkpoint, since the local vault it belongs to is replaced.
|
|
26
|
+
- The local password counts as outdated until it is synced with `syncLatestGlobalPassword` or set as the global password with `resetPasswordWithVaultKeys`.
|
|
27
|
+
- Add `resetPasswordWithVaultKeys` and the `SeedlessOnboardingController:resetPasswordWithVaultKeys` messenger action, which set a new global password on an unlocked, envelope-managed vault without the old password after `recoverWithRecoverySecret` ([#11220](https://github.com/MetaMask/core/pull/11220))
|
|
28
|
+
- Only allowed while `EnvelopeState.passwordAuthPubKey` is unset and with a valid aal2 session from `authenticateForRecovery`; otherwise it throws `PasswordResetRequiresRecovery` or `Aal2Required`. Once the local password is synced or reset, use `changePassword`.
|
|
29
|
+
- The password OPRF key swap is signed with the auth key stored in the vault's control record. The vault keys and secret data are not changed, and the local vault is re-encrypted under `newPassword`.
|
|
30
|
+
- Add persisted `envelope` state and the `EnvelopeState` type, set once the vault is envelope-managed, and persisted, encrypted `pendingEnvelopeMigration` state for the migration checkpoint ([#11220](https://github.com/MetaMask/core/pull/11220))
|
|
31
|
+
- `EnvelopeState.passwordAuthPubKey` is unset after `recoverWithRecoverySecret`, until the local password is synced or reset.
|
|
32
|
+
- Add `Aal2Required`, `RecoveryKeyShareConflict`, `InvalidEnvelope`, `EnvelopeControlRecordNotFound`, `EnvelopeMigrationRequiresDataTypes`, `RecoveryEnvelopeNotFound`, and `PasswordResetRequiresRecovery` error messages ([#11220](https://github.com/MetaMask/core/pull/11220))
|
|
13
33
|
|
|
14
34
|
### Changed
|
|
15
35
|
|
|
@@ -18,6 +38,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
18
38
|
- Bump `@metamask/base-controller` from `^10.0.0` to `^10.1.0` ([#10864](https://github.com/MetaMask/core/pull/10864))
|
|
19
39
|
- Bump `@metamask/analytics-controller` from `^4.0.0` to `^4.3.0` ([#11072](https://github.com/MetaMask/core/pull/11072), [#11323](https://github.com/MetaMask/core/pull/11323), [#11391](https://github.com/MetaMask/core/pull/11391))
|
|
20
40
|
- Bump `@metamask/utils` from `^12.0.0` to `^12.0.1` ([#11107](https://github.com/MetaMask/core/pull/11107))
|
|
41
|
+
- `changePassword` on an envelope-managed vault keeps the vault keys: it seals them for the new password, appends a control record, and then swaps the password OPRF key, under the vault's metadata lock. Vaults that another device migrated are detected through their control record ([#11220](https://github.com/MetaMask/core/pull/11220))
|
|
42
|
+
- `syncLatestGlobalPassword` and `submitGlobalPassword` open the envelope sealed for the global password first, and fall back to the existing key chain if there is none. A failed envelope fetch is reported as an error, not treated as a missing envelope ([#11220](https://github.com/MetaMask/core/pull/11220))
|
|
43
|
+
- When `syncLatestGlobalPassword` falls back, it keeps `envelope` state if the password's key set has a control record, and clears it otherwise.
|
|
44
|
+
- `fetchAllSecretData` with a password opens the envelope sealed for that password first, and restores the vault with the sealed vault keys and sets `envelope` state if there is one ([#11220](https://github.com/MetaMask/core/pull/11220))
|
|
45
|
+
- If the password has no envelope but its key set has a control record, it restores with the password's keys and sets `envelope` state.
|
|
46
|
+
- `checkIsPasswordOutdated` compares the global password key with `envelope.passwordAuthPubKey` on an envelope-managed vault, and reports the password as outdated while `envelope.passwordAuthPubKey` is unset ([#11220](https://github.com/MetaMask/core/pull/11220))
|
|
47
|
+
- Bump `@metamask/auth-network-utils` from `^0.3.0` to `^0.4.0` ([#11220](https://github.com/MetaMask/core/pull/11220))
|
|
21
48
|
|
|
22
49
|
## [12.0.0]
|
|
23
50
|
|
|
@@ -95,6 +95,9 @@ export type SeedlessOnboardingControllerFetchAllSecretDataAction = {
|
|
|
95
95
|
* Update the password of the seedless onboarding flow.
|
|
96
96
|
*
|
|
97
97
|
* Changing password will also update the encryption key, metadata store and the vault with new encrypted values.
|
|
98
|
+
* If the vault is envelope-managed, only the password envelope and the
|
|
99
|
+
* password OPRF key change; the vault keys and the backend vault stay as
|
|
100
|
+
* they are.
|
|
98
101
|
*
|
|
99
102
|
* @param newPassword - The new password to update.
|
|
100
103
|
* @param oldPassword - The old password to verify.
|
|
@@ -275,6 +278,107 @@ export type SeedlessOnboardingControllerRefreshAuthTokensAction = {
|
|
|
275
278
|
type: `SeedlessOnboardingController:refreshAuthTokens`;
|
|
276
279
|
handler: SeedlessOnboardingController['refreshAuthTokens'];
|
|
277
280
|
};
|
|
281
|
+
/**
|
|
282
|
+
* Authenticate on the recovery verifier with the aal2 token and store the
|
|
283
|
+
* issued node auth tokens, the token's `exp` and `sub` (profile ID), the
|
|
284
|
+
* verifier IDs, and whether a share already exists, as `recoverySession`.
|
|
285
|
+
* The aal1 `nodeAuthTokens`, `accessToken` and `metadataAccessToken` are
|
|
286
|
+
* left as they are.
|
|
287
|
+
*
|
|
288
|
+
* @param params - The function parameters.
|
|
289
|
+
* @param params.aal2Token - The aal2 token minted by the authentication API.
|
|
290
|
+
* Its `exp` caps the lifetime of the aal2 node auth tokens.
|
|
291
|
+
* @param params.authConnectionId - The recovery sub-verifier ID.
|
|
292
|
+
* @param params.groupedAuthConnectionId - The recovery aggregate verifier ID.
|
|
293
|
+
* @returns A promise that resolves once the aal2 set is stored.
|
|
294
|
+
* @throws `MissingAuthUserInfo` if either verifier ID is empty or not a string.
|
|
295
|
+
*/
|
|
296
|
+
export type SeedlessOnboardingControllerAuthenticateForRecoveryAction = {
|
|
297
|
+
type: `SeedlessOnboardingController:authenticateForRecovery`;
|
|
298
|
+
handler: SeedlessOnboardingController['authenticateForRecovery'];
|
|
299
|
+
};
|
|
300
|
+
/**
|
|
301
|
+
* Migrate the vault to envelope encryption, adopting its current key set
|
|
302
|
+
* as the vault key set `K_v`.
|
|
303
|
+
*
|
|
304
|
+
* Writes `rbek` (sealed for the Recovery Secret) and the control record
|
|
305
|
+
* into their own partitions. No secret data item is moved, and no password
|
|
306
|
+
* is needed: the current password still derives `K_v` directly, so the
|
|
307
|
+
* first `pbek` is written by the first password change. The sealed
|
|
308
|
+
* envelope is checkpointed before the first remote write, so a failed call
|
|
309
|
+
* can be retried with the same arguments. Does nothing if the vault is
|
|
310
|
+
* already envelope-managed.
|
|
311
|
+
*
|
|
312
|
+
* The vault must be unlocked and in sync with the global password. Register
|
|
313
|
+
* the Recovery Secret at the escrows first, then call
|
|
314
|
+
* {@link authenticateForRecovery}.
|
|
315
|
+
*
|
|
316
|
+
* @param params - The function parameters.
|
|
317
|
+
* @param params.recoverySecret - The 32-byte Recovery Secret held in escrow.
|
|
318
|
+
* @returns A promise that resolves once the vault is envelope-managed.
|
|
319
|
+
* @throws `OutdatedPassword` if the vault is not in sync with the global
|
|
320
|
+
* password.
|
|
321
|
+
*/
|
|
322
|
+
export type SeedlessOnboardingControllerMigrateToEnvelopeAction = {
|
|
323
|
+
type: `SeedlessOnboardingController:migrateToEnvelope`;
|
|
324
|
+
handler: SeedlessOnboardingController['migrateToEnvelope'];
|
|
325
|
+
};
|
|
326
|
+
/**
|
|
327
|
+
* Recover an envelope-managed vault with the Recovery Secret instead of the
|
|
328
|
+
* password: open `rbek` to get the vault key set `K_v`, fetch the secret
|
|
329
|
+
* data with it, and create the local vault under `password`.
|
|
330
|
+
*
|
|
331
|
+
* `password` only encrypts the local vault. Until the user syncs it with
|
|
332
|
+
* the global password ({@link syncLatestGlobalPassword}) or sets it as the
|
|
333
|
+
* global password ({@link resetPasswordWithVaultKeys}), the password counts
|
|
334
|
+
* as outdated.
|
|
335
|
+
*
|
|
336
|
+
* Any pending envelope migration checkpoint is discarded, since it belongs
|
|
337
|
+
* to the vault this call replaces.
|
|
338
|
+
*
|
|
339
|
+
* Authenticate with social login and call {@link authenticateForRecovery}
|
|
340
|
+
* first.
|
|
341
|
+
*
|
|
342
|
+
* @param params - The function parameters.
|
|
343
|
+
* @param params.recoverySecret - The 32-byte Recovery Secret from escrow.
|
|
344
|
+
* @param params.password - The password of the new local vault.
|
|
345
|
+
* @returns The secret data of the vault.
|
|
346
|
+
* @throws `RecoveryEnvelopeNotFound` if no vault keys are sealed for the
|
|
347
|
+
* Recovery Secret, `RecoveryKeyShareConflict` if the nodes hold the key of
|
|
348
|
+
* another Recovery Secret, or `Aal2Required` without a valid aal2 session.
|
|
349
|
+
*/
|
|
350
|
+
export type SeedlessOnboardingControllerRecoverWithRecoverySecretAction = {
|
|
351
|
+
type: `SeedlessOnboardingController:recoverWithRecoverySecret`;
|
|
352
|
+
handler: SeedlessOnboardingController['recoverWithRecoverySecret'];
|
|
353
|
+
};
|
|
354
|
+
/**
|
|
355
|
+
* Set a new global password on an envelope-managed vault without the old
|
|
356
|
+
* one, after {@link recoverWithRecoverySecret}.
|
|
357
|
+
*
|
|
358
|
+
* Only allowed while the local password is not yet synced with the global
|
|
359
|
+
* password, which is the state {@link recoverWithRecoverySecret} leaves the
|
|
360
|
+
* vault in, and with a valid aal2 session from
|
|
361
|
+
* {@link authenticateForRecovery}. Once the reset or a sync succeeds, use
|
|
362
|
+
* {@link changePassword} instead.
|
|
363
|
+
*
|
|
364
|
+
* The password OPRF key swap is signed with the auth key stored in the
|
|
365
|
+
* vault's control record, so the old password is not needed. The vault
|
|
366
|
+
* keys and the backend vault stay as they are, and the local vault is
|
|
367
|
+
* re-encrypted under the new password.
|
|
368
|
+
*
|
|
369
|
+
* @param params - The function parameters.
|
|
370
|
+
* @param params.newPassword - The new global password.
|
|
371
|
+
* @returns A promise that resolves once the new password is global.
|
|
372
|
+
* @throws `PasswordResetRequiresRecovery` if the vault is not
|
|
373
|
+
* envelope-managed or its local password is already synced,
|
|
374
|
+
* `Aal2Required` without a valid aal2 session, or
|
|
375
|
+
* `EnvelopeControlRecordNotFound` if no control record matches the live
|
|
376
|
+
* password OPRF key.
|
|
377
|
+
*/
|
|
378
|
+
export type SeedlessOnboardingControllerResetPasswordWithVaultKeysAction = {
|
|
379
|
+
type: `SeedlessOnboardingController:resetPasswordWithVaultKeys`;
|
|
380
|
+
handler: SeedlessOnboardingController['resetPasswordWithVaultKeys'];
|
|
381
|
+
};
|
|
278
382
|
/**
|
|
279
383
|
* Rotate the refresh token — fetch a new refresh/revoke token pair from the
|
|
280
384
|
* auth service and persist the new revoke token in the vault.
|
|
@@ -344,5 +448,5 @@ export type SeedlessOnboardingControllerCheckAccessTokenExpiredAction = {
|
|
|
344
448
|
/**
|
|
345
449
|
* Union of all SeedlessOnboardingController action types.
|
|
346
450
|
*/
|
|
347
|
-
export type SeedlessOnboardingControllerMethodActions = SeedlessOnboardingControllerFetchMetadataAccessCredsAction | SeedlessOnboardingControllerPreloadToprfNodeDetailsAction | SeedlessOnboardingControllerAuthenticateAction | SeedlessOnboardingControllerCreateToprfKeyAndBackupSeedPhraseAction | SeedlessOnboardingControllerAddNewSecretDataAction | SeedlessOnboardingControllerRunMigrationsAction | SeedlessOnboardingControllerFetchAllSecretDataAction | SeedlessOnboardingControllerChangePasswordAction | SeedlessOnboardingControllerUpdateBackupMetadataStateAction | SeedlessOnboardingControllerVerifyVaultPasswordAction | SeedlessOnboardingControllerGetSecretDataBackupStateAction | SeedlessOnboardingControllerSubmitPasswordAction | SeedlessOnboardingControllerIdentifyIncompleteMetadataBackupAction | SeedlessOnboardingControllerSetLockedAction | SeedlessOnboardingControllerSyncLatestGlobalPasswordAction | SeedlessOnboardingControllerSubmitGlobalPasswordAction | SeedlessOnboardingControllerCheckIsPasswordOutdatedAction | SeedlessOnboardingControllerGetIsUserAuthenticatedAction | SeedlessOnboardingControllerClearStateAction | SeedlessOnboardingControllerStoreKeyringEncryptionKeyAction | SeedlessOnboardingControllerLoadKeyringEncryptionKeyAction | SeedlessOnboardingControllerRefreshAuthTokensAction | SeedlessOnboardingControllerRotateRefreshTokenAction | SeedlessOnboardingControllerRevokePendingRefreshTokensAction | SeedlessOnboardingControllerGetAccessTokenAction | SeedlessOnboardingControllerCheckNodeAuthTokenExpiredAction | SeedlessOnboardingControllerCheckMetadataAccessTokenExpiredAction | SeedlessOnboardingControllerCheckAccessTokenExpiredAction;
|
|
451
|
+
export type SeedlessOnboardingControllerMethodActions = SeedlessOnboardingControllerFetchMetadataAccessCredsAction | SeedlessOnboardingControllerPreloadToprfNodeDetailsAction | SeedlessOnboardingControllerAuthenticateAction | SeedlessOnboardingControllerCreateToprfKeyAndBackupSeedPhraseAction | SeedlessOnboardingControllerAddNewSecretDataAction | SeedlessOnboardingControllerRunMigrationsAction | SeedlessOnboardingControllerFetchAllSecretDataAction | SeedlessOnboardingControllerChangePasswordAction | SeedlessOnboardingControllerUpdateBackupMetadataStateAction | SeedlessOnboardingControllerVerifyVaultPasswordAction | SeedlessOnboardingControllerGetSecretDataBackupStateAction | SeedlessOnboardingControllerSubmitPasswordAction | SeedlessOnboardingControllerIdentifyIncompleteMetadataBackupAction | SeedlessOnboardingControllerSetLockedAction | SeedlessOnboardingControllerSyncLatestGlobalPasswordAction | SeedlessOnboardingControllerSubmitGlobalPasswordAction | SeedlessOnboardingControllerCheckIsPasswordOutdatedAction | SeedlessOnboardingControllerGetIsUserAuthenticatedAction | SeedlessOnboardingControllerClearStateAction | SeedlessOnboardingControllerStoreKeyringEncryptionKeyAction | SeedlessOnboardingControllerLoadKeyringEncryptionKeyAction | SeedlessOnboardingControllerRefreshAuthTokensAction | SeedlessOnboardingControllerAuthenticateForRecoveryAction | SeedlessOnboardingControllerMigrateToEnvelopeAction | SeedlessOnboardingControllerRecoverWithRecoverySecretAction | SeedlessOnboardingControllerResetPasswordWithVaultKeysAction | SeedlessOnboardingControllerRotateRefreshTokenAction | SeedlessOnboardingControllerRevokePendingRefreshTokensAction | SeedlessOnboardingControllerGetAccessTokenAction | SeedlessOnboardingControllerCheckNodeAuthTokenExpiredAction | SeedlessOnboardingControllerCheckMetadataAccessTokenExpiredAction | SeedlessOnboardingControllerCheckAccessTokenExpiredAction;
|
|
348
452
|
//# sourceMappingURL=SeedlessOnboardingController-method-action-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SeedlessOnboardingController-method-action-types.d.ts","sourceRoot":"","sources":["../src/SeedlessOnboardingController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AAEtF,MAAM,MAAM,0DAA0D,GAAG;IACvE,IAAI,EAAE,uDAAuD,CAAC;IAC9D,OAAO,EAAE,4BAA4B,CAAC,0BAA0B,CAAC,CAAC;CACnE,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,yDAAyD,GAAG;IACtE,IAAI,EAAE,sDAAsD,CAAC;IAC7D,OAAO,EAAE,4BAA4B,CAAC,yBAAyB,CAAC,CAAC;CAClE,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,8CAA8C,GAAG;IAC3D,IAAI,EAAE,2CAA2C,CAAC;IAClD,OAAO,EAAE,4BAA4B,CAAC,cAAc,CAAC,CAAC;CACvD,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,mEAAmE,GAC7E;IACE,IAAI,EAAE,gEAAgE,CAAC;IACvE,OAAO,EAAE,4BAA4B,CAAC,mCAAmC,CAAC,CAAC;CAC5E,CAAC;AAEJ;;;;;;;;GAQG;AACH,MAAM,MAAM,kDAAkD,GAAG;IAC/D,IAAI,EAAE,+CAA+C,CAAC;IACtD,OAAO,EAAE,4BAA4B,CAAC,kBAAkB,CAAC,CAAC;CAC3D,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,+CAA+C,GAAG;IAC5D,IAAI,EAAE,4CAA4C,CAAC;IACnD,OAAO,EAAE,4BAA4B,CAAC,eAAe,CAAC,CAAC;CACxD,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,oDAAoD,GAAG;IACjE,IAAI,EAAE,iDAAiD,CAAC;IACxD,OAAO,EAAE,4BAA4B,CAAC,oBAAoB,CAAC,CAAC;CAC7D,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"SeedlessOnboardingController-method-action-types.d.ts","sourceRoot":"","sources":["../src/SeedlessOnboardingController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AAEtF,MAAM,MAAM,0DAA0D,GAAG;IACvE,IAAI,EAAE,uDAAuD,CAAC;IAC9D,OAAO,EAAE,4BAA4B,CAAC,0BAA0B,CAAC,CAAC;CACnE,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,yDAAyD,GAAG;IACtE,IAAI,EAAE,sDAAsD,CAAC;IAC7D,OAAO,EAAE,4BAA4B,CAAC,yBAAyB,CAAC,CAAC;CAClE,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,8CAA8C,GAAG;IAC3D,IAAI,EAAE,2CAA2C,CAAC;IAClD,OAAO,EAAE,4BAA4B,CAAC,cAAc,CAAC,CAAC;CACvD,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,mEAAmE,GAC7E;IACE,IAAI,EAAE,gEAAgE,CAAC;IACvE,OAAO,EAAE,4BAA4B,CAAC,mCAAmC,CAAC,CAAC;CAC5E,CAAC;AAEJ;;;;;;;;GAQG;AACH,MAAM,MAAM,kDAAkD,GAAG;IAC/D,IAAI,EAAE,+CAA+C,CAAC;IACtD,OAAO,EAAE,4BAA4B,CAAC,kBAAkB,CAAC,CAAC;CAC3D,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,+CAA+C,GAAG;IAC5D,IAAI,EAAE,4CAA4C,CAAC;IACnD,OAAO,EAAE,4BAA4B,CAAC,eAAe,CAAC,CAA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iE,GAC3E;IACE,IAAI,EAAE,8DAA8D,CAAC;IACrE,OAAO,EAAE,4BAA4B,CAAC,iCAAiC,CAAC,CAAC;CAC1E,CAAC;AAEJ;;;;;;;GAOG;AACH,MAAM,MAAM,yDAAyD,GAAG;IACtE,IAAI,EAAE,sDAAsD,CAAC;IAC7D,OAAO,EAAE,4BAA4B,CAAC,yBAAyB,CAAC,CAAC;CAClE,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,yCAAyC,GACjD,0DAA0D,GAC1D,yDAAyD,GACzD,8CAA8C,GAC9C,mEAAmE,GACnE,kDAAkD,GAClD,+CAA+C,GAC/C,oDAAoD,GACpD,gDAAgD,GAChD,2DAA2D,GAC3D,qDAAqD,GACrD,0DAA0D,GAC1D,gDAAgD,GAChD,kEAAkE,GAClE,2CAA2C,GAC3C,0DAA0D,GAC1D,sDAAsD,GACtD,yDAAyD,GACzD,wDAAwD,GACxD,4CAA4C,GAC5C,2DAA2D,GAC3D,0DAA0D,GAC1D,mDAAmD,GACnD,yDAAyD,GACzD,mDAAmD,GACnD,2DAA2D,GAC3D,4DAA4D,GAC5D,oDAAoD,GACpD,4DAA4D,GAC5D,gDAAgD,GAChD,2DAA2D,GAC3D,iEAAiE,GACjE,yDAAyD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SeedlessOnboardingController-method-action-types.js","sourceRoot":"","sources":["../src/SeedlessOnboardingController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { SeedlessOnboardingController } from './SeedlessOnboardingController.js';\n\nexport type SeedlessOnboardingControllerFetchMetadataAccessCredsAction = {\n type: `SeedlessOnboardingController:fetchMetadataAccessCreds`;\n handler: SeedlessOnboardingController['fetchMetadataAccessCreds'];\n};\n\n/**\n * Gets the node details for the TOPRF operations.\n * This function can be called to get the node endpoints, indexes and pubkeys and cache them locally.\n */\nexport type SeedlessOnboardingControllerPreloadToprfNodeDetailsAction = {\n type: `SeedlessOnboardingController:preloadToprfNodeDetails`;\n handler: SeedlessOnboardingController['preloadToprfNodeDetails'];\n};\n\n/**\n * Authenticate OAuth user using the seedless onboarding flow\n * and determine if the user is already registered or not.\n *\n * @param params - The parameters for authenticate OAuth user.\n * @param params.idTokens - The ID token(s) issued by OAuth verification service. Currently this array only contains a single idToken which is verified by all the nodes, in future we are considering to issue a unique idToken for each node.\n * @param params.authConnection - The social login provider.\n * @param params.authConnectionId - OAuth authConnectionId from dashboard\n * @param params.userId - user email or id from Social login\n * @param params.groupedAuthConnectionId - Optional grouped authConnectionId to be used for the authenticate request.\n * @param params.socialLoginEmail - The user email from Social login.\n * @param params.refreshToken - Refresh token issued during OAuth login. Written to state when provided.\n * @param params.revokeToken - revoke token for revoking refresh token and get new refresh token and new revoke token.\n * @param params.accessToken - Access token for pairing with profile sync auth service and to access other services.\n * @param params.metadataAccessToken - Metadata access token for accessing the metadata service before the vault is created or unlocked.\n * @param params.skipLock - Optional flag to skip acquiring the controller lock. (to prevent deadlock in case the caller already acquired the lock)\n * @returns A promise that resolves to the authentication result.\n */\nexport type SeedlessOnboardingControllerAuthenticateAction = {\n type: `SeedlessOnboardingController:authenticate`;\n handler: SeedlessOnboardingController['authenticate'];\n};\n\n/**\n * Create a new TOPRF encryption key using given password and backups the provided seed phrase.\n *\n * @param password - The password used to create new wallet and seedphrase\n * @param seedPhrase - The initial seed phrase (Mnemonic) created together with the wallet.\n * @param keyringId - The keyring id of the backup seed phrase\n * @returns A promise that resolves to the encrypted seed phrase and the encryption key.\n */\nexport type SeedlessOnboardingControllerCreateToprfKeyAndBackupSeedPhraseAction =\n {\n type: `SeedlessOnboardingController:createToprfKeyAndBackupSeedPhrase`;\n handler: SeedlessOnboardingController['createToprfKeyAndBackupSeedPhrase'];\n };\n\n/**\n * Encrypt and add a new secret data to the metadata store.\n *\n * @param data - The data to add.\n * @param dataType - The data type classification for the secret data.\n * @param options - Optional options object, which includes optional data to be added to the metadata store.\n * @param options.keyringId - The keyring id of the backup keyring (SRP).\n * @returns A promise that resolves to the success of the operation.\n */\nexport type SeedlessOnboardingControllerAddNewSecretDataAction = {\n type: `SeedlessOnboardingController:addNewSecretData`;\n handler: SeedlessOnboardingController['addNewSecretData'];\n};\n\n/**\n * Run any pending seedless onboarding migrations.\n *\n * This method should be called by clients after the controller is unlocked\n * to ensure legacy data is migrated to the latest format.\n *\n * Migrations are idempotent - running this multiple times is safe.\n * The migration version is tracked in state to prevent re-running migrations.\n *\n * @returns A promise that resolves to `true` if data was actually migrated\n * (items were updated on the server), `false` otherwise.\n * @throws If the password is outdated (changed on another device).\n */\nexport type SeedlessOnboardingControllerRunMigrationsAction = {\n type: `SeedlessOnboardingController:runMigrations`;\n handler: SeedlessOnboardingController['runMigrations'];\n};\n\n/**\n * Fetches all secret data items from the metadata store.\n *\n * Decrypts the secret data and returns the decrypted secret data using the recovered encryption key from the password.\n *\n * @param password - The optional password used to create new wallet. If not provided, `cached Encryption Key` will be used.\n * @returns A promise that resolves to the secret metadata items.\n */\nexport type SeedlessOnboardingControllerFetchAllSecretDataAction = {\n type: `SeedlessOnboardingController:fetchAllSecretData`;\n handler: SeedlessOnboardingController['fetchAllSecretData'];\n};\n\n/**\n * Update the password of the seedless onboarding flow.\n *\n * Changing password will also update the encryption key, metadata store and the vault with new encrypted values.\n *\n * @param newPassword - The new password to update.\n * @param oldPassword - The old password to verify.\n * @returns A promise that resolves to the success of the operation.\n */\nexport type SeedlessOnboardingControllerChangePasswordAction = {\n type: `SeedlessOnboardingController:changePassword`;\n handler: SeedlessOnboardingController['changePassword'];\n};\n\n/**\n * Update the backup metadata state for the given secret data.\n *\n * @param secretData - The data to backup, can be a single backup or array of backups.\n * @param secretData.keyringId - The keyring id associated with the backup secret data.\n * @param secretData.data - The secret data to update the backup metadata state.\n */\nexport type SeedlessOnboardingControllerUpdateBackupMetadataStateAction = {\n type: `SeedlessOnboardingController:updateBackupMetadataState`;\n handler: SeedlessOnboardingController['updateBackupMetadataState'];\n};\n\n/**\n * Verify the password validity by decrypting the vault.\n *\n * @param password - The password to verify.\n * @param options - Optional options object.\n * @param options.skipLock - Whether to skip the lock acquisition. (to prevent deadlock in case the caller already acquired the lock)\n * @returns A promise that resolves to the success of the operation.\n * @throws {Error} If the password is invalid or the vault is not initialized.\n */\nexport type SeedlessOnboardingControllerVerifyVaultPasswordAction = {\n type: `SeedlessOnboardingController:verifyVaultPassword`;\n handler: SeedlessOnboardingController['verifyVaultPassword'];\n};\n\n/**\n * Get backup state of the given secret data, from the controller state.\n *\n * If the given secret data is not backed up and not found in the state, it will return `undefined`.\n *\n * @param data - The data to get the backup state of.\n * @param type - The type of the secret data.\n * @returns The backup state of the given secret data.\n */\nexport type SeedlessOnboardingControllerGetSecretDataBackupStateAction = {\n type: `SeedlessOnboardingController:getSecretDataBackupState`;\n handler: SeedlessOnboardingController['getSecretDataBackupState'];\n};\n\n/**\n * Submit the password to the controller, verify the password validity and unlock the controller.\n *\n * This method will be used especially when user unlock the wallet.\n * The provided password will be verified against the encrypted vault, encryption key will be derived and saved in the controller state.\n *\n * This operation is useful when user performs some actions that requires the user password/encryption key. e.g. add new srp backup\n *\n * @param password - The password to submit.\n * @returns A promise that resolves to the success of the operation.\n */\nexport type SeedlessOnboardingControllerSubmitPasswordAction = {\n type: `SeedlessOnboardingController:submitPassword`;\n handler: SeedlessOnboardingController['submitPassword'];\n};\n\n/**\n * Identify an incomplete or mismatched primary SRP backup.\n *\n * This method must only be called after the controller has been unlocked.\n *\n * @param password - The password used to export the local primary SRP.\n * @returns A promise that resolves after identification and telemetry have\n * completed.\n */\nexport type SeedlessOnboardingControllerIdentifyIncompleteMetadataBackupAction =\n {\n type: `SeedlessOnboardingController:identifyIncompleteMetadataBackup`;\n handler: SeedlessOnboardingController['identifyIncompleteMetadataBackup'];\n };\n\n/**\n * Set the controller to locked state, and deallocate the secrets (vault encryption key and salt).\n *\n * When the controller is locked, the user will not be able to perform any operations on the controller/vault.\n *\n * @returns A promise that resolves to the success of the operation.\n */\nexport type SeedlessOnboardingControllerSetLockedAction = {\n type: `SeedlessOnboardingController:setLocked`;\n handler: SeedlessOnboardingController['setLocked'];\n};\n\n/**\n * Sync the latest global password to the controller.\n * reset vault with latest globalPassword,\n * persist the latest global password authPubKey\n *\n * @param params - The parameters for syncing the latest global password.\n * @param params.globalPassword - The latest global password.\n * @returns A promise that resolves to the success of the operation.\n */\nexport type SeedlessOnboardingControllerSyncLatestGlobalPasswordAction = {\n type: `SeedlessOnboardingController:syncLatestGlobalPassword`;\n handler: SeedlessOnboardingController['syncLatestGlobalPassword'];\n};\n\n/**\n * @description Unlock the controller with the latest global password.\n *\n * @param params - The parameters for unlocking the controller.\n * @param params.maxKeyChainLength - The maximum chain length of the pwd encryption keys.\n * @param params.globalPassword - The latest global password.\n * @returns A promise that resolves to the success of the operation.\n */\nexport type SeedlessOnboardingControllerSubmitGlobalPasswordAction = {\n type: `SeedlessOnboardingController:submitGlobalPassword`;\n handler: SeedlessOnboardingController['submitGlobalPassword'];\n};\n\n/**\n * @description Check if the current password is outdated compare to the global password.\n *\n * @param options - Optional options object.\n * @param options.globalAuthPubKey - The global auth public key to compare with the current auth public key.\n * If not provided, the global auth public key will be fetched from the backend.\n * @param options.skipCache - If true, bypass the cache and force a fresh check.\n * @param options.skipLock - Whether to skip the lock acquisition. (to prevent deadlock in case the caller already acquired the lock)\n * @returns A promise that resolves to true if the password is outdated, false otherwise.\n */\nexport type SeedlessOnboardingControllerCheckIsPasswordOutdatedAction = {\n type: `SeedlessOnboardingController:checkIsPasswordOutdated`;\n handler: SeedlessOnboardingController['checkIsPasswordOutdated'];\n};\n\n/**\n * Check if the user is authenticated with the seedless onboarding flow by checking the token values in the state.\n *\n * This method will check the `accessToken` and `revokeToken` in the state, besides the social login authentication details.\n * If both are present, the user is authenticated.\n * If either is missing, the user is not authenticated.\n *\n * This method is useful when we want to check if the state has valid authenticated user details to perform vault creations.\n *\n * @returns True if the user is authenticated, false otherwise.\n */\nexport type SeedlessOnboardingControllerGetIsUserAuthenticatedAction = {\n type: `SeedlessOnboardingController:getIsUserAuthenticated`;\n handler: SeedlessOnboardingController['getIsUserAuthenticated'];\n};\n\n/**\n * Clears the current state of the SeedlessOnboardingController.\n */\nexport type SeedlessOnboardingControllerClearStateAction = {\n type: `SeedlessOnboardingController:clearState`;\n handler: SeedlessOnboardingController['clearState'];\n};\n\n/**\n * Store the keyring encryption key in state, encrypted under the current\n * encryption key.\n *\n * @param keyringEncryptionKey - The keyring encryption key.\n */\nexport type SeedlessOnboardingControllerStoreKeyringEncryptionKeyAction = {\n type: `SeedlessOnboardingController:storeKeyringEncryptionKey`;\n handler: SeedlessOnboardingController['storeKeyringEncryptionKey'];\n};\n\n/**\n * Load the keyring encryption key from state, decrypted under the current\n * encryption key.\n *\n * @returns The keyring encryption key.\n */\nexport type SeedlessOnboardingControllerLoadKeyringEncryptionKeyAction = {\n type: `SeedlessOnboardingController:loadKeyringEncryptionKey`;\n handler: SeedlessOnboardingController['loadKeyringEncryptionKey'];\n};\n\n/**\n * Refresh expired nodeAuthTokens, accessToken, and metadataAccessToken using\n * the stored refresh token.\n *\n * Concurrent callers share a single in-flight HTTP request — if a refresh is\n * already in-progress the returned promise resolves when that request settles\n * rather than firing a duplicate request with the same token.\n *\n * @returns A promise that resolves when the tokens have been refreshed.\n */\nexport type SeedlessOnboardingControllerRefreshAuthTokensAction = {\n type: `SeedlessOnboardingController:refreshAuthTokens`;\n handler: SeedlessOnboardingController['refreshAuthTokens'];\n};\n\n/**\n * Rotate the refresh token — fetch a new refresh/revoke token pair from the\n * auth service and persist the new revoke token in the vault.\n *\n * This method should be called after a successful JWT refresh.\n *\n * @returns A Promise that resolves to void.\n */\nexport type SeedlessOnboardingControllerRotateRefreshTokenAction = {\n type: `SeedlessOnboardingController:rotateRefreshToken`;\n handler: SeedlessOnboardingController['rotateRefreshToken'];\n};\n\n/**\n * Revoke all pending refresh tokens.\n *\n * This method is to be called after user is authenticated.\n *\n * @returns A Promise that resolves to void.\n */\nexport type SeedlessOnboardingControllerRevokePendingRefreshTokensAction = {\n type: `SeedlessOnboardingController:revokePendingRefreshTokens`;\n handler: SeedlessOnboardingController['revokePendingRefreshTokens'];\n};\n\n/**\n * Get the access token from the state.\n *\n * If the tokens are expired, the method will refresh them and return the new access token.\n *\n * @returns The access token.\n */\nexport type SeedlessOnboardingControllerGetAccessTokenAction = {\n type: `SeedlessOnboardingController:getAccessToken`;\n handler: SeedlessOnboardingController['getAccessToken'];\n};\n\n/**\n * Check if the current node auth token is expired.\n *\n * @returns True if the current node auth token is expired, false otherwise.\n */\nexport type SeedlessOnboardingControllerCheckNodeAuthTokenExpiredAction = {\n type: `SeedlessOnboardingController:checkNodeAuthTokenExpired`;\n handler: SeedlessOnboardingController['checkNodeAuthTokenExpired'];\n};\n\n/**\n * Check if the current metadata access token should be refreshed.\n * Returns true when the token is expired or when less than 10% of its\n * lifetime remains (proactive refresh).\n *\n * @returns True if the metadata access token should be refreshed, false otherwise.\n */\nexport type SeedlessOnboardingControllerCheckMetadataAccessTokenExpiredAction =\n {\n type: `SeedlessOnboardingController:checkMetadataAccessTokenExpired`;\n handler: SeedlessOnboardingController['checkMetadataAccessTokenExpired'];\n };\n\n/**\n * Check if the current access token should be refreshed.\n * Returns true when the token is expired or when less than 10% of its\n * lifetime remains (proactive refresh).\n * When the vault is locked, the access token is not accessible, so we return false.\n *\n * @returns True if the access token should be refreshed, false otherwise.\n */\nexport type SeedlessOnboardingControllerCheckAccessTokenExpiredAction = {\n type: `SeedlessOnboardingController:checkAccessTokenExpired`;\n handler: SeedlessOnboardingController['checkAccessTokenExpired'];\n};\n\n/**\n * Union of all SeedlessOnboardingController action types.\n */\nexport type SeedlessOnboardingControllerMethodActions =\n | SeedlessOnboardingControllerFetchMetadataAccessCredsAction\n | SeedlessOnboardingControllerPreloadToprfNodeDetailsAction\n | SeedlessOnboardingControllerAuthenticateAction\n | SeedlessOnboardingControllerCreateToprfKeyAndBackupSeedPhraseAction\n | SeedlessOnboardingControllerAddNewSecretDataAction\n | SeedlessOnboardingControllerRunMigrationsAction\n | SeedlessOnboardingControllerFetchAllSecretDataAction\n | SeedlessOnboardingControllerChangePasswordAction\n | SeedlessOnboardingControllerUpdateBackupMetadataStateAction\n | SeedlessOnboardingControllerVerifyVaultPasswordAction\n | SeedlessOnboardingControllerGetSecretDataBackupStateAction\n | SeedlessOnboardingControllerSubmitPasswordAction\n | SeedlessOnboardingControllerIdentifyIncompleteMetadataBackupAction\n | SeedlessOnboardingControllerSetLockedAction\n | SeedlessOnboardingControllerSyncLatestGlobalPasswordAction\n | SeedlessOnboardingControllerSubmitGlobalPasswordAction\n | SeedlessOnboardingControllerCheckIsPasswordOutdatedAction\n | SeedlessOnboardingControllerGetIsUserAuthenticatedAction\n | SeedlessOnboardingControllerClearStateAction\n | SeedlessOnboardingControllerStoreKeyringEncryptionKeyAction\n | SeedlessOnboardingControllerLoadKeyringEncryptionKeyAction\n | SeedlessOnboardingControllerRefreshAuthTokensAction\n | SeedlessOnboardingControllerRotateRefreshTokenAction\n | SeedlessOnboardingControllerRevokePendingRefreshTokensAction\n | SeedlessOnboardingControllerGetAccessTokenAction\n | SeedlessOnboardingControllerCheckNodeAuthTokenExpiredAction\n | SeedlessOnboardingControllerCheckMetadataAccessTokenExpiredAction\n | SeedlessOnboardingControllerCheckAccessTokenExpiredAction;\n"]}
|
|
1
|
+
{"version":3,"file":"SeedlessOnboardingController-method-action-types.js","sourceRoot":"","sources":["../src/SeedlessOnboardingController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { SeedlessOnboardingController } from './SeedlessOnboardingController.js';\n\nexport type SeedlessOnboardingControllerFetchMetadataAccessCredsAction = {\n type: `SeedlessOnboardingController:fetchMetadataAccessCreds`;\n handler: SeedlessOnboardingController['fetchMetadataAccessCreds'];\n};\n\n/**\n * Gets the node details for the TOPRF operations.\n * This function can be called to get the node endpoints, indexes and pubkeys and cache them locally.\n */\nexport type SeedlessOnboardingControllerPreloadToprfNodeDetailsAction = {\n type: `SeedlessOnboardingController:preloadToprfNodeDetails`;\n handler: SeedlessOnboardingController['preloadToprfNodeDetails'];\n};\n\n/**\n * Authenticate OAuth user using the seedless onboarding flow\n * and determine if the user is already registered or not.\n *\n * @param params - The parameters for authenticate OAuth user.\n * @param params.idTokens - The ID token(s) issued by OAuth verification service. Currently this array only contains a single idToken which is verified by all the nodes, in future we are considering to issue a unique idToken for each node.\n * @param params.authConnection - The social login provider.\n * @param params.authConnectionId - OAuth authConnectionId from dashboard\n * @param params.userId - user email or id from Social login\n * @param params.groupedAuthConnectionId - Optional grouped authConnectionId to be used for the authenticate request.\n * @param params.socialLoginEmail - The user email from Social login.\n * @param params.refreshToken - Refresh token issued during OAuth login. Written to state when provided.\n * @param params.revokeToken - revoke token for revoking refresh token and get new refresh token and new revoke token.\n * @param params.accessToken - Access token for pairing with profile sync auth service and to access other services.\n * @param params.metadataAccessToken - Metadata access token for accessing the metadata service before the vault is created or unlocked.\n * @param params.skipLock - Optional flag to skip acquiring the controller lock. (to prevent deadlock in case the caller already acquired the lock)\n * @returns A promise that resolves to the authentication result.\n */\nexport type SeedlessOnboardingControllerAuthenticateAction = {\n type: `SeedlessOnboardingController:authenticate`;\n handler: SeedlessOnboardingController['authenticate'];\n};\n\n/**\n * Create a new TOPRF encryption key using given password and backups the provided seed phrase.\n *\n * @param password - The password used to create new wallet and seedphrase\n * @param seedPhrase - The initial seed phrase (Mnemonic) created together with the wallet.\n * @param keyringId - The keyring id of the backup seed phrase\n * @returns A promise that resolves to the encrypted seed phrase and the encryption key.\n */\nexport type SeedlessOnboardingControllerCreateToprfKeyAndBackupSeedPhraseAction =\n {\n type: `SeedlessOnboardingController:createToprfKeyAndBackupSeedPhrase`;\n handler: SeedlessOnboardingController['createToprfKeyAndBackupSeedPhrase'];\n };\n\n/**\n * Encrypt and add a new secret data to the metadata store.\n *\n * @param data - The data to add.\n * @param dataType - The data type classification for the secret data.\n * @param options - Optional options object, which includes optional data to be added to the metadata store.\n * @param options.keyringId - The keyring id of the backup keyring (SRP).\n * @returns A promise that resolves to the success of the operation.\n */\nexport type SeedlessOnboardingControllerAddNewSecretDataAction = {\n type: `SeedlessOnboardingController:addNewSecretData`;\n handler: SeedlessOnboardingController['addNewSecretData'];\n};\n\n/**\n * Run any pending seedless onboarding migrations.\n *\n * This method should be called by clients after the controller is unlocked\n * to ensure legacy data is migrated to the latest format.\n *\n * Migrations are idempotent - running this multiple times is safe.\n * The migration version is tracked in state to prevent re-running migrations.\n *\n * @returns A promise that resolves to `true` if data was actually migrated\n * (items were updated on the server), `false` otherwise.\n * @throws If the password is outdated (changed on another device).\n */\nexport type SeedlessOnboardingControllerRunMigrationsAction = {\n type: `SeedlessOnboardingController:runMigrations`;\n handler: SeedlessOnboardingController['runMigrations'];\n};\n\n/**\n * Fetches all secret data items from the metadata store.\n *\n * Decrypts the secret data and returns the decrypted secret data using the recovered encryption key from the password.\n *\n * @param password - The optional password used to create new wallet. If not provided, `cached Encryption Key` will be used.\n * @returns A promise that resolves to the secret metadata items.\n */\nexport type SeedlessOnboardingControllerFetchAllSecretDataAction = {\n type: `SeedlessOnboardingController:fetchAllSecretData`;\n handler: SeedlessOnboardingController['fetchAllSecretData'];\n};\n\n/**\n * Update the password of the seedless onboarding flow.\n *\n * Changing password will also update the encryption key, metadata store and the vault with new encrypted values.\n * If the vault is envelope-managed, only the password envelope and the\n * password OPRF key change; the vault keys and the backend vault stay as\n * they are.\n *\n * @param newPassword - The new password to update.\n * @param oldPassword - The old password to verify.\n * @returns A promise that resolves to the success of the operation.\n */\nexport type SeedlessOnboardingControllerChangePasswordAction = {\n type: `SeedlessOnboardingController:changePassword`;\n handler: SeedlessOnboardingController['changePassword'];\n};\n\n/**\n * Update the backup metadata state for the given secret data.\n *\n * @param secretData - The data to backup, can be a single backup or array of backups.\n * @param secretData.keyringId - The keyring id associated with the backup secret data.\n * @param secretData.data - The secret data to update the backup metadata state.\n */\nexport type SeedlessOnboardingControllerUpdateBackupMetadataStateAction = {\n type: `SeedlessOnboardingController:updateBackupMetadataState`;\n handler: SeedlessOnboardingController['updateBackupMetadataState'];\n};\n\n/**\n * Verify the password validity by decrypting the vault.\n *\n * @param password - The password to verify.\n * @param options - Optional options object.\n * @param options.skipLock - Whether to skip the lock acquisition. (to prevent deadlock in case the caller already acquired the lock)\n * @returns A promise that resolves to the success of the operation.\n * @throws {Error} If the password is invalid or the vault is not initialized.\n */\nexport type SeedlessOnboardingControllerVerifyVaultPasswordAction = {\n type: `SeedlessOnboardingController:verifyVaultPassword`;\n handler: SeedlessOnboardingController['verifyVaultPassword'];\n};\n\n/**\n * Get backup state of the given secret data, from the controller state.\n *\n * If the given secret data is not backed up and not found in the state, it will return `undefined`.\n *\n * @param data - The data to get the backup state of.\n * @param type - The type of the secret data.\n * @returns The backup state of the given secret data.\n */\nexport type SeedlessOnboardingControllerGetSecretDataBackupStateAction = {\n type: `SeedlessOnboardingController:getSecretDataBackupState`;\n handler: SeedlessOnboardingController['getSecretDataBackupState'];\n};\n\n/**\n * Submit the password to the controller, verify the password validity and unlock the controller.\n *\n * This method will be used especially when user unlock the wallet.\n * The provided password will be verified against the encrypted vault, encryption key will be derived and saved in the controller state.\n *\n * This operation is useful when user performs some actions that requires the user password/encryption key. e.g. add new srp backup\n *\n * @param password - The password to submit.\n * @returns A promise that resolves to the success of the operation.\n */\nexport type SeedlessOnboardingControllerSubmitPasswordAction = {\n type: `SeedlessOnboardingController:submitPassword`;\n handler: SeedlessOnboardingController['submitPassword'];\n};\n\n/**\n * Identify an incomplete or mismatched primary SRP backup.\n *\n * This method must only be called after the controller has been unlocked.\n *\n * @param password - The password used to export the local primary SRP.\n * @returns A promise that resolves after identification and telemetry have\n * completed.\n */\nexport type SeedlessOnboardingControllerIdentifyIncompleteMetadataBackupAction =\n {\n type: `SeedlessOnboardingController:identifyIncompleteMetadataBackup`;\n handler: SeedlessOnboardingController['identifyIncompleteMetadataBackup'];\n };\n\n/**\n * Set the controller to locked state, and deallocate the secrets (vault encryption key and salt).\n *\n * When the controller is locked, the user will not be able to perform any operations on the controller/vault.\n *\n * @returns A promise that resolves to the success of the operation.\n */\nexport type SeedlessOnboardingControllerSetLockedAction = {\n type: `SeedlessOnboardingController:setLocked`;\n handler: SeedlessOnboardingController['setLocked'];\n};\n\n/**\n * Sync the latest global password to the controller.\n * reset vault with latest globalPassword,\n * persist the latest global password authPubKey\n *\n * @param params - The parameters for syncing the latest global password.\n * @param params.globalPassword - The latest global password.\n * @returns A promise that resolves to the success of the operation.\n */\nexport type SeedlessOnboardingControllerSyncLatestGlobalPasswordAction = {\n type: `SeedlessOnboardingController:syncLatestGlobalPassword`;\n handler: SeedlessOnboardingController['syncLatestGlobalPassword'];\n};\n\n/**\n * @description Unlock the controller with the latest global password.\n *\n * @param params - The parameters for unlocking the controller.\n * @param params.maxKeyChainLength - The maximum chain length of the pwd encryption keys.\n * @param params.globalPassword - The latest global password.\n * @returns A promise that resolves to the success of the operation.\n */\nexport type SeedlessOnboardingControllerSubmitGlobalPasswordAction = {\n type: `SeedlessOnboardingController:submitGlobalPassword`;\n handler: SeedlessOnboardingController['submitGlobalPassword'];\n};\n\n/**\n * @description Check if the current password is outdated compare to the global password.\n *\n * @param options - Optional options object.\n * @param options.globalAuthPubKey - The global auth public key to compare with the current auth public key.\n * If not provided, the global auth public key will be fetched from the backend.\n * @param options.skipCache - If true, bypass the cache and force a fresh check.\n * @param options.skipLock - Whether to skip the lock acquisition. (to prevent deadlock in case the caller already acquired the lock)\n * @returns A promise that resolves to true if the password is outdated, false otherwise.\n */\nexport type SeedlessOnboardingControllerCheckIsPasswordOutdatedAction = {\n type: `SeedlessOnboardingController:checkIsPasswordOutdated`;\n handler: SeedlessOnboardingController['checkIsPasswordOutdated'];\n};\n\n/**\n * Check if the user is authenticated with the seedless onboarding flow by checking the token values in the state.\n *\n * This method will check the `accessToken` and `revokeToken` in the state, besides the social login authentication details.\n * If both are present, the user is authenticated.\n * If either is missing, the user is not authenticated.\n *\n * This method is useful when we want to check if the state has valid authenticated user details to perform vault creations.\n *\n * @returns True if the user is authenticated, false otherwise.\n */\nexport type SeedlessOnboardingControllerGetIsUserAuthenticatedAction = {\n type: `SeedlessOnboardingController:getIsUserAuthenticated`;\n handler: SeedlessOnboardingController['getIsUserAuthenticated'];\n};\n\n/**\n * Clears the current state of the SeedlessOnboardingController.\n */\nexport type SeedlessOnboardingControllerClearStateAction = {\n type: `SeedlessOnboardingController:clearState`;\n handler: SeedlessOnboardingController['clearState'];\n};\n\n/**\n * Store the keyring encryption key in state, encrypted under the current\n * encryption key.\n *\n * @param keyringEncryptionKey - The keyring encryption key.\n */\nexport type SeedlessOnboardingControllerStoreKeyringEncryptionKeyAction = {\n type: `SeedlessOnboardingController:storeKeyringEncryptionKey`;\n handler: SeedlessOnboardingController['storeKeyringEncryptionKey'];\n};\n\n/**\n * Load the keyring encryption key from state, decrypted under the current\n * encryption key.\n *\n * @returns The keyring encryption key.\n */\nexport type SeedlessOnboardingControllerLoadKeyringEncryptionKeyAction = {\n type: `SeedlessOnboardingController:loadKeyringEncryptionKey`;\n handler: SeedlessOnboardingController['loadKeyringEncryptionKey'];\n};\n\n/**\n * Refresh expired nodeAuthTokens, accessToken, and metadataAccessToken using\n * the stored refresh token.\n *\n * Concurrent callers share a single in-flight HTTP request — if a refresh is\n * already in-progress the returned promise resolves when that request settles\n * rather than firing a duplicate request with the same token.\n *\n * @returns A promise that resolves when the tokens have been refreshed.\n */\nexport type SeedlessOnboardingControllerRefreshAuthTokensAction = {\n type: `SeedlessOnboardingController:refreshAuthTokens`;\n handler: SeedlessOnboardingController['refreshAuthTokens'];\n};\n\n/**\n * Authenticate on the recovery verifier with the aal2 token and store the\n * issued node auth tokens, the token's `exp` and `sub` (profile ID), the\n * verifier IDs, and whether a share already exists, as `recoverySession`.\n * The aal1 `nodeAuthTokens`, `accessToken` and `metadataAccessToken` are\n * left as they are.\n *\n * @param params - The function parameters.\n * @param params.aal2Token - The aal2 token minted by the authentication API.\n * Its `exp` caps the lifetime of the aal2 node auth tokens.\n * @param params.authConnectionId - The recovery sub-verifier ID.\n * @param params.groupedAuthConnectionId - The recovery aggregate verifier ID.\n * @returns A promise that resolves once the aal2 set is stored.\n * @throws `MissingAuthUserInfo` if either verifier ID is empty or not a string.\n */\nexport type SeedlessOnboardingControllerAuthenticateForRecoveryAction = {\n type: `SeedlessOnboardingController:authenticateForRecovery`;\n handler: SeedlessOnboardingController['authenticateForRecovery'];\n};\n\n/**\n * Migrate the vault to envelope encryption, adopting its current key set\n * as the vault key set `K_v`.\n *\n * Writes `rbek` (sealed for the Recovery Secret) and the control record\n * into their own partitions. No secret data item is moved, and no password\n * is needed: the current password still derives `K_v` directly, so the\n * first `pbek` is written by the first password change. The sealed\n * envelope is checkpointed before the first remote write, so a failed call\n * can be retried with the same arguments. Does nothing if the vault is\n * already envelope-managed.\n *\n * The vault must be unlocked and in sync with the global password. Register\n * the Recovery Secret at the escrows first, then call\n * {@link authenticateForRecovery}.\n *\n * @param params - The function parameters.\n * @param params.recoverySecret - The 32-byte Recovery Secret held in escrow.\n * @returns A promise that resolves once the vault is envelope-managed.\n * @throws `OutdatedPassword` if the vault is not in sync with the global\n * password.\n */\nexport type SeedlessOnboardingControllerMigrateToEnvelopeAction = {\n type: `SeedlessOnboardingController:migrateToEnvelope`;\n handler: SeedlessOnboardingController['migrateToEnvelope'];\n};\n\n/**\n * Recover an envelope-managed vault with the Recovery Secret instead of the\n * password: open `rbek` to get the vault key set `K_v`, fetch the secret\n * data with it, and create the local vault under `password`.\n *\n * `password` only encrypts the local vault. Until the user syncs it with\n * the global password ({@link syncLatestGlobalPassword}) or sets it as the\n * global password ({@link resetPasswordWithVaultKeys}), the password counts\n * as outdated.\n *\n * Any pending envelope migration checkpoint is discarded, since it belongs\n * to the vault this call replaces.\n *\n * Authenticate with social login and call {@link authenticateForRecovery}\n * first.\n *\n * @param params - The function parameters.\n * @param params.recoverySecret - The 32-byte Recovery Secret from escrow.\n * @param params.password - The password of the new local vault.\n * @returns The secret data of the vault.\n * @throws `RecoveryEnvelopeNotFound` if no vault keys are sealed for the\n * Recovery Secret, `RecoveryKeyShareConflict` if the nodes hold the key of\n * another Recovery Secret, or `Aal2Required` without a valid aal2 session.\n */\nexport type SeedlessOnboardingControllerRecoverWithRecoverySecretAction = {\n type: `SeedlessOnboardingController:recoverWithRecoverySecret`;\n handler: SeedlessOnboardingController['recoverWithRecoverySecret'];\n};\n\n/**\n * Set a new global password on an envelope-managed vault without the old\n * one, after {@link recoverWithRecoverySecret}.\n *\n * Only allowed while the local password is not yet synced with the global\n * password, which is the state {@link recoverWithRecoverySecret} leaves the\n * vault in, and with a valid aal2 session from\n * {@link authenticateForRecovery}. Once the reset or a sync succeeds, use\n * {@link changePassword} instead.\n *\n * The password OPRF key swap is signed with the auth key stored in the\n * vault's control record, so the old password is not needed. The vault\n * keys and the backend vault stay as they are, and the local vault is\n * re-encrypted under the new password.\n *\n * @param params - The function parameters.\n * @param params.newPassword - The new global password.\n * @returns A promise that resolves once the new password is global.\n * @throws `PasswordResetRequiresRecovery` if the vault is not\n * envelope-managed or its local password is already synced,\n * `Aal2Required` without a valid aal2 session, or\n * `EnvelopeControlRecordNotFound` if no control record matches the live\n * password OPRF key.\n */\nexport type SeedlessOnboardingControllerResetPasswordWithVaultKeysAction = {\n type: `SeedlessOnboardingController:resetPasswordWithVaultKeys`;\n handler: SeedlessOnboardingController['resetPasswordWithVaultKeys'];\n};\n\n/**\n * Rotate the refresh token — fetch a new refresh/revoke token pair from the\n * auth service and persist the new revoke token in the vault.\n *\n * This method should be called after a successful JWT refresh.\n *\n * @returns A Promise that resolves to void.\n */\nexport type SeedlessOnboardingControllerRotateRefreshTokenAction = {\n type: `SeedlessOnboardingController:rotateRefreshToken`;\n handler: SeedlessOnboardingController['rotateRefreshToken'];\n};\n\n/**\n * Revoke all pending refresh tokens.\n *\n * This method is to be called after user is authenticated.\n *\n * @returns A Promise that resolves to void.\n */\nexport type SeedlessOnboardingControllerRevokePendingRefreshTokensAction = {\n type: `SeedlessOnboardingController:revokePendingRefreshTokens`;\n handler: SeedlessOnboardingController['revokePendingRefreshTokens'];\n};\n\n/**\n * Get the access token from the state.\n *\n * If the tokens are expired, the method will refresh them and return the new access token.\n *\n * @returns The access token.\n */\nexport type SeedlessOnboardingControllerGetAccessTokenAction = {\n type: `SeedlessOnboardingController:getAccessToken`;\n handler: SeedlessOnboardingController['getAccessToken'];\n};\n\n/**\n * Check if the current node auth token is expired.\n *\n * @returns True if the current node auth token is expired, false otherwise.\n */\nexport type SeedlessOnboardingControllerCheckNodeAuthTokenExpiredAction = {\n type: `SeedlessOnboardingController:checkNodeAuthTokenExpired`;\n handler: SeedlessOnboardingController['checkNodeAuthTokenExpired'];\n};\n\n/**\n * Check if the current metadata access token should be refreshed.\n * Returns true when the token is expired or when less than 10% of its\n * lifetime remains (proactive refresh).\n *\n * @returns True if the metadata access token should be refreshed, false otherwise.\n */\nexport type SeedlessOnboardingControllerCheckMetadataAccessTokenExpiredAction =\n {\n type: `SeedlessOnboardingController:checkMetadataAccessTokenExpired`;\n handler: SeedlessOnboardingController['checkMetadataAccessTokenExpired'];\n };\n\n/**\n * Check if the current access token should be refreshed.\n * Returns true when the token is expired or when less than 10% of its\n * lifetime remains (proactive refresh).\n * When the vault is locked, the access token is not accessible, so we return false.\n *\n * @returns True if the access token should be refreshed, false otherwise.\n */\nexport type SeedlessOnboardingControllerCheckAccessTokenExpiredAction = {\n type: `SeedlessOnboardingController:checkAccessTokenExpired`;\n handler: SeedlessOnboardingController['checkAccessTokenExpired'];\n};\n\n/**\n * Union of all SeedlessOnboardingController action types.\n */\nexport type SeedlessOnboardingControllerMethodActions =\n | SeedlessOnboardingControllerFetchMetadataAccessCredsAction\n | SeedlessOnboardingControllerPreloadToprfNodeDetailsAction\n | SeedlessOnboardingControllerAuthenticateAction\n | SeedlessOnboardingControllerCreateToprfKeyAndBackupSeedPhraseAction\n | SeedlessOnboardingControllerAddNewSecretDataAction\n | SeedlessOnboardingControllerRunMigrationsAction\n | SeedlessOnboardingControllerFetchAllSecretDataAction\n | SeedlessOnboardingControllerChangePasswordAction\n | SeedlessOnboardingControllerUpdateBackupMetadataStateAction\n | SeedlessOnboardingControllerVerifyVaultPasswordAction\n | SeedlessOnboardingControllerGetSecretDataBackupStateAction\n | SeedlessOnboardingControllerSubmitPasswordAction\n | SeedlessOnboardingControllerIdentifyIncompleteMetadataBackupAction\n | SeedlessOnboardingControllerSetLockedAction\n | SeedlessOnboardingControllerSyncLatestGlobalPasswordAction\n | SeedlessOnboardingControllerSubmitGlobalPasswordAction\n | SeedlessOnboardingControllerCheckIsPasswordOutdatedAction\n | SeedlessOnboardingControllerGetIsUserAuthenticatedAction\n | SeedlessOnboardingControllerClearStateAction\n | SeedlessOnboardingControllerStoreKeyringEncryptionKeyAction\n | SeedlessOnboardingControllerLoadKeyringEncryptionKeyAction\n | SeedlessOnboardingControllerRefreshAuthTokensAction\n | SeedlessOnboardingControllerAuthenticateForRecoveryAction\n | SeedlessOnboardingControllerMigrateToEnvelopeAction\n | SeedlessOnboardingControllerRecoverWithRecoverySecretAction\n | SeedlessOnboardingControllerResetPasswordWithVaultKeysAction\n | SeedlessOnboardingControllerRotateRefreshTokenAction\n | SeedlessOnboardingControllerRevokePendingRefreshTokensAction\n | SeedlessOnboardingControllerGetAccessTokenAction\n | SeedlessOnboardingControllerCheckNodeAuthTokenExpiredAction\n | SeedlessOnboardingControllerCheckMetadataAccessTokenExpiredAction\n | SeedlessOnboardingControllerCheckAccessTokenExpiredAction;\n"]}
|
|
@@ -124,6 +124,9 @@ export declare class SeedlessOnboardingController<EncryptionKey = encryptionUtil
|
|
|
124
124
|
* Update the password of the seedless onboarding flow.
|
|
125
125
|
*
|
|
126
126
|
* Changing password will also update the encryption key, metadata store and the vault with new encrypted values.
|
|
127
|
+
* If the vault is envelope-managed, only the password envelope and the
|
|
128
|
+
* password OPRF key change; the vault keys and the backend vault stay as
|
|
129
|
+
* they are.
|
|
127
130
|
*
|
|
128
131
|
* @param newPassword - The new password to update.
|
|
129
132
|
* @param oldPassword - The old password to verify.
|
|
@@ -274,6 +277,106 @@ export declare class SeedlessOnboardingController<EncryptionKey = encryptionUtil
|
|
|
274
277
|
* @returns A promise that resolves when the tokens have been refreshed.
|
|
275
278
|
*/
|
|
276
279
|
refreshAuthTokens(): Promise<void>;
|
|
280
|
+
/**
|
|
281
|
+
* Authenticate on the recovery verifier with the aal2 token and store the
|
|
282
|
+
* issued node auth tokens, the token's `exp` and `sub` (profile ID), the
|
|
283
|
+
* verifier IDs, and whether a share already exists, as `recoverySession`.
|
|
284
|
+
* The aal1 `nodeAuthTokens`, `accessToken` and `metadataAccessToken` are
|
|
285
|
+
* left as they are.
|
|
286
|
+
*
|
|
287
|
+
* @param params - The function parameters.
|
|
288
|
+
* @param params.aal2Token - The aal2 token minted by the authentication API.
|
|
289
|
+
* Its `exp` caps the lifetime of the aal2 node auth tokens.
|
|
290
|
+
* @param params.authConnectionId - The recovery sub-verifier ID.
|
|
291
|
+
* @param params.groupedAuthConnectionId - The recovery aggregate verifier ID.
|
|
292
|
+
* @returns A promise that resolves once the aal2 set is stored.
|
|
293
|
+
* @throws `MissingAuthUserInfo` if either verifier ID is empty or not a string.
|
|
294
|
+
*/
|
|
295
|
+
authenticateForRecovery({ aal2Token, authConnectionId, groupedAuthConnectionId, }: {
|
|
296
|
+
aal2Token: string;
|
|
297
|
+
authConnectionId: string;
|
|
298
|
+
groupedAuthConnectionId: string;
|
|
299
|
+
}): Promise<void>;
|
|
300
|
+
/**
|
|
301
|
+
* Migrate the vault to envelope encryption, adopting its current key set
|
|
302
|
+
* as the vault key set `K_v`.
|
|
303
|
+
*
|
|
304
|
+
* Writes `rbek` (sealed for the Recovery Secret) and the control record
|
|
305
|
+
* into their own partitions. No secret data item is moved, and no password
|
|
306
|
+
* is needed: the current password still derives `K_v` directly, so the
|
|
307
|
+
* first `pbek` is written by the first password change. The sealed
|
|
308
|
+
* envelope is checkpointed before the first remote write, so a failed call
|
|
309
|
+
* can be retried with the same arguments. Does nothing if the vault is
|
|
310
|
+
* already envelope-managed.
|
|
311
|
+
*
|
|
312
|
+
* The vault must be unlocked and in sync with the global password. Register
|
|
313
|
+
* the Recovery Secret at the escrows first, then call
|
|
314
|
+
* {@link authenticateForRecovery}.
|
|
315
|
+
*
|
|
316
|
+
* @param params - The function parameters.
|
|
317
|
+
* @param params.recoverySecret - The 32-byte Recovery Secret held in escrow.
|
|
318
|
+
* @returns A promise that resolves once the vault is envelope-managed.
|
|
319
|
+
* @throws `OutdatedPassword` if the vault is not in sync with the global
|
|
320
|
+
* password.
|
|
321
|
+
*/
|
|
322
|
+
migrateToEnvelope({ recoverySecret, }: {
|
|
323
|
+
recoverySecret: Uint8Array;
|
|
324
|
+
}): Promise<void>;
|
|
325
|
+
/**
|
|
326
|
+
* Recover an envelope-managed vault with the Recovery Secret instead of the
|
|
327
|
+
* password: open `rbek` to get the vault key set `K_v`, fetch the secret
|
|
328
|
+
* data with it, and create the local vault under `password`.
|
|
329
|
+
*
|
|
330
|
+
* `password` only encrypts the local vault. Until the user syncs it with
|
|
331
|
+
* the global password ({@link syncLatestGlobalPassword}) or sets it as the
|
|
332
|
+
* global password ({@link resetPasswordWithVaultKeys}), the password counts
|
|
333
|
+
* as outdated.
|
|
334
|
+
*
|
|
335
|
+
* Any pending envelope migration checkpoint is discarded, since it belongs
|
|
336
|
+
* to the vault this call replaces.
|
|
337
|
+
*
|
|
338
|
+
* Authenticate with social login and call {@link authenticateForRecovery}
|
|
339
|
+
* first.
|
|
340
|
+
*
|
|
341
|
+
* @param params - The function parameters.
|
|
342
|
+
* @param params.recoverySecret - The 32-byte Recovery Secret from escrow.
|
|
343
|
+
* @param params.password - The password of the new local vault.
|
|
344
|
+
* @returns The secret data of the vault.
|
|
345
|
+
* @throws `RecoveryEnvelopeNotFound` if no vault keys are sealed for the
|
|
346
|
+
* Recovery Secret, `RecoveryKeyShareConflict` if the nodes hold the key of
|
|
347
|
+
* another Recovery Secret, or `Aal2Required` without a valid aal2 session.
|
|
348
|
+
*/
|
|
349
|
+
recoverWithRecoverySecret({ recoverySecret, password, }: {
|
|
350
|
+
recoverySecret: Uint8Array;
|
|
351
|
+
password: string;
|
|
352
|
+
}): Promise<SecretMetadata[]>;
|
|
353
|
+
/**
|
|
354
|
+
* Set a new global password on an envelope-managed vault without the old
|
|
355
|
+
* one, after {@link recoverWithRecoverySecret}.
|
|
356
|
+
*
|
|
357
|
+
* Only allowed while the local password is not yet synced with the global
|
|
358
|
+
* password, which is the state {@link recoverWithRecoverySecret} leaves the
|
|
359
|
+
* vault in, and with a valid aal2 session from
|
|
360
|
+
* {@link authenticateForRecovery}. Once the reset or a sync succeeds, use
|
|
361
|
+
* {@link changePassword} instead.
|
|
362
|
+
*
|
|
363
|
+
* The password OPRF key swap is signed with the auth key stored in the
|
|
364
|
+
* vault's control record, so the old password is not needed. The vault
|
|
365
|
+
* keys and the backend vault stay as they are, and the local vault is
|
|
366
|
+
* re-encrypted under the new password.
|
|
367
|
+
*
|
|
368
|
+
* @param params - The function parameters.
|
|
369
|
+
* @param params.newPassword - The new global password.
|
|
370
|
+
* @returns A promise that resolves once the new password is global.
|
|
371
|
+
* @throws `PasswordResetRequiresRecovery` if the vault is not
|
|
372
|
+
* envelope-managed or its local password is already synced,
|
|
373
|
+
* `Aal2Required` without a valid aal2 session, or
|
|
374
|
+
* `EnvelopeControlRecordNotFound` if no control record matches the live
|
|
375
|
+
* password OPRF key.
|
|
376
|
+
*/
|
|
377
|
+
resetPasswordWithVaultKeys({ newPassword, }: {
|
|
378
|
+
newPassword: string;
|
|
379
|
+
}): Promise<void>;
|
|
277
380
|
/**
|
|
278
381
|
* Rotate the refresh token — fetch a new refresh/revoke token pair from the
|
|
279
382
|
* auth service and persist the new revoke token in the vault.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SeedlessOnboardingController.d.ts","sourceRoot":"","sources":["../src/SeedlessOnboardingController.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,KAAK,eAAe,MAAM,8BAA8B,CAAC;AAErE,OAAO,KAAK,EACV,uBAAuB,EACvB,0BAA0B,EAE3B,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EACV,kBAAkB,
|
|
1
|
+
{"version":3,"file":"SeedlessOnboardingController.d.ts","sourceRoot":"","sources":["../src/SeedlessOnboardingController.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,KAAK,eAAe,MAAM,8BAA8B,CAAC;AAErE,OAAO,KAAK,EACV,uBAAuB,EACvB,0BAA0B,EAE3B,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EACV,kBAAkB,EAKlB,oBAAoB,EAErB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,+BAA+B,CAAC;AAavC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EACL,cAAc,EAEd,UAAU,EAEV,kCAAkC,EAEnC,MAAM,gBAAgB,CAAC;AAmCxB,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EACV,qCAAqC,EACrC,mCAAmC,EACpC,MAAM,yCAAyC,CAAC;AAKjD,OAAO,KAAK,EAEV,iCAAiC,EAEjC,qBAAqB,EAOtB,MAAM,YAAY,CAAC;AAwBpB,YAAY,EACV,mCAAmC,EACnC,kCAAkC,EAClC,0CAA0C,EAC1C,qCAAqC,EACrC,mCAAmC,EACnC,4CAA4C,GAC7C,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,uDAAuD,EAAE,MAAM,YAAY,CAAC;AAsErF,qBAAa,4BAA4B,CACvC,aAAa,G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