All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Revert
revokeTokenvalue as optional inauthenticatemethod. (#7012) - Renamed
checkIsSeedlessOnboardingUserAuthenticatedtogetIsUserAuthenticated. (#7012)
- Fixed
InvalidRevokeTokenissue inrefreshAuthTokensmethod. (#7012)
- Added new public method,
checkIsSeedlessOnboardingUserAuthenticatedto validate the controller authenticate tokens state. (#6998)
- BREAKING Update
refreshTokenandrevokeTokenparams as required inAuthenticatemethod. (#6998) - Refactor
refreshAuthTokensmethod, separately catch refreshJWTToken and authenticate errors. (#6998) - Bump
@metamask/toprf-secure-backuppackage to0.10.0. (#6998)
- Fixed
Invalid Access Tokenerror during rehydration. (#6998)
- BREAKING: Use new
Messengerfrom@metamask/messenger(#6364)- Previously,
SeedlessOnboardingControlleraccepted aRestrictedMessengerinstance from@metamask/base-controller.
- Previously,
- BREAKING: Metadata property
anonymousrenamed toincludeInDebugSnapshot(#6364) - BREAKING: Bump
@metamask/keyring-controllerfrom^23.0.0to^24.0.0(#6962) - Bump
@metamask/base-controllerfrom^8.4.2to^9.0.0(#6962)
- Bump
@metamask/base-controllerfrom^8.4.1to^8.4.2(#6917)
- Add two new controller state metadata properties:
includeInStateLogsandusedInUi(#6504)
- Bump
@metamask/utilsfrom^11.4.2to^11.8.1(#6588, #6708) - Bump
@metamask/base-controllerfrom^8.3.0to^8.4.1(#6632, #6807)
- Added
renewRefreshTokenoptions in SeedlessOnboardingController constructor - A function to renew the refresh token and get new revoke token. (#6275) - Added
renewRefreshTokenmethod to renew refresh token from client (#6275) - Added
revokePendingRefreshTokensmethod to revoke all pending old refresh tokens instead from client (#6275)
- BREAKING: Updated ControllerMessenger
AllowedEvents. (#6292) - Update
setLocked()method withmutexand it becomesasyncmethod. (#6292) - Bump
@metamask/base-controllerfrom^8.1.0to^8.3.0(#6355, #6465) - refactor: cache vault data while unlock (#6205)
- BREAKING: Removed
Keyring:lockandKeyring:unlockevents from the controller allowed events. (#6292) - Removed
revokeRefreshTokenmethod (#6275)
- BREAKING: Bump peer dependency
@metamask/keyring-controllerfrom^22.0.0to^23.0.0(#6345)
- Added new persisted state value,
isSeedlessOnboardingUserAuthenticated. (#6288)- This is for the UI state in the clients, to avoid querying sensistive controller state data to determine the social login authentication state.
- Bump
@metamask/base-controllerfrom^8.0.1to^8.1.0(#6284)
- Set
anonymoustofalsefor sensitive fields in the controller state. (#6283)
- Moved
@noble/hashesfrom dev dependencies to main dependencies and bumped from^1.4.0to^1.8.0(#6101) - Moved
@noble/ciphersfrom dev dependencies to main dependencies and bumped from^0.5.2to^1.3.0(#6101) - Moved
@noble/curvesfrom dev dependencies to main dependencies and bumped from^1.2.0to^1.9.2(#6101)
- Fixed the vault creation with incorrect revokeToken value after fetching new revoke token asynchronously. (#6272)
-
Added an optional parameter,
passwordOutdatedCacheTTLto the constructor params and exportedSecretMetadataclass from the controller.(#6169) -
Added
revokeRefreshTokenfunction to revoke refresh token and update vault with the new revoke token.(#6187)
- Retrieve
accessTokenfrom the encrypted vault if it's not available as an in-memory state. (#6155)
- Added a optional param
maxKeyChainLengthinsubmitGlobalPasswordfunction.(#6134) - Separated vault update logic from
revokeRefreshToken,revokeRefreshTokennow accepts a revokeToken instead of password. (#6134)
revokeRefreshTokenis removed and a private function namedrevokeRefreshTokenAndUpdateStateis added as a replacement.(#6136)
- Seedless onboarding controller: Remove usage of
Buffer(#6140)
- Removed
access_tokenvalidation when the wallet is locked. (#6133) - Removed
revoke_tokenvalidation from#parseVaultandcreateNewVaultWithAuthDatato handle the case when max key chain length exceeds. (#6136)
- Added
access_tokenandmetadata_access_tokenin seedless controller state. (#6060)access_tokencan be used by profile sync pairing and for other apis access after wallet is unlocked.metadata_access_tokenis used to give access for web3auth metadata apis.
- remove buffer usage in seedless controller (#6080)
- Added
PrivateKey syncfeature to the controller (#5948).- BREAKING Updated controller methods signatures.
- removed
addNewSeedPhraseBackupand replaced withaddNewSecretDatamethod. - added
addNewSecretDatamethod implementation to support adding different secret data types. - renamed
fetchAllSeedPhrasesmethod tofetchAllSecretDataand updated the return value toRecord<SecretType, Uint8Array[]>. - added new error message,
MissingKeyringIdwhich will throw if nokeyringIdis provided during seed phrase (Mnemonic) backup.
- Added a check for
duplicate databefore adding it to the metadata store. (#5955)- renamed
getSeedPhraseBackupHashtogetSecretDataBackupStateand added optional param (type) to look for data with specific type in the controller backup state. - updated
updateBackupMetadataStatemethod param with{ keyringId?: string; data: Uint8Array; type: SecretType }. Previously ,{ keyringId: string; seedPhrase: Uint8Array }.
- renamed
- Added
submitGlobalPassword. (#5995) - Added
storeKeyringEncryptionKeyandloadKeyringEncryptionKey. (#5995) - Added validations in
fetchAllSecretData. (#6047)- Throwing
NoSecretDataFounderror when the client receives the empty secret data from the metadata store. - Throwing
InvalidPrimarySecretDataTypeerror when the first secret data backup is not aMnemonic. First backup must always be aMnemonicsince generating a new mnemonic (SRP) is the only way to create a new wallet for a Social Login user.
- Throwing
- Refresh and revoke token handling (#5917)
- BREAKING:
authenticateneed extrarefreshTokenandrevokeTokenparams, persist refresh token in state and store revoke token temporarily for user in next step createToprfKeyAndBackupSeedPhrase,fetchAllSecretDatastore revoke token in vault- check for token expired in toprf call, refresh token and retry if expired
submitPasswordrevoke refresh token and replace with new one after password submit to prevent malicious use if refresh token leak in persisted state
- BREAKING:
- Removed
recoveryRatelimitCachefrom the controller state. (#5976). - BREAKING: Changed
syncLatestGlobalPassword. (#5995)- removed parameter
oldPassword - no longer verifying old password
- explicitly requring unlocked controller
- removed parameter
- BREAKING Changed data structure of return values from
fetchAllSecretData. (#6047)- Now returns
SecretMetadata[]object instead ofRecord<SecretType, Uint8Array[]>
- Now returns
- Bump
@metamask/utilsfrom^11.2.0to^11.4.2(#6054)
- Removed
recoverCurrentDevicePassword. (#5995)
- Initial release of the seedless onboarding controller (#5874, #5875, #5880)
- This controller allows MM extension and mobile users to login with google, apple accounts. This controller communicates with web3auth nodes + relies on toprf sdk (unreleased) to perform CRU operations related to backing up srps.
- The controller contains the following methods:
authenticate: Authenticate OAuth user, generate Valid Authentication Token to interact with TOPRF Services and determine if the user has already registered or not.createToprfKeyAndBackupSeedPhrase: Create a new TOPRF encryption key using given password, encrypt the Seed Phrase and store the encrypted data in the metadata store.addNewSeedPhraseBackup: Add and encrypt a new seed phrase backup to the metadata store without create a new TOPRF encryption key.fetchAllSeedPhrases: Retrieve the encrypted backed-up Seed Phrases from the metadatastore and return decrypted Seed Phrases.changePassword: Update the password of the seedless onboarding flowupdateBackupMetadataState: Update the backup metadata state of the controller.verifyVaultPassword: Verify the password validity by decrypting the vaultgetSeedPhraseBackupHash: Get the hash of the seed phrase backup for the given seed phrase from the state.submitPassword: Validate a password and unlock the controller.setLocked: Remove secrets from state and set the controller status to locked.syncLatestGlobalPassword: Sync the latest global password to the controller. This is useful for syncing the password change update across multiple devices.recoverCurrentDevicePassword:- Recover the vault which is encrypted with the outdated password with the new password.
- This is useful when user wants to sync the current device without logging out.
- e.g. User enters the new password, decrypts the current vault (which was initially encrypted with old password) using the new password and recover the Key data.
checkIsPasswordOutdated: Check if the password is current device is outdated, i.e. user changed password in another device.clearState: Reset the state of the controller to the defaults.