Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CryptoSetupExtensions: deprecate unused getDehydrationKeyCallback #46

Merged
merged 2 commits into from
Aug 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}
}
Loading