@metamask-previews/seedless-onboarding-controller 6.1.0-preview-e983f054 → 6.1.0-preview-e958bbad
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 +5 -1
- package/dist/SeedlessOnboardingController.cjs.map +1 -1
- package/dist/SeedlessOnboardingController.d.cts +3 -2
- package/dist/SeedlessOnboardingController.d.cts.map +1 -1
- package/dist/SeedlessOnboardingController.d.mts +3 -2
- package/dist/SeedlessOnboardingController.d.mts.map +1 -1
- package/dist/SeedlessOnboardingController.mjs.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +4 -4
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +4 -4
- package/dist/types.d.mts.map +1 -1
- package/dist/types.mjs.map +1 -1
- package/package.json +2 -2
package/dist/types.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.cjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n ControllerGetStateAction,\n ControllerStateChangeEvent,\n} from '@metamask/base-controller';\nimport type { ExportableKeyEncryptor } from '@metamask/keyring-controller';\nimport type { Messenger } from '@metamask/messenger';\nimport type { KeyPair, NodeAuthTokens } from '@metamask/toprf-secure-backup';\nimport type { MutexInterface } from 'async-mutex';\n\nimport type {\n AuthConnection,\n controllerName,\n SecretMetadataVersion,\n SecretType,\n Web3AuthNetwork,\n} from './constants';\n\n/**\n * The backup state of the secret data.\n * Each secret data added/restored will be stored in the state locally.\n *\n * This is used to track the backup status of the secret data.\n */\nexport type SocialBackupsMetadata = {\n /**\n * The hash of the secret data.\n */\n hash: string;\n\n /**\n * The type of the secret data.\n */\n type: SecretType;\n\n /**\n * The optional keyringId to identify the keyring that the secret data belongs to.\n *\n * This is only required for `Mnemonic` secret data.\n */\n keyringId?: string;\n};\n\nexport type AuthenticatedUserDetails = {\n /**\n * Type of social login provider.\n */\n authConnection: AuthConnection;\n\n /**\n * The node auth tokens from OAuth User authentication after the Social login.\n *\n * This values are used to authenticate users when they go through the Seedless Onboarding flow.\n */\n nodeAuthTokens: NodeAuthTokens;\n\n /**\n * OAuth connection id from web3auth dashboard.\n */\n authConnectionId: string;\n\n /**\n * The optional grouped authConnectionId to authenticate the user with Web3Auth network.\n */\n groupedAuthConnectionId?: string;\n\n /**\n * The user email or ID from Social login.\n */\n userId: string;\n\n /**\n * The user email from Social login.\n */\n socialLoginEmail: string;\n\n /**\n * The refresh token used to refresh expired nodeAuthTokens.\n */\n refreshToken: string;\n};\n\nexport type SRPBackedUpUserDetails = {\n /**\n * The public key of the authentication key pair in base64 format.\n *\n * This value is used to check if the password is outdated compare to the global password and find backed up old password.\n */\n authPubKey: string;\n};\n\n/**\n * The data of the recovery error.\n */\nexport type RecoveryErrorData = {\n /**\n * The remaining time in seconds before the user can try again.\n */\n remainingTime: number;\n\n /**\n * The number of attempts made by the user.\n */\n numberOfAttempts: number;\n};\n\n// State\nexport type SeedlessOnboardingControllerState =\n Partial<AuthenticatedUserDetails> &\n Partial<SRPBackedUpUserDetails> & {\n /**\n * Encrypted array of serialized keyrings data.\n */\n vault?: string;\n\n /**\n * The hashes of the seed phrase backups.\n *\n * This is to facilitate the UI to display backup status of the seed phrases.\n */\n socialBackupsMetadata: SocialBackupsMetadata[];\n\n /**\n * The encryption key derived from the password and used to encrypt\n * the vault.\n */\n vaultEncryptionKey?: string;\n\n /**\n * The salt used to derive the encryption key from the password.\n */\n vaultEncryptionSalt?: string;\n\n /**\n * Cache for checkIsPasswordOutdated result and timestamp.\n */\n passwordOutdatedCache?: { isExpiredPwd: boolean; timestamp: number };\n\n /**\n * The refresh token used to refresh expired nodeAuthTokens.\n * This is persisted in state.\n */\n refreshToken?: string;\n\n /**\n * The revoke token used to revoke refresh token and get new refresh token and new revoke token.\n * This is temporarily stored in state during authentication and then persisted in the vault.\n */\n revokeToken?: string;\n\n /**\n * The refresh token and revoke token to be revoked.\n * This is persisted in state to revoke old refresh token when possible.\n */\n pendingToBeRevokedTokens?: {\n refreshToken: string;\n revokeToken: string;\n }[];\n\n /**\n * The encrypted seedless encryption key used to encrypt the seedless vault.\n */\n encryptedSeedlessEncryptionKey?: string;\n\n /**\n * The encrypted keyring encryption key used to encrypt the keyring vault.\n */\n encryptedKeyringEncryptionKey?: string;\n\n /**\n * The access token used for pairing with profile sync auth service and to access other services.\n */\n accessToken?: string;\n\n /**\n * The metadata access token used to access the metadata service.\n *\n * This token is used to access the metadata service before the vault is created or unlocked.\n */\n metadataAccessToken?: string;\n\n /**\n * Whether the user is authenticated with social login and TOPRF service.\n */\n isSeedlessOnboardingUserAuthenticated: boolean;\n };\n\n// Actions\nexport type SeedlessOnboardingControllerGetStateAction =\n ControllerGetStateAction<\n typeof controllerName,\n SeedlessOnboardingControllerState\n >;\nexport type SeedlessOnboardingControllerActions =\n SeedlessOnboardingControllerGetStateAction;\n\ntype AllowedActions = never;\n\n// Events\nexport type SeedlessOnboardingControllerStateChangeEvent =\n ControllerStateChangeEvent<\n typeof controllerName,\n SeedlessOnboardingControllerState\n >;\nexport type SeedlessOnboardingControllerEvents =\n SeedlessOnboardingControllerStateChangeEvent;\n\ntype AllowedEvents = never;\n\n// Messenger\nexport type SeedlessOnboardingControllerMessenger = Messenger<\n typeof controllerName,\n SeedlessOnboardingControllerActions | AllowedActions,\n SeedlessOnboardingControllerEvents | AllowedEvents\n>;\n\n/**\n * Encryptor interface for encrypting and decrypting seedless onboarding vault.\n */\nexport type VaultEncryptor<EncryptionKey> = Omit<\n ExportableKeyEncryptor<EncryptionKey>,\n 'encryptWithKey'\n>;\n\n/**\n * Additional key deriver for the TOPRF client.\n *\n * This is a function that takes a seed and salt and returns a key in bytes (Uint8Array).\n * It is used as an additional step during key derivation. This can be used, for example, to inject a slow key\n * derivation step to protect against local brute force attacks on the password.\n *\n * @default browser-passworder @link https://github.com/MetaMask/browser-passworder\n */\nexport type ToprfKeyDeriver = {\n /**\n * Derive a key from a seed and salt.\n *\n * @param seed - The seed to derive the key from.\n * @param salt - The salt to derive the key from.\n * @returns The derived key.\n */\n deriveKey: (seed: Uint8Array, salt: Uint8Array) => Promise<Uint8Array>;\n};\n\nexport type RefreshJWTToken = (params: {\n connection: AuthConnection;\n refreshToken: string;\n}) => Promise<{\n idTokens: string[];\n accessToken: string;\n metadataAccessToken: string;\n}>;\n\nexport type RevokeRefreshToken = (params: {\n connection: AuthConnection;\n revokeToken: string;\n}) => Promise<void>;\n\nexport type RenewRefreshToken = (params: {\n connection: AuthConnection;\n revokeToken: string;\n}) => Promise<{\n newRevokeToken: string;\n newRefreshToken: string;\n}>;\n\n/**\n * Seedless Onboarding Controller Options.\n *\n * @param messenger - The messenger to use for this controller.\n * @param state - The initial state to set on this controller.\n * @param encryptor - The encryptor to use for encrypting and decrypting seedless onboarding vault.\n */\nexport type SeedlessOnboardingControllerOptions<EncryptionKey> = {\n messenger: SeedlessOnboardingControllerMessenger;\n\n /**\n * Initial state to set on this controller.\n */\n state?: Partial<SeedlessOnboardingControllerState>;\n\n /**\n * Encryptor to use for encrypting and decrypting seedless onboarding vault.\n *\n * @default browser-passworder @link https://github.com/MetaMask/browser-passworder\n */\n encryptor: VaultEncryptor<EncryptionKey>;\n\n /**\n * A function to get a new jwt token using refresh token.\n */\n refreshJWTToken: RefreshJWTToken;\n\n /**\n * A function to revoke the refresh token.\n */\n revokeRefreshToken: RevokeRefreshToken;\n\n /**\n * A function to renew the refresh token and get new revoke token.\n */\n renewRefreshToken: RenewRefreshToken;\n\n /**\n * Optional key derivation interface for the TOPRF client.\n *\n * If provided, it will be used as an additional step during\n * key derivation. This can be used, for example, to inject a slow key\n * derivation step to protect against local brute force attacks on the\n * password.\n *\n * @default browser-passworder @link https://github.com/MetaMask/browser-passworder\n */\n toprfKeyDeriver?: ToprfKeyDeriver;\n\n /**\n * Type of Web3Auth network to be used for the Seedless Onboarding flow.\n *\n * @default Web3AuthNetwork.Mainnet\n */\n network?: Web3AuthNetwork;\n\n /**\n * The TTL of the password outdated cache in milliseconds.\n *\n * @default PASSWORD_OUTDATED_CACHE_TTL_MS\n */\n passwordOutdatedCacheTTL?: number;\n};\n\n/**\n * A function executed within a mutually exclusive lock, with\n * a mutex releaser in its option bag.\n *\n * @param releaseLock - A function to release the lock.\n */\nexport type MutuallyExclusiveCallback<Result> = ({\n releaseLock,\n}: {\n releaseLock: MutexInterface.Releaser;\n}) => Promise<Result>;\n\n/**\n * The structure of the data which is serialized and stored in the vault.\n */\nexport type VaultData = {\n /**\n * The encryption key to encrypt the seed phrase.\n */\n toprfEncryptionKey: string;\n /**\n * The encryption key to encrypt the password.\n */\n toprfPwEncryptionKey: string;\n /**\n * The authentication key pair to authenticate the TOPRF.\n */\n toprfAuthKeyPair: string;\n /**\n * The revoke token to revoke refresh token and get new refresh token and new revoke token.\n * The revoke token may no longer be available after a large number of password changes. In this case, re-authentication is advised.\n */\n revokeToken: string;\n /**\n * The access token used for pairing with profile sync auth service and to access other services.\n */\n accessToken: string;\n};\n\nexport type DeserializedVaultData = Pick<\n VaultData,\n 'accessToken' | 'revokeToken'\n> & {\n toprfEncryptionKey: Uint8Array;\n toprfPwEncryptionKey: Uint8Array;\n toprfAuthKeyPair: KeyPair;\n};\n\nexport type SecretDataType = Uint8Array | string | number;\n\n/**\n * The constructor options for the seed phrase metadata.\n */\nexport type SecretMetadataOptions = {\n /**\n * The timestamp when the seed phrase was created.\n */\n timestamp: number;\n /**\n * The type of the seed phrase.\n */\n type: SecretType;\n /**\n * The version of the seed phrase metadata.\n */\n version: SecretMetadataVersion;\n};\n\nexport type DecodedNodeAuthToken = {\n /**\n * The expiration time of the token in seconds.\n */\n exp: number;\n temp_key_x: string;\n temp_key_y: string;\n aud: string;\n verifier_name: string;\n verifier_id: string;\n scope: string;\n signature: string;\n};\n\nexport type DecodedBaseJWTToken = {\n /**\n * The expiration time of the token in seconds.\n */\n exp: number;\n /**\n * The issued at time of the token in seconds.\n */\n iat: number;\n /**\n * The audience of the token.\n */\n aud: string;\n /**\n * The issuer of the token.\n */\n iss: string;\n /**\n * The subject of the token.\n */\n sub: string;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"types.cjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n ControllerGetStateAction,\n ControllerStateChangeEvent,\n} from '@metamask/base-controller';\nimport type { Encryptor } from '@metamask/keyring-controller';\nimport type { Messenger } from '@metamask/messenger';\nimport type { KeyPair, NodeAuthTokens } from '@metamask/toprf-secure-backup';\nimport type { MutexInterface } from 'async-mutex';\n\nimport type {\n AuthConnection,\n controllerName,\n SecretMetadataVersion,\n SecretType,\n Web3AuthNetwork,\n} from './constants';\n\n/**\n * The backup state of the secret data.\n * Each secret data added/restored will be stored in the state locally.\n *\n * This is used to track the backup status of the secret data.\n */\nexport type SocialBackupsMetadata = {\n /**\n * The hash of the secret data.\n */\n hash: string;\n\n /**\n * The type of the secret data.\n */\n type: SecretType;\n\n /**\n * The optional keyringId to identify the keyring that the secret data belongs to.\n *\n * This is only required for `Mnemonic` secret data.\n */\n keyringId?: string;\n};\n\nexport type AuthenticatedUserDetails = {\n /**\n * Type of social login provider.\n */\n authConnection: AuthConnection;\n\n /**\n * The node auth tokens from OAuth User authentication after the Social login.\n *\n * This values are used to authenticate users when they go through the Seedless Onboarding flow.\n */\n nodeAuthTokens: NodeAuthTokens;\n\n /**\n * OAuth connection id from web3auth dashboard.\n */\n authConnectionId: string;\n\n /**\n * The optional grouped authConnectionId to authenticate the user with Web3Auth network.\n */\n groupedAuthConnectionId?: string;\n\n /**\n * The user email or ID from Social login.\n */\n userId: string;\n\n /**\n * The user email from Social login.\n */\n socialLoginEmail: string;\n\n /**\n * The refresh token used to refresh expired nodeAuthTokens.\n */\n refreshToken: string;\n};\n\nexport type SRPBackedUpUserDetails = {\n /**\n * The public key of the authentication key pair in base64 format.\n *\n * This value is used to check if the password is outdated compare to the global password and find backed up old password.\n */\n authPubKey: string;\n};\n\n/**\n * The data of the recovery error.\n */\nexport type RecoveryErrorData = {\n /**\n * The remaining time in seconds before the user can try again.\n */\n remainingTime: number;\n\n /**\n * The number of attempts made by the user.\n */\n numberOfAttempts: number;\n};\n\n// State\nexport type SeedlessOnboardingControllerState =\n Partial<AuthenticatedUserDetails> &\n Partial<SRPBackedUpUserDetails> & {\n /**\n * Encrypted array of serialized keyrings data.\n */\n vault?: string;\n\n /**\n * The hashes of the seed phrase backups.\n *\n * This is to facilitate the UI to display backup status of the seed phrases.\n */\n socialBackupsMetadata: SocialBackupsMetadata[];\n\n /**\n * The encryption key derived from the password and used to encrypt\n * the vault.\n */\n vaultEncryptionKey?: string;\n\n /**\n * The salt used to derive the encryption key from the password.\n */\n vaultEncryptionSalt?: string;\n\n /**\n * Cache for checkIsPasswordOutdated result and timestamp.\n */\n passwordOutdatedCache?: { isExpiredPwd: boolean; timestamp: number };\n\n /**\n * The refresh token used to refresh expired nodeAuthTokens.\n * This is persisted in state.\n */\n refreshToken?: string;\n\n /**\n * The revoke token used to revoke refresh token and get new refresh token and new revoke token.\n * This is temporarily stored in state during authentication and then persisted in the vault.\n */\n revokeToken?: string;\n\n /**\n * The refresh token and revoke token to be revoked.\n * This is persisted in state to revoke old refresh token when possible.\n */\n pendingToBeRevokedTokens?: {\n refreshToken: string;\n revokeToken: string;\n }[];\n\n /**\n * The encrypted seedless encryption key used to encrypt the seedless vault.\n */\n encryptedSeedlessEncryptionKey?: string;\n\n /**\n * The encrypted keyring encryption key used to encrypt the keyring vault.\n */\n encryptedKeyringEncryptionKey?: string;\n\n /**\n * The access token used for pairing with profile sync auth service and to access other services.\n */\n accessToken?: string;\n\n /**\n * The metadata access token used to access the metadata service.\n *\n * This token is used to access the metadata service before the vault is created or unlocked.\n */\n metadataAccessToken?: string;\n\n /**\n * Whether the user is authenticated with social login and TOPRF service.\n */\n isSeedlessOnboardingUserAuthenticated: boolean;\n };\n\n// Actions\nexport type SeedlessOnboardingControllerGetStateAction =\n ControllerGetStateAction<\n typeof controllerName,\n SeedlessOnboardingControllerState\n >;\nexport type SeedlessOnboardingControllerActions =\n SeedlessOnboardingControllerGetStateAction;\n\ntype AllowedActions = never;\n\n// Events\nexport type SeedlessOnboardingControllerStateChangeEvent =\n ControllerStateChangeEvent<\n typeof controllerName,\n SeedlessOnboardingControllerState\n >;\nexport type SeedlessOnboardingControllerEvents =\n SeedlessOnboardingControllerStateChangeEvent;\n\ntype AllowedEvents = never;\n\n// Messenger\nexport type SeedlessOnboardingControllerMessenger = Messenger<\n typeof controllerName,\n SeedlessOnboardingControllerActions | AllowedActions,\n SeedlessOnboardingControllerEvents | AllowedEvents\n>;\n\n/**\n * Encryptor interface for encrypting and decrypting seedless onboarding vault.\n */\nexport type VaultEncryptor<EncryptionKey, KeyDerivationParams> = Omit<\n Encryptor<EncryptionKey, KeyDerivationParams>,\n 'encryptWithKey'\n>;\n\n/**\n * Additional key deriver for the TOPRF client.\n *\n * This is a function that takes a seed and salt and returns a key in bytes (Uint8Array).\n * It is used as an additional step during key derivation. This can be used, for example, to inject a slow key\n * derivation step to protect against local brute force attacks on the password.\n *\n * @default browser-passworder @link https://github.com/MetaMask/browser-passworder\n */\nexport type ToprfKeyDeriver = {\n /**\n * Derive a key from a seed and salt.\n *\n * @param seed - The seed to derive the key from.\n * @param salt - The salt to derive the key from.\n * @returns The derived key.\n */\n deriveKey: (seed: Uint8Array, salt: Uint8Array) => Promise<Uint8Array>;\n};\n\nexport type RefreshJWTToken = (params: {\n connection: AuthConnection;\n refreshToken: string;\n}) => Promise<{\n idTokens: string[];\n accessToken: string;\n metadataAccessToken: string;\n}>;\n\nexport type RevokeRefreshToken = (params: {\n connection: AuthConnection;\n revokeToken: string;\n}) => Promise<void>;\n\nexport type RenewRefreshToken = (params: {\n connection: AuthConnection;\n revokeToken: string;\n}) => Promise<{\n newRevokeToken: string;\n newRefreshToken: string;\n}>;\n\n/**\n * Seedless Onboarding Controller Options.\n *\n * @param messenger - The messenger to use for this controller.\n * @param state - The initial state to set on this controller.\n * @param encryptor - The encryptor to use for encrypting and decrypting seedless onboarding vault.\n */\nexport type SeedlessOnboardingControllerOptions<\n EncryptionKey,\n SupportedKeyDerivationOptions,\n> = {\n messenger: SeedlessOnboardingControllerMessenger;\n\n /**\n * Initial state to set on this controller.\n */\n state?: Partial<SeedlessOnboardingControllerState>;\n\n /**\n * Encryptor to use for encrypting and decrypting seedless onboarding vault.\n *\n * @default browser-passworder @link https://github.com/MetaMask/browser-passworder\n */\n encryptor: VaultEncryptor<EncryptionKey, SupportedKeyDerivationOptions>;\n\n /**\n * A function to get a new jwt token using refresh token.\n */\n refreshJWTToken: RefreshJWTToken;\n\n /**\n * A function to revoke the refresh token.\n */\n revokeRefreshToken: RevokeRefreshToken;\n\n /**\n * A function to renew the refresh token and get new revoke token.\n */\n renewRefreshToken: RenewRefreshToken;\n\n /**\n * Optional key derivation interface for the TOPRF client.\n *\n * If provided, it will be used as an additional step during\n * key derivation. This can be used, for example, to inject a slow key\n * derivation step to protect against local brute force attacks on the\n * password.\n *\n * @default browser-passworder @link https://github.com/MetaMask/browser-passworder\n */\n toprfKeyDeriver?: ToprfKeyDeriver;\n\n /**\n * Type of Web3Auth network to be used for the Seedless Onboarding flow.\n *\n * @default Web3AuthNetwork.Mainnet\n */\n network?: Web3AuthNetwork;\n\n /**\n * The TTL of the password outdated cache in milliseconds.\n *\n * @default PASSWORD_OUTDATED_CACHE_TTL_MS\n */\n passwordOutdatedCacheTTL?: number;\n};\n\n/**\n * A function executed within a mutually exclusive lock, with\n * a mutex releaser in its option bag.\n *\n * @param releaseLock - A function to release the lock.\n */\nexport type MutuallyExclusiveCallback<Result> = ({\n releaseLock,\n}: {\n releaseLock: MutexInterface.Releaser;\n}) => Promise<Result>;\n\n/**\n * The structure of the data which is serialized and stored in the vault.\n */\nexport type VaultData = {\n /**\n * The encryption key to encrypt the seed phrase.\n */\n toprfEncryptionKey: string;\n /**\n * The encryption key to encrypt the password.\n */\n toprfPwEncryptionKey: string;\n /**\n * The authentication key pair to authenticate the TOPRF.\n */\n toprfAuthKeyPair: string;\n /**\n * The revoke token to revoke refresh token and get new refresh token and new revoke token.\n * The revoke token may no longer be available after a large number of password changes. In this case, re-authentication is advised.\n */\n revokeToken: string;\n /**\n * The access token used for pairing with profile sync auth service and to access other services.\n */\n accessToken: string;\n};\n\nexport type DeserializedVaultData = Pick<\n VaultData,\n 'accessToken' | 'revokeToken'\n> & {\n toprfEncryptionKey: Uint8Array;\n toprfPwEncryptionKey: Uint8Array;\n toprfAuthKeyPair: KeyPair;\n};\n\nexport type SecretDataType = Uint8Array | string | number;\n\n/**\n * The constructor options for the seed phrase metadata.\n */\nexport type SecretMetadataOptions = {\n /**\n * The timestamp when the seed phrase was created.\n */\n timestamp: number;\n /**\n * The type of the seed phrase.\n */\n type: SecretType;\n /**\n * The version of the seed phrase metadata.\n */\n version: SecretMetadataVersion;\n};\n\nexport type DecodedNodeAuthToken = {\n /**\n * The expiration time of the token in seconds.\n */\n exp: number;\n temp_key_x: string;\n temp_key_y: string;\n aud: string;\n verifier_name: string;\n verifier_id: string;\n scope: string;\n signature: string;\n};\n\nexport type DecodedBaseJWTToken = {\n /**\n * The expiration time of the token in seconds.\n */\n exp: number;\n /**\n * The issued at time of the token in seconds.\n */\n iat: number;\n /**\n * The audience of the token.\n */\n aud: string;\n /**\n * The issuer of the token.\n */\n iss: string;\n /**\n * The subject of the token.\n */\n sub: string;\n};\n"]}
|
package/dist/types.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ControllerGetStateAction, ControllerStateChangeEvent } from "@metamask/base-controller";
|
|
2
|
-
import type {
|
|
2
|
+
import type { Encryptor } from "@metamask/keyring-controller";
|
|
3
3
|
import type { Messenger } from "@metamask/messenger";
|
|
4
4
|
import type { KeyPair, NodeAuthTokens } from "@metamask/toprf-secure-backup";
|
|
5
5
|
import type { MutexInterface } from "async-mutex";
|
|
@@ -157,7 +157,7 @@ export type SeedlessOnboardingControllerMessenger = Messenger<typeof controllerN
|
|
|
157
157
|
/**
|
|
158
158
|
* Encryptor interface for encrypting and decrypting seedless onboarding vault.
|
|
159
159
|
*/
|
|
160
|
-
export type VaultEncryptor<EncryptionKey> = Omit<
|
|
160
|
+
export type VaultEncryptor<EncryptionKey, KeyDerivationParams> = Omit<Encryptor<EncryptionKey, KeyDerivationParams>, 'encryptWithKey'>;
|
|
161
161
|
/**
|
|
162
162
|
* Additional key deriver for the TOPRF client.
|
|
163
163
|
*
|
|
@@ -203,7 +203,7 @@ export type RenewRefreshToken = (params: {
|
|
|
203
203
|
* @param state - The initial state to set on this controller.
|
|
204
204
|
* @param encryptor - The encryptor to use for encrypting and decrypting seedless onboarding vault.
|
|
205
205
|
*/
|
|
206
|
-
export type SeedlessOnboardingControllerOptions<EncryptionKey> = {
|
|
206
|
+
export type SeedlessOnboardingControllerOptions<EncryptionKey, SupportedKeyDerivationOptions> = {
|
|
207
207
|
messenger: SeedlessOnboardingControllerMessenger;
|
|
208
208
|
/**
|
|
209
209
|
* Initial state to set on this controller.
|
|
@@ -214,7 +214,7 @@ export type SeedlessOnboardingControllerOptions<EncryptionKey> = {
|
|
|
214
214
|
*
|
|
215
215
|
* @default browser-passworder @link https://github.com/MetaMask/browser-passworder
|
|
216
216
|
*/
|
|
217
|
-
encryptor: VaultEncryptor<EncryptionKey>;
|
|
217
|
+
encryptor: VaultEncryptor<EncryptionKey, SupportedKeyDerivationOptions>;
|
|
218
218
|
/**
|
|
219
219
|
* A function to get a new jwt token using refresh token.
|
|
220
220
|
*/
|
package/dist/types.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,0BAA0B,EAC3B,kCAAkC;AACnC,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,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oB,GAAG;IACjC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;CACb,CAAC"}
|
package/dist/types.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ControllerGetStateAction, ControllerStateChangeEvent } from "@metamask/base-controller";
|
|
2
|
-
import type {
|
|
2
|
+
import type { Encryptor } from "@metamask/keyring-controller";
|
|
3
3
|
import type { Messenger } from "@metamask/messenger";
|
|
4
4
|
import type { KeyPair, NodeAuthTokens } from "@metamask/toprf-secure-backup";
|
|
5
5
|
import type { MutexInterface } from "async-mutex";
|
|
@@ -157,7 +157,7 @@ export type SeedlessOnboardingControllerMessenger = Messenger<typeof controllerN
|
|
|
157
157
|
/**
|
|
158
158
|
* Encryptor interface for encrypting and decrypting seedless onboarding vault.
|
|
159
159
|
*/
|
|
160
|
-
export type VaultEncryptor<EncryptionKey> = Omit<
|
|
160
|
+
export type VaultEncryptor<EncryptionKey, KeyDerivationParams> = Omit<Encryptor<EncryptionKey, KeyDerivationParams>, 'encryptWithKey'>;
|
|
161
161
|
/**
|
|
162
162
|
* Additional key deriver for the TOPRF client.
|
|
163
163
|
*
|
|
@@ -203,7 +203,7 @@ export type RenewRefreshToken = (params: {
|
|
|
203
203
|
* @param state - The initial state to set on this controller.
|
|
204
204
|
* @param encryptor - The encryptor to use for encrypting and decrypting seedless onboarding vault.
|
|
205
205
|
*/
|
|
206
|
-
export type SeedlessOnboardingControllerOptions<EncryptionKey> = {
|
|
206
|
+
export type SeedlessOnboardingControllerOptions<EncryptionKey, SupportedKeyDerivationOptions> = {
|
|
207
207
|
messenger: SeedlessOnboardingControllerMessenger;
|
|
208
208
|
/**
|
|
209
209
|
* Initial state to set on this controller.
|
|
@@ -214,7 +214,7 @@ export type SeedlessOnboardingControllerOptions<EncryptionKey> = {
|
|
|
214
214
|
*
|
|
215
215
|
* @default browser-passworder @link https://github.com/MetaMask/browser-passworder
|
|
216
216
|
*/
|
|
217
|
-
encryptor: VaultEncryptor<EncryptionKey>;
|
|
217
|
+
encryptor: VaultEncryptor<EncryptionKey, SupportedKeyDerivationOptions>;
|
|
218
218
|
/**
|
|
219
219
|
* A function to get a new jwt token using refresh token.
|
|
220
220
|
*/
|
package/dist/types.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,0BAA0B,EAC3B,kCAAkC;AACnC,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,0BAA0B,EAC3B,kCAAkC;AACnC,OAAO,KAAK,EAAE,SAAS,EAAE,qCAAqC;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,4BAA4B;AACrD,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,sCAAsC;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,oBAAoB;AAElD,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EACd,qBAAqB,EACrB,UAAU,EACV,eAAe,EAChB,wBAAoB;AAErB;;;;;GAKG;A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AC;IACZ;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;CACb,CAAC"}
|
package/dist/types.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.mjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n ControllerGetStateAction,\n ControllerStateChangeEvent,\n} from '@metamask/base-controller';\nimport type { ExportableKeyEncryptor } from '@metamask/keyring-controller';\nimport type { Messenger } from '@metamask/messenger';\nimport type { KeyPair, NodeAuthTokens } from '@metamask/toprf-secure-backup';\nimport type { MutexInterface } from 'async-mutex';\n\nimport type {\n AuthConnection,\n controllerName,\n SecretMetadataVersion,\n SecretType,\n Web3AuthNetwork,\n} from './constants';\n\n/**\n * The backup state of the secret data.\n * Each secret data added/restored will be stored in the state locally.\n *\n * This is used to track the backup status of the secret data.\n */\nexport type SocialBackupsMetadata = {\n /**\n * The hash of the secret data.\n */\n hash: string;\n\n /**\n * The type of the secret data.\n */\n type: SecretType;\n\n /**\n * The optional keyringId to identify the keyring that the secret data belongs to.\n *\n * This is only required for `Mnemonic` secret data.\n */\n keyringId?: string;\n};\n\nexport type AuthenticatedUserDetails = {\n /**\n * Type of social login provider.\n */\n authConnection: AuthConnection;\n\n /**\n * The node auth tokens from OAuth User authentication after the Social login.\n *\n * This values are used to authenticate users when they go through the Seedless Onboarding flow.\n */\n nodeAuthTokens: NodeAuthTokens;\n\n /**\n * OAuth connection id from web3auth dashboard.\n */\n authConnectionId: string;\n\n /**\n * The optional grouped authConnectionId to authenticate the user with Web3Auth network.\n */\n groupedAuthConnectionId?: string;\n\n /**\n * The user email or ID from Social login.\n */\n userId: string;\n\n /**\n * The user email from Social login.\n */\n socialLoginEmail: string;\n\n /**\n * The refresh token used to refresh expired nodeAuthTokens.\n */\n refreshToken: string;\n};\n\nexport type SRPBackedUpUserDetails = {\n /**\n * The public key of the authentication key pair in base64 format.\n *\n * This value is used to check if the password is outdated compare to the global password and find backed up old password.\n */\n authPubKey: string;\n};\n\n/**\n * The data of the recovery error.\n */\nexport type RecoveryErrorData = {\n /**\n * The remaining time in seconds before the user can try again.\n */\n remainingTime: number;\n\n /**\n * The number of attempts made by the user.\n */\n numberOfAttempts: number;\n};\n\n// State\nexport type SeedlessOnboardingControllerState =\n Partial<AuthenticatedUserDetails> &\n Partial<SRPBackedUpUserDetails> & {\n /**\n * Encrypted array of serialized keyrings data.\n */\n vault?: string;\n\n /**\n * The hashes of the seed phrase backups.\n *\n * This is to facilitate the UI to display backup status of the seed phrases.\n */\n socialBackupsMetadata: SocialBackupsMetadata[];\n\n /**\n * The encryption key derived from the password and used to encrypt\n * the vault.\n */\n vaultEncryptionKey?: string;\n\n /**\n * The salt used to derive the encryption key from the password.\n */\n vaultEncryptionSalt?: string;\n\n /**\n * Cache for checkIsPasswordOutdated result and timestamp.\n */\n passwordOutdatedCache?: { isExpiredPwd: boolean; timestamp: number };\n\n /**\n * The refresh token used to refresh expired nodeAuthTokens.\n * This is persisted in state.\n */\n refreshToken?: string;\n\n /**\n * The revoke token used to revoke refresh token and get new refresh token and new revoke token.\n * This is temporarily stored in state during authentication and then persisted in the vault.\n */\n revokeToken?: string;\n\n /**\n * The refresh token and revoke token to be revoked.\n * This is persisted in state to revoke old refresh token when possible.\n */\n pendingToBeRevokedTokens?: {\n refreshToken: string;\n revokeToken: string;\n }[];\n\n /**\n * The encrypted seedless encryption key used to encrypt the seedless vault.\n */\n encryptedSeedlessEncryptionKey?: string;\n\n /**\n * The encrypted keyring encryption key used to encrypt the keyring vault.\n */\n encryptedKeyringEncryptionKey?: string;\n\n /**\n * The access token used for pairing with profile sync auth service and to access other services.\n */\n accessToken?: string;\n\n /**\n * The metadata access token used to access the metadata service.\n *\n * This token is used to access the metadata service before the vault is created or unlocked.\n */\n metadataAccessToken?: string;\n\n /**\n * Whether the user is authenticated with social login and TOPRF service.\n */\n isSeedlessOnboardingUserAuthenticated: boolean;\n };\n\n// Actions\nexport type SeedlessOnboardingControllerGetStateAction =\n ControllerGetStateAction<\n typeof controllerName,\n SeedlessOnboardingControllerState\n >;\nexport type SeedlessOnboardingControllerActions =\n SeedlessOnboardingControllerGetStateAction;\n\ntype AllowedActions = never;\n\n// Events\nexport type SeedlessOnboardingControllerStateChangeEvent =\n ControllerStateChangeEvent<\n typeof controllerName,\n SeedlessOnboardingControllerState\n >;\nexport type SeedlessOnboardingControllerEvents =\n SeedlessOnboardingControllerStateChangeEvent;\n\ntype AllowedEvents = never;\n\n// Messenger\nexport type SeedlessOnboardingControllerMessenger = Messenger<\n typeof controllerName,\n SeedlessOnboardingControllerActions | AllowedActions,\n SeedlessOnboardingControllerEvents | AllowedEvents\n>;\n\n/**\n * Encryptor interface for encrypting and decrypting seedless onboarding vault.\n */\nexport type VaultEncryptor<EncryptionKey> = Omit<\n ExportableKeyEncryptor<EncryptionKey>,\n 'encryptWithKey'\n>;\n\n/**\n * Additional key deriver for the TOPRF client.\n *\n * This is a function that takes a seed and salt and returns a key in bytes (Uint8Array).\n * It is used as an additional step during key derivation. This can be used, for example, to inject a slow key\n * derivation step to protect against local brute force attacks on the password.\n *\n * @default browser-passworder @link https://github.com/MetaMask/browser-passworder\n */\nexport type ToprfKeyDeriver = {\n /**\n * Derive a key from a seed and salt.\n *\n * @param seed - The seed to derive the key from.\n * @param salt - The salt to derive the key from.\n * @returns The derived key.\n */\n deriveKey: (seed: Uint8Array, salt: Uint8Array) => Promise<Uint8Array>;\n};\n\nexport type RefreshJWTToken = (params: {\n connection: AuthConnection;\n refreshToken: string;\n}) => Promise<{\n idTokens: string[];\n accessToken: string;\n metadataAccessToken: string;\n}>;\n\nexport type RevokeRefreshToken = (params: {\n connection: AuthConnection;\n revokeToken: string;\n}) => Promise<void>;\n\nexport type RenewRefreshToken = (params: {\n connection: AuthConnection;\n revokeToken: string;\n}) => Promise<{\n newRevokeToken: string;\n newRefreshToken: string;\n}>;\n\n/**\n * Seedless Onboarding Controller Options.\n *\n * @param messenger - The messenger to use for this controller.\n * @param state - The initial state to set on this controller.\n * @param encryptor - The encryptor to use for encrypting and decrypting seedless onboarding vault.\n */\nexport type SeedlessOnboardingControllerOptions<EncryptionKey> = {\n messenger: SeedlessOnboardingControllerMessenger;\n\n /**\n * Initial state to set on this controller.\n */\n state?: Partial<SeedlessOnboardingControllerState>;\n\n /**\n * Encryptor to use for encrypting and decrypting seedless onboarding vault.\n *\n * @default browser-passworder @link https://github.com/MetaMask/browser-passworder\n */\n encryptor: VaultEncryptor<EncryptionKey>;\n\n /**\n * A function to get a new jwt token using refresh token.\n */\n refreshJWTToken: RefreshJWTToken;\n\n /**\n * A function to revoke the refresh token.\n */\n revokeRefreshToken: RevokeRefreshToken;\n\n /**\n * A function to renew the refresh token and get new revoke token.\n */\n renewRefreshToken: RenewRefreshToken;\n\n /**\n * Optional key derivation interface for the TOPRF client.\n *\n * If provided, it will be used as an additional step during\n * key derivation. This can be used, for example, to inject a slow key\n * derivation step to protect against local brute force attacks on the\n * password.\n *\n * @default browser-passworder @link https://github.com/MetaMask/browser-passworder\n */\n toprfKeyDeriver?: ToprfKeyDeriver;\n\n /**\n * Type of Web3Auth network to be used for the Seedless Onboarding flow.\n *\n * @default Web3AuthNetwork.Mainnet\n */\n network?: Web3AuthNetwork;\n\n /**\n * The TTL of the password outdated cache in milliseconds.\n *\n * @default PASSWORD_OUTDATED_CACHE_TTL_MS\n */\n passwordOutdatedCacheTTL?: number;\n};\n\n/**\n * A function executed within a mutually exclusive lock, with\n * a mutex releaser in its option bag.\n *\n * @param releaseLock - A function to release the lock.\n */\nexport type MutuallyExclusiveCallback<Result> = ({\n releaseLock,\n}: {\n releaseLock: MutexInterface.Releaser;\n}) => Promise<Result>;\n\n/**\n * The structure of the data which is serialized and stored in the vault.\n */\nexport type VaultData = {\n /**\n * The encryption key to encrypt the seed phrase.\n */\n toprfEncryptionKey: string;\n /**\n * The encryption key to encrypt the password.\n */\n toprfPwEncryptionKey: string;\n /**\n * The authentication key pair to authenticate the TOPRF.\n */\n toprfAuthKeyPair: string;\n /**\n * The revoke token to revoke refresh token and get new refresh token and new revoke token.\n * The revoke token may no longer be available after a large number of password changes. In this case, re-authentication is advised.\n */\n revokeToken: string;\n /**\n * The access token used for pairing with profile sync auth service and to access other services.\n */\n accessToken: string;\n};\n\nexport type DeserializedVaultData = Pick<\n VaultData,\n 'accessToken' | 'revokeToken'\n> & {\n toprfEncryptionKey: Uint8Array;\n toprfPwEncryptionKey: Uint8Array;\n toprfAuthKeyPair: KeyPair;\n};\n\nexport type SecretDataType = Uint8Array | string | number;\n\n/**\n * The constructor options for the seed phrase metadata.\n */\nexport type SecretMetadataOptions = {\n /**\n * The timestamp when the seed phrase was created.\n */\n timestamp: number;\n /**\n * The type of the seed phrase.\n */\n type: SecretType;\n /**\n * The version of the seed phrase metadata.\n */\n version: SecretMetadataVersion;\n};\n\nexport type DecodedNodeAuthToken = {\n /**\n * The expiration time of the token in seconds.\n */\n exp: number;\n temp_key_x: string;\n temp_key_y: string;\n aud: string;\n verifier_name: string;\n verifier_id: string;\n scope: string;\n signature: string;\n};\n\nexport type DecodedBaseJWTToken = {\n /**\n * The expiration time of the token in seconds.\n */\n exp: number;\n /**\n * The issued at time of the token in seconds.\n */\n iat: number;\n /**\n * The audience of the token.\n */\n aud: string;\n /**\n * The issuer of the token.\n */\n iss: string;\n /**\n * The subject of the token.\n */\n sub: string;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"types.mjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n ControllerGetStateAction,\n ControllerStateChangeEvent,\n} from '@metamask/base-controller';\nimport type { Encryptor } from '@metamask/keyring-controller';\nimport type { Messenger } from '@metamask/messenger';\nimport type { KeyPair, NodeAuthTokens } from '@metamask/toprf-secure-backup';\nimport type { MutexInterface } from 'async-mutex';\n\nimport type {\n AuthConnection,\n controllerName,\n SecretMetadataVersion,\n SecretType,\n Web3AuthNetwork,\n} from './constants';\n\n/**\n * The backup state of the secret data.\n * Each secret data added/restored will be stored in the state locally.\n *\n * This is used to track the backup status of the secret data.\n */\nexport type SocialBackupsMetadata = {\n /**\n * The hash of the secret data.\n */\n hash: string;\n\n /**\n * The type of the secret data.\n */\n type: SecretType;\n\n /**\n * The optional keyringId to identify the keyring that the secret data belongs to.\n *\n * This is only required for `Mnemonic` secret data.\n */\n keyringId?: string;\n};\n\nexport type AuthenticatedUserDetails = {\n /**\n * Type of social login provider.\n */\n authConnection: AuthConnection;\n\n /**\n * The node auth tokens from OAuth User authentication after the Social login.\n *\n * This values are used to authenticate users when they go through the Seedless Onboarding flow.\n */\n nodeAuthTokens: NodeAuthTokens;\n\n /**\n * OAuth connection id from web3auth dashboard.\n */\n authConnectionId: string;\n\n /**\n * The optional grouped authConnectionId to authenticate the user with Web3Auth network.\n */\n groupedAuthConnectionId?: string;\n\n /**\n * The user email or ID from Social login.\n */\n userId: string;\n\n /**\n * The user email from Social login.\n */\n socialLoginEmail: string;\n\n /**\n * The refresh token used to refresh expired nodeAuthTokens.\n */\n refreshToken: string;\n};\n\nexport type SRPBackedUpUserDetails = {\n /**\n * The public key of the authentication key pair in base64 format.\n *\n * This value is used to check if the password is outdated compare to the global password and find backed up old password.\n */\n authPubKey: string;\n};\n\n/**\n * The data of the recovery error.\n */\nexport type RecoveryErrorData = {\n /**\n * The remaining time in seconds before the user can try again.\n */\n remainingTime: number;\n\n /**\n * The number of attempts made by the user.\n */\n numberOfAttempts: number;\n};\n\n// State\nexport type SeedlessOnboardingControllerState =\n Partial<AuthenticatedUserDetails> &\n Partial<SRPBackedUpUserDetails> & {\n /**\n * Encrypted array of serialized keyrings data.\n */\n vault?: string;\n\n /**\n * The hashes of the seed phrase backups.\n *\n * This is to facilitate the UI to display backup status of the seed phrases.\n */\n socialBackupsMetadata: SocialBackupsMetadata[];\n\n /**\n * The encryption key derived from the password and used to encrypt\n * the vault.\n */\n vaultEncryptionKey?: string;\n\n /**\n * The salt used to derive the encryption key from the password.\n */\n vaultEncryptionSalt?: string;\n\n /**\n * Cache for checkIsPasswordOutdated result and timestamp.\n */\n passwordOutdatedCache?: { isExpiredPwd: boolean; timestamp: number };\n\n /**\n * The refresh token used to refresh expired nodeAuthTokens.\n * This is persisted in state.\n */\n refreshToken?: string;\n\n /**\n * The revoke token used to revoke refresh token and get new refresh token and new revoke token.\n * This is temporarily stored in state during authentication and then persisted in the vault.\n */\n revokeToken?: string;\n\n /**\n * The refresh token and revoke token to be revoked.\n * This is persisted in state to revoke old refresh token when possible.\n */\n pendingToBeRevokedTokens?: {\n refreshToken: string;\n revokeToken: string;\n }[];\n\n /**\n * The encrypted seedless encryption key used to encrypt the seedless vault.\n */\n encryptedSeedlessEncryptionKey?: string;\n\n /**\n * The encrypted keyring encryption key used to encrypt the keyring vault.\n */\n encryptedKeyringEncryptionKey?: string;\n\n /**\n * The access token used for pairing with profile sync auth service and to access other services.\n */\n accessToken?: string;\n\n /**\n * The metadata access token used to access the metadata service.\n *\n * This token is used to access the metadata service before the vault is created or unlocked.\n */\n metadataAccessToken?: string;\n\n /**\n * Whether the user is authenticated with social login and TOPRF service.\n */\n isSeedlessOnboardingUserAuthenticated: boolean;\n };\n\n// Actions\nexport type SeedlessOnboardingControllerGetStateAction =\n ControllerGetStateAction<\n typeof controllerName,\n SeedlessOnboardingControllerState\n >;\nexport type SeedlessOnboardingControllerActions =\n SeedlessOnboardingControllerGetStateAction;\n\ntype AllowedActions = never;\n\n// Events\nexport type SeedlessOnboardingControllerStateChangeEvent =\n ControllerStateChangeEvent<\n typeof controllerName,\n SeedlessOnboardingControllerState\n >;\nexport type SeedlessOnboardingControllerEvents =\n SeedlessOnboardingControllerStateChangeEvent;\n\ntype AllowedEvents = never;\n\n// Messenger\nexport type SeedlessOnboardingControllerMessenger = Messenger<\n typeof controllerName,\n SeedlessOnboardingControllerActions | AllowedActions,\n SeedlessOnboardingControllerEvents | AllowedEvents\n>;\n\n/**\n * Encryptor interface for encrypting and decrypting seedless onboarding vault.\n */\nexport type VaultEncryptor<EncryptionKey, KeyDerivationParams> = Omit<\n Encryptor<EncryptionKey, KeyDerivationParams>,\n 'encryptWithKey'\n>;\n\n/**\n * Additional key deriver for the TOPRF client.\n *\n * This is a function that takes a seed and salt and returns a key in bytes (Uint8Array).\n * It is used as an additional step during key derivation. This can be used, for example, to inject a slow key\n * derivation step to protect against local brute force attacks on the password.\n *\n * @default browser-passworder @link https://github.com/MetaMask/browser-passworder\n */\nexport type ToprfKeyDeriver = {\n /**\n * Derive a key from a seed and salt.\n *\n * @param seed - The seed to derive the key from.\n * @param salt - The salt to derive the key from.\n * @returns The derived key.\n */\n deriveKey: (seed: Uint8Array, salt: Uint8Array) => Promise<Uint8Array>;\n};\n\nexport type RefreshJWTToken = (params: {\n connection: AuthConnection;\n refreshToken: string;\n}) => Promise<{\n idTokens: string[];\n accessToken: string;\n metadataAccessToken: string;\n}>;\n\nexport type RevokeRefreshToken = (params: {\n connection: AuthConnection;\n revokeToken: string;\n}) => Promise<void>;\n\nexport type RenewRefreshToken = (params: {\n connection: AuthConnection;\n revokeToken: string;\n}) => Promise<{\n newRevokeToken: string;\n newRefreshToken: string;\n}>;\n\n/**\n * Seedless Onboarding Controller Options.\n *\n * @param messenger - The messenger to use for this controller.\n * @param state - The initial state to set on this controller.\n * @param encryptor - The encryptor to use for encrypting and decrypting seedless onboarding vault.\n */\nexport type SeedlessOnboardingControllerOptions<\n EncryptionKey,\n SupportedKeyDerivationOptions,\n> = {\n messenger: SeedlessOnboardingControllerMessenger;\n\n /**\n * Initial state to set on this controller.\n */\n state?: Partial<SeedlessOnboardingControllerState>;\n\n /**\n * Encryptor to use for encrypting and decrypting seedless onboarding vault.\n *\n * @default browser-passworder @link https://github.com/MetaMask/browser-passworder\n */\n encryptor: VaultEncryptor<EncryptionKey, SupportedKeyDerivationOptions>;\n\n /**\n * A function to get a new jwt token using refresh token.\n */\n refreshJWTToken: RefreshJWTToken;\n\n /**\n * A function to revoke the refresh token.\n */\n revokeRefreshToken: RevokeRefreshToken;\n\n /**\n * A function to renew the refresh token and get new revoke token.\n */\n renewRefreshToken: RenewRefreshToken;\n\n /**\n * Optional key derivation interface for the TOPRF client.\n *\n * If provided, it will be used as an additional step during\n * key derivation. This can be used, for example, to inject a slow key\n * derivation step to protect against local brute force attacks on the\n * password.\n *\n * @default browser-passworder @link https://github.com/MetaMask/browser-passworder\n */\n toprfKeyDeriver?: ToprfKeyDeriver;\n\n /**\n * Type of Web3Auth network to be used for the Seedless Onboarding flow.\n *\n * @default Web3AuthNetwork.Mainnet\n */\n network?: Web3AuthNetwork;\n\n /**\n * The TTL of the password outdated cache in milliseconds.\n *\n * @default PASSWORD_OUTDATED_CACHE_TTL_MS\n */\n passwordOutdatedCacheTTL?: number;\n};\n\n/**\n * A function executed within a mutually exclusive lock, with\n * a mutex releaser in its option bag.\n *\n * @param releaseLock - A function to release the lock.\n */\nexport type MutuallyExclusiveCallback<Result> = ({\n releaseLock,\n}: {\n releaseLock: MutexInterface.Releaser;\n}) => Promise<Result>;\n\n/**\n * The structure of the data which is serialized and stored in the vault.\n */\nexport type VaultData = {\n /**\n * The encryption key to encrypt the seed phrase.\n */\n toprfEncryptionKey: string;\n /**\n * The encryption key to encrypt the password.\n */\n toprfPwEncryptionKey: string;\n /**\n * The authentication key pair to authenticate the TOPRF.\n */\n toprfAuthKeyPair: string;\n /**\n * The revoke token to revoke refresh token and get new refresh token and new revoke token.\n * The revoke token may no longer be available after a large number of password changes. In this case, re-authentication is advised.\n */\n revokeToken: string;\n /**\n * The access token used for pairing with profile sync auth service and to access other services.\n */\n accessToken: string;\n};\n\nexport type DeserializedVaultData = Pick<\n VaultData,\n 'accessToken' | 'revokeToken'\n> & {\n toprfEncryptionKey: Uint8Array;\n toprfPwEncryptionKey: Uint8Array;\n toprfAuthKeyPair: KeyPair;\n};\n\nexport type SecretDataType = Uint8Array | string | number;\n\n/**\n * The constructor options for the seed phrase metadata.\n */\nexport type SecretMetadataOptions = {\n /**\n * The timestamp when the seed phrase was created.\n */\n timestamp: number;\n /**\n * The type of the seed phrase.\n */\n type: SecretType;\n /**\n * The version of the seed phrase metadata.\n */\n version: SecretMetadataVersion;\n};\n\nexport type DecodedNodeAuthToken = {\n /**\n * The expiration time of the token in seconds.\n */\n exp: number;\n temp_key_x: string;\n temp_key_y: string;\n aud: string;\n verifier_name: string;\n verifier_id: string;\n scope: string;\n signature: string;\n};\n\nexport type DecodedBaseJWTToken = {\n /**\n * The expiration time of the token in seconds.\n */\n exp: number;\n /**\n * The issued at time of the token in seconds.\n */\n iat: number;\n /**\n * The audience of the token.\n */\n aud: string;\n /**\n * The issuer of the token.\n */\n iss: string;\n /**\n * The subject of the token.\n */\n sub: string;\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metamask-previews/seedless-onboarding-controller",
|
|
3
|
-
"version": "6.1.0-preview-
|
|
3
|
+
"version": "6.1.0-preview-e958bbad",
|
|
4
4
|
"description": "Backup and rehydrate SRP(s) using social login and password",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"MetaMask",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"@lavamoat/allow-scripts": "^3.0.4",
|
|
63
63
|
"@lavamoat/preinstall-always-fail": "^2.1.0",
|
|
64
64
|
"@metamask/auto-changelog": "^3.4.4",
|
|
65
|
-
"@metamask/browser-passworder": "^
|
|
65
|
+
"@metamask/browser-passworder": "^6.0.0",
|
|
66
66
|
"@metamask/keyring-controller": "^24.0.0",
|
|
67
67
|
"@ts-bridge/cli": "^0.6.4",
|
|
68
68
|
"@types/elliptic": "^6",
|