mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 15:53:27 +00:00
* Create state for biometric client key halves * Move enc string util to central utils * Provide biometric state through service * Use biometric state to track client key half * Create migration for client key half * Ensure client key half is removed on logout * Remove account data for client key half * Remove unnecessary key definition likes * Remove moved state from account * Fix null-conditional operator failure * Simplify migration * Remove lame test * Fix test type * Add migrator * Remove state that is never read. * Remove unnecessary biometric state We don't need to determine platform in desktop background, it can be done in the UI at any time. * Fix merge * Use platform utils to identify OS desktop type
43 lines
1.1 KiB
TypeScript
43 lines
1.1 KiB
TypeScript
export abstract class BiometricsServiceAbstraction {
|
|
osSupportsBiometric: () => Promise<boolean>;
|
|
canAuthBiometric: ({
|
|
service,
|
|
key,
|
|
userId,
|
|
}: {
|
|
service: string;
|
|
key: string;
|
|
userId: string;
|
|
}) => Promise<boolean>;
|
|
authenticateBiometric: () => Promise<boolean>;
|
|
getBiometricKey: (service: string, key: string) => Promise<string | null>;
|
|
setBiometricKey: (service: string, key: string, value: string) => Promise<void>;
|
|
setEncryptionKeyHalf: ({
|
|
service,
|
|
key,
|
|
value,
|
|
}: {
|
|
service: string;
|
|
key: string;
|
|
value: string;
|
|
}) => void;
|
|
deleteBiometricKey: (service: string, key: string) => Promise<void>;
|
|
}
|
|
|
|
export interface OsBiometricService {
|
|
osSupportsBiometric: () => Promise<boolean>;
|
|
authenticateBiometric: () => Promise<boolean>;
|
|
getBiometricKey: (
|
|
service: string,
|
|
key: string,
|
|
clientKeyHalfB64: string | undefined,
|
|
) => Promise<string | null>;
|
|
setBiometricKey: (
|
|
service: string,
|
|
key: string,
|
|
value: string,
|
|
clientKeyHalfB64: string | undefined,
|
|
) => Promise<void>;
|
|
deleteBiometricKey: (service: string, key: string) => Promise<void>;
|
|
}
|