1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-27 01:53:23 +00:00

[PM-31763] Add unlock service & module (#18870)

* Add unlock service

* Move methods

* Prettier

* Fix type errors

* Prettier

* Fix test

* Fix module order

* Attempt to fix tests

* Cleanup CODEOWNERS

* Backport biometric unlock and legacy master-key logic

* Add tests for biometrics

* Prettier

* Add biometric unlock to abstract unlock service

* Fix build
This commit is contained in:
Bernd Schoolmann
2026-02-25 18:50:25 +01:00
committed by GitHub
parent 4f706746d6
commit 666ff42d22
20 changed files with 631 additions and 5 deletions

View File

@@ -45,10 +45,14 @@ export const MASTER_KEY = new UserKeyDefinition<MasterKey>(MASTER_PASSWORD_MEMOR
});
/** Disk since master key hash is used for unlock */
const MASTER_KEY_HASH = new UserKeyDefinition<string>(MASTER_PASSWORD_DISK, "masterKeyHash", {
deserializer: (masterKeyHash) => masterKeyHash,
clearOn: ["logout"],
});
export const MASTER_KEY_HASH = new UserKeyDefinition<string>(
MASTER_PASSWORD_DISK,
"masterKeyHash",
{
deserializer: (masterKeyHash) => masterKeyHash,
clearOn: ["logout"],
},
);
/** Disk to persist through lock */
export const MASTER_KEY_ENCRYPTED_USER_KEY = new UserKeyDefinition<EncryptedString>(

View File

@@ -45,6 +45,14 @@ export class MasterPasswordUnlockData {
);
}
toSdk(): SdkMasterPasswordUnlockData {
return {
salt: this.salt,
kdf: this.kdf.toSdkConfig(),
masterKeyWrappedUserKey: this.masterKeyWrappedUserKey,
};
}
toJSON(): any {
return {
salt: this.salt,