@metamask-previews/seedless-onboarding-controller 2.5.1-preview-8a39b4da → 2.5.1-preview-eb8c7b7a

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 CHANGED
@@ -7,16 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
- ### Fixed
11
-
12
- - Apply controller level lock, mutex, on the `setLocked()` call. ([#6278](https://github.com/MetaMask/core/pull/6278))
13
-
14
-
15
10
  ### Changed
16
11
 
17
- - Refactor `setUnlocked` method from `createNewVaultWithAuthData` method. ([#6278](https://github.com/MetaMask/core/pull/6278))
18
12
  - Bump `@metamask/base-controller` from `^8.0.1` to `^8.1.0` ([#6284](https://github.com/MetaMask/core/pull/6284))
19
13
 
14
+ ### Fixed
15
+
16
+ - Set `anonymous` to `false` for sensitive fields in the controller state. ([#6283](https://github.com/MetaMask/core/pull/6283))
17
+
20
18
  ## [2.5.1]
21
19
 
22
20
  ### Changed
@@ -54,11 +54,11 @@ const seedlessOnboardingMetadata = {
54
54
  },
55
55
  socialBackupsMetadata: {
56
56
  persist: true,
57
- anonymous: true,
57
+ anonymous: false,
58
58
  },
59
59
  nodeAuthTokens: {
60
60
  persist: true,
61
- anonymous: true,
61
+ anonymous: false,
62
62
  },
63
63
  authConnection: {
64
64
  persist: true,
@@ -74,23 +74,23 @@ const seedlessOnboardingMetadata = {
74
74
  },
75
75
  userId: {
76
76
  persist: true,
77
- anonymous: true,
77
+ anonymous: false,
78
78
  },
79
79
  socialLoginEmail: {
80
80
  persist: true,
81
- anonymous: true,
81
+ anonymous: false,
82
82
  },
83
83
  vaultEncryptionKey: {
84
84
  persist: false,
85
- anonymous: true,
85
+ anonymous: false,
86
86
  },
87
87
  vaultEncryptionSalt: {
88
88
  persist: false,
89
- anonymous: true,
89
+ anonymous: false,
90
90
  },
91
91
  authPubKey: {
92
92
  persist: true,
93
- anonymous: true,
93
+ anonymous: false,
94
94
  },
95
95
  passwordOutdatedCache: {
96
96
  persist: true,
@@ -98,30 +98,30 @@ const seedlessOnboardingMetadata = {
98
98
  },
99
99
  refreshToken: {
100
100
  persist: true,
101
- anonymous: true,
101
+ anonymous: false,
102
102
  },
103
103
  revokeToken: {
104
104
  persist: false,
105
- anonymous: true,
105
+ anonymous: false,
106
106
  },
107
107
  // stays in vault
108
108
  accessToken: {
109
109
  persist: false,
110
- anonymous: true,
110
+ anonymous: false,
111
111
  },
112
112
  // stays outside of vault as this token is accessed by the metadata service
113
113
  // before the vault is created or unlocked.
114
114
  metadataAccessToken: {
115
115
  persist: true,
116
- anonymous: true,
116
+ anonymous: false,
117
117
  },
118
118
  encryptedSeedlessEncryptionKey: {
119
119
  persist: true,
120
- anonymous: true,
120
+ anonymous: false,
121
121
  },
122
122
  encryptedKeyringEncryptionKey: {
123
123
  persist: true,
124
- anonymous: true,
124
+ anonymous: false,
125
125
  },
126
126
  };
127
127
  class SeedlessOnboardingController extends base_controller_1.BaseController {
@@ -176,8 +176,8 @@ class SeedlessOnboardingController extends base_controller_1.BaseController {
176
176
  __classPrivateFieldSet(this, _SeedlessOnboardingController_revokeRefreshToken, revokeRefreshToken, "f");
177
177
  // setup subscriptions to the keyring lock event
178
178
  // when the keyring is locked (wallet is locked), the controller will be cleared of its credentials
179
- this.messagingSystem.subscribe('KeyringController:lock', async () => {
180
- await this.setLocked();
179
+ this.messagingSystem.subscribe('KeyringController:lock', () => {
180
+ this.setLocked();
181
181
  });
182
182
  this.messagingSystem.subscribe('KeyringController:unlock', () => {
183
183
  __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_setUnlocked).call(this);
@@ -302,7 +302,6 @@ class SeedlessOnboardingController extends base_controller_1.BaseController {
302
302
  rawToprfPwEncryptionKey: pwEncKey,
303
303
  rawToprfAuthKeyPair: authKeyPair,
304
304
  });
305
- __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_setUnlocked).call(this);
306
305
  };
307
306
  await __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_executeWithTokenRefresh).call(this, performKeyCreationAndBackup, 'createToprfKeyAndBackupSeedPhrase');
308
307
  });
@@ -377,7 +376,6 @@ class SeedlessOnboardingController extends base_controller_1.BaseController {
377
376
  rawToprfPwEncryptionKey: pwEncKey,
378
377
  rawToprfAuthKeyPair: authKeyPair,
379
378
  });
380
- __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_setUnlocked).call(this);
381
379
  }
382
380
  return secrets;
383
381
  };
@@ -504,16 +502,14 @@ class SeedlessOnboardingController extends base_controller_1.BaseController {
504
502
  *
505
503
  * When the controller is locked, the user will not be able to perform any operations on the controller/vault.
506
504
  */
507
- async setLocked() {
508
- await __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_withControllerLock).call(this, async () => {
509
- this.update((state) => {
510
- delete state.vaultEncryptionKey;
511
- delete state.vaultEncryptionSalt;
512
- delete state.revokeToken;
513
- delete state.accessToken;
514
- });
515
- __classPrivateFieldSet(this, _SeedlessOnboardingController_isUnlocked, false, "f");
505
+ setLocked() {
506
+ this.update((state) => {
507
+ delete state.vaultEncryptionKey;
508
+ delete state.vaultEncryptionSalt;
509
+ delete state.revokeToken;
510
+ delete state.accessToken;
516
511
  });
512
+ __classPrivateFieldSet(this, _SeedlessOnboardingController_isUnlocked, false, "f");
517
513
  }
518
514
  /**
519
515
  * Sync the latest global password to the controller.
@@ -538,7 +534,6 @@ class SeedlessOnboardingController extends base_controller_1.BaseController {
538
534
  rawToprfAuthKeyPair: authKeyPair,
539
535
  });
540
536
  __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_resetPasswordOutdatedCache).call(this);
541
- __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_setUnlocked).call(this);
542
537
  };
543
538
  return await __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_executeWithTokenRefresh).call(this, doSyncPassword, 'syncLatestGlobalPassword');
544
539
  });
@@ -1227,6 +1222,7 @@ async function _SeedlessOnboardingController_createNewVaultWithAuthData({ passwo
1227
1222
  __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_persistAuthPubKey).call(this, {
1228
1223
  authPubKey: rawToprfAuthKeyPair.pk,
1229
1224
  });
1225
+ __classPrivateFieldGet(this, _SeedlessOnboardingController_instances, "m", _SeedlessOnboardingController_setUnlocked).call(this);
1230
1226
  }, _SeedlessOnboardingController_updateVault =
1231
1227
  /**
1232
1228
  * Encrypt and update the vault with the given authentication data.