Skip to content

Commit

Permalink
CryptoSetupExtensions: deprecate unused getDehydrationKeyCallback (#46
Browse files Browse the repository at this point in the history
)

As of matrix-org/matrix-react-sdk#12919, getDehydrationKeyCallback is unused
  • Loading branch information
richvdh authored Aug 27, 2024
1 parent 42eea76 commit a4b4a93
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/lifecycles/CryptoSetupExtensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ export interface ProvideCryptoSetupExtensions {
createSecretStorageKey(): Uint8Array | null;
catchAccessSecretStorageError(e: Error): void;
setupEncryptionNeeded: (args: CryptoSetupArgs) => boolean;
/** @deprecated This callback is no longer used by matrix-react-sdk */
getDehydrationKeyCallback():
| ((keyInfo: SecretStorageKeyDescription, checkFunc: (key: Uint8Array) => void) => Promise<Uint8Array>)
| null;
Expand All @@ -128,9 +129,14 @@ export abstract class CryptoSetupExtensionsBase implements ProvideCryptoSetupExt
public abstract createSecretStorageKey(): Uint8Array | null;
public abstract catchAccessSecretStorageError(e: Error): void;
public abstract setupEncryptionNeeded(args: CryptoSetupArgs): boolean;
public abstract getDehydrationKeyCallback():

/** `getDehydrationKeyCallback` is no longer used; we provide an empty impl for type compatibility. */
public getDehydrationKeyCallback():
| ((keyInfo: SecretStorageKeyDescription, checkFunc: (key: Uint8Array) => void) => Promise<Uint8Array>)
| null;
| null {
return null;
}

public abstract SHOW_ENCRYPTION_SETUP_UI: boolean;
}

Expand All @@ -143,9 +149,8 @@ export interface CryptoSetupArgs {
/**
*
* The default/empty crypto-extensions
* Can (and will) be used if none of the modules has an implementaion of IProvideCryptoSetupExtensions
*
* */
* Can (and will) be used if none of the modules has an implementation of {@link ProvideCryptoSetupExtensions}.
*/
export class DefaultCryptoSetupExtensions extends CryptoSetupExtensionsBase {
public SHOW_ENCRYPTION_SETUP_UI = true;

Expand Down Expand Up @@ -178,7 +183,6 @@ export class DefaultCryptoSetupExtensions extends CryptoSetupExtensionsBase {
public getDehydrationKeyCallback():
| ((keyInfo: SecretStorageKeyDescription, checkFunc: (key: Uint8Array) => void) => Promise<Uint8Array>)
| null {
console.log("Default empty getDehydrationKeyCallback() => null");
return null;
}
}

0 comments on commit a4b4a93

Please sign in to comment.