diff --git a/libs/common/src/platform/abstractions/state.service.ts b/libs/common/src/platform/abstractions/state.service.ts index 6ae3a523cc7..a7b1d8928d8 100644 --- a/libs/common/src/platform/abstractions/state.service.ts +++ b/libs/common/src/platform/abstractions/state.service.ts @@ -77,16 +77,49 @@ export abstract class StateService { setCollapsedGroupings: (value: string[], options?: StorageOptions) => Promise; getConvertAccountToKeyConnector: (options?: StorageOptions) => Promise; setConvertAccountToKeyConnector: (value: boolean, options?: StorageOptions) => Promise; + /** + * gets the user's symmetric key + */ getUserSymKey: (options?: StorageOptions) => Promise; + /** + * Sets the user's symmetric key + */ setUserSymKey: (value: UserSymKey, options?: StorageOptions) => Promise; + /** + * Gets the user's master key + */ getMasterKey: (options?: StorageOptions) => Promise; + /** + * Sets the user's master key + */ setMasterKey: (value: MasterKey, options?: StorageOptions) => Promise; + /** + * Gets the user's symmetric key encrypted by the master key + */ getUserSymKeyMasterKey: (options?: StorageOptions) => Promise; + /** + * Sets the user's symmetric key encrypted by the master key + */ setUserSymKeyMasterKey: (value: string, options?: StorageOptions) => Promise; + /** + * Gets the user's auto key + */ getUserSymKeyAuto: (options?: StorageOptions) => Promise; + /** + * Sets the user's auto key + */ setUserSymKeyAuto: (value: string, options?: StorageOptions) => Promise; + /** + * Gets the user's biometric key + */ getUserSymKeyBiometric: (options?: StorageOptions) => Promise; + /** + * Checks if the user has a biometric key available + */ hasUserSymKeyBiometric: (options?: StorageOptions) => Promise; + /** + * Sets the user's biometric key + */ setUserSymKeyBiometric: (value: BiometricKey, options?: StorageOptions) => Promise; /** * Gets the user's symmetric key encrypted by the Pin key. @@ -108,8 +141,6 @@ export abstract class StateService { * Used when Master Password on Reset is enabled */ setUserSymKeyPinEphemeral: (value: EncString, options?: StorageOptions) => Promise; - - // deprecated keys /** * @deprecated For migration purposes only, use getUserSymKeyMasterKey instead */ @@ -118,13 +149,10 @@ export abstract class StateService { * @deprecated For migration purposes only, use setUserSymKeyMasterKey instead */ setEncryptedCryptoSymmetricKey: (value: string, options?: StorageOptions) => Promise; - getDecryptedCryptoSymmetricKey: (options?: StorageOptions) => Promise; - setDecryptedCryptoSymmetricKey: ( - value: SymmetricCryptoKey, - options?: StorageOptions - ) => Promise; + /** + * @deprecated For legacy purposes only, use getMasterKey instead + */ getCryptoMasterKey: (options?: StorageOptions) => Promise; - setCryptoMasterKey: (value: SymmetricCryptoKey, options?: StorageOptions) => Promise; /** * @deprecated For migration purposes only, use getUserSymKeyAuto instead */ @@ -133,8 +161,6 @@ export abstract class StateService { * @deprecated For migration purposes only, use setUserSymKeyAuto instead */ setCryptoMasterKeyAuto: (value: string, options?: StorageOptions) => Promise; - getCryptoMasterKeyB64: (options?: StorageOptions) => Promise; - setCryptoMasterKeyB64: (value: string, options?: StorageOptions) => Promise; /** * @deprecated For migration purposes only, use getUserSymKeyBiometric instead */ @@ -147,8 +173,6 @@ export abstract class StateService { * @deprecated For migration purposes only, use setUserSymKeyBiometric instead */ setCryptoMasterKeyBiometric: (value: BiometricKey, options?: StorageOptions) => Promise; - // end deprecated keys - getDecryptedCiphers: (options?: StorageOptions) => Promise; setDecryptedCiphers: (value: CipherView[], options?: StorageOptions) => Promise; getDecryptedCollections: (options?: StorageOptions) => Promise; @@ -401,7 +425,13 @@ export abstract class StateService { setUsernameGenerationOptions: (value: any, options?: StorageOptions) => Promise; getGeneratorOptions: (options?: StorageOptions) => Promise; setGeneratorOptions: (value: any, options?: StorageOptions) => Promise; + /** + * Gets the user's Pin, encrypted by the user symmetric key + */ getProtectedPin: (options?: StorageOptions) => Promise; + /** + * Sets the user's Pin, encrypted by the user symmetric key + */ setProtectedPin: (value: string, options?: StorageOptions) => Promise; getProviders: (options?: StorageOptions) => Promise<{ [id: string]: ProviderData }>; setProviders: (value: { [id: string]: ProviderData }, options?: StorageOptions) => Promise;