-
-
Notifications
You must be signed in to change notification settings - Fork 604
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
Add CryptoApi.resetEncryption
#4614
base: develop
Are you sure you want to change the base?
Conversation
CryptoApi#resetEncryption
CryptoApi.resetEncryption
f99e069
to
4029eee
Compare
18fb6e6
to
b033611
Compare
b033611
to
c1462b7
Compare
c1462b7
to
dbb5c0f
Compare
dbb5c0f
to
0420edf
Compare
0420edf
to
6ea0cd1
Compare
6ea0cd1
to
dbd54dc
Compare
dbd54dc
to
9f87c04
Compare
9f87c04
to
be9f401
Compare
be9f401
to
d4e01c9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it does what it says it does!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generally looks good, a few nits, mostly around the tests
// We consider the key backup as trusted | ||
jest.spyOn(RustBackupManager.prototype, "isKeyBackupTrusted").mockResolvedValue({ | ||
trusted: true, | ||
matchesDecryptionKey: true, | ||
}); | ||
|
||
const rustCrypto = await makeTestRustCrypto(makeMatrixHttpApi(), undefined, undefined, secretStorage); | ||
// We have a key backup | ||
expect(await rustCrypto.getActiveSessionBackupVersion()).not.toBeNull(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it might be good to collect all the fetchMock
calls together, rather than having this in the middle?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't get it, sorry. rustCrypto.getActiveSessionBackupVersion()
is not a fetchMock
// We consider the key backup as trusted | ||
jest.spyOn(RustBackupManager.prototype, "isKeyBackupTrusted").mockResolvedValue({ | ||
trusted: true, | ||
matchesDecryptionKey: true, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this used before or after the reset?
Can we not use the actual backup data in the response to /_matrix/client/v3/room_keys/version
so we don't need to mock this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's used before the reset in order to have a trusted backup.
I suppose there is a better way to have a trusted backup returned by /_matrix/client/v3/room_keys/version
?
The backup returned by /_matrix/client/v3/room_keys/version
is not trusted in the test.
Checklist
public
/exported
symbols have accurate TSDoc documentation.Task element-hq/element-web#28977
Require #4615
Add
CryptoApi.resetEncryption
.The goal of this new api is to give an easy to reset the current encryption state of the user: