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

ffi: add high level method for resetting the user's identity and deleting all associated secrets #3759

Merged
merged 3 commits into from
Jul 30, 2024

Conversation

stefanceriu
Copy link
Member

@stefanceriu stefanceriu commented Jul 24, 2024

This PR adds support for completely resetting the user's identity and all their secrets. It will go through the following steps:

  1. Disable backing up room keys and delete the active backup
  2. Disable recovery (We can't delete account data events)
  3. Remove previously known secrets by creating a new store (?)
  4. Go through the cross-signing key reset flow
  5. Finally, re-enable key backups only if they were enabled before
  • Expose through FFI
  • See if creating a new secrets store is necessary Not needed
  • Check coverage to see if we need an OIDC specific test as well or whether the existing cross-singing tests suffice Looks good

@stefanceriu stefanceriu requested a review from poljar July 24, 2024 15:29
@stefanceriu stefanceriu force-pushed the stefan/crypto-identity-reset branch 3 times, most recently from f34d738 to 9b4bf7d Compare July 25, 2024 12:54
@stefanceriu stefanceriu marked this pull request as ready for review July 25, 2024 13:18
@stefanceriu stefanceriu requested a review from a team as a code owner July 25, 2024 13:18
Copy link

codecov bot commented Jul 25, 2024

Codecov Report

Attention: Patch coverage is 83.33333% with 3 lines in your changes missing coverage. Please review.

Project coverage is 84.09%. Comparing base (6fca1e8) to head (8895e53).
Report is 8 commits behind head on main.

Files Patch % Lines
crates/matrix-sdk/src/encryption/recovery/mod.rs 83.33% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3759      +/-   ##
==========================================
+ Coverage   84.07%   84.09%   +0.01%     
==========================================
  Files         259      259              
  Lines       27080    27098      +18     
==========================================
+ Hits        22767    22787      +20     
+ Misses       4313     4311       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@stefanceriu stefanceriu force-pushed the stefan/crypto-identity-reset branch 2 times, most recently from 35c86ad to c47ac22 Compare July 29, 2024 06:08
crates/matrix-sdk/src/encryption/recovery/mod.rs Outdated Show resolved Hide resolved
crates/matrix-sdk/src/encryption/recovery/mod.rs Outdated Show resolved Hide resolved
crates/matrix-sdk/src/encryption/recovery/mod.rs Outdated Show resolved Hide resolved
crates/matrix-sdk/src/encryption/recovery/mod.rs Outdated Show resolved Hide resolved
crates/matrix-sdk/src/encryption/recovery/mod.rs Outdated Show resolved Hide resolved
crates/matrix-sdk/src/encryption/recovery/mod.rs Outdated Show resolved Hide resolved
@stefanceriu stefanceriu requested a review from poljar July 29, 2024 13:00
@stefanceriu stefanceriu changed the title Add high level method for resetting the user's identity and deleting all associated secrets ffi: add high level method for resetting the user's identity and deleting all associated secrets Jul 30, 2024
Copy link
Contributor

@poljar poljar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, this looks good. Feel free to get rid of the fixup commits and merge.

@stefanceriu stefanceriu force-pushed the stefan/crypto-identity-reset branch from 68ea42b to ef2140d Compare July 30, 2024 09:44
@stefanceriu stefanceriu enabled auto-merge July 30, 2024 09:45
…ication

- disable backups and recovery before requesting the reset handle
- attempt device key upload
- re-enable backups both when UIAA is required and when not
@stefanceriu stefanceriu force-pushed the stefan/crypto-identity-reset branch from ef2140d to 8895e53 Compare July 30, 2024 10:13
@stefanceriu stefanceriu merged commit f51eebb into main Jul 30, 2024
40 checks passed
@stefanceriu stefanceriu deleted the stefan/crypto-identity-reset branch July 30, 2024 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants