1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-23 17:02:25 +03:00

Add API to withdraw verification requirement CryptoAPI.withdrawVerificationRequirement (#4646)

* API to withdraw verification `CryptoAPi.withdrawVerificationRequirement`

* review: use set up function instead of beforeEach
This commit is contained in:
Valere
2025-01-28 11:41:37 +01:00
committed by GitHub
parent 7d8cbd6ef0
commit a2fd06bdf9
4 changed files with 81 additions and 0 deletions

View File

@@ -699,6 +699,20 @@ export class RustCrypto extends TypedEventEmitter<RustCryptoEvents, CryptoEventH
await userIdentity.pinCurrentMasterKey();
}
/**
* Implementation of {@link CryptoApi#withdrawVerificationRequirement}.
*/
public async withdrawVerificationRequirement(userId: string): Promise<void> {
const userIdentity: RustSdkCryptoJs.OtherUserIdentity | RustSdkCryptoJs.OwnUserIdentity | undefined =
await this.getOlmMachineOrThrow().getIdentity(new RustSdkCryptoJs.UserId(userId));
if (userIdentity === undefined) {
throw new Error("Cannot withdraw verification of unknown user");
}
await userIdentity.withdrawVerification();
}
/**
* Implementation of {@link CryptoApi#isCrossSigningReady}
*/