Skip to content

Conversation

@douglas-xt
Copy link
Contributor

… recovery

Description

This PR adds support for sending public keys during account recovery. When users export their backup file, it now includes both private and public keys. During account recovery, these public keys are extracted from the backup file and forwarded to the backend, which validates that they match the account being recovered.

Related Issues

Related Pull Requests

Checklist

  • Changes have been tested locally.
  • Unit tests have been written or updated as necessary.
  • The code adheres to the repository's coding standards.
  • Relevant documentation has been added or updated.
  • No new warnings or errors have been introduced.
  • SonarCloud issues have been reviewed and addressed.
  • QA Passed

Testing Process

Additional Notes

Updated @internxt/sdk from v1.11.17 to v1.12.0. This version includes a breaking change in changePasswordWithLinkV2 the keys parameter changed from PrivateKeys to RecoveryKeys ({ private?, public? }), which allows sending public keys alongside private keys during recovery.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jan 8, 2026

Deploying drive-web with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6d990bd
Status: ✅  Deploy successful!
Preview URL: https://6b88a9d4.drive-web.pages.dev
Branch Preview URL: https://feat-send-public-keys-on-rec.drive-web.pages.dev

View logs

@douglas-xt douglas-xt self-assigned this Jan 8, 2026
@douglas-xt douglas-xt changed the title feat(recovery): send backup public keys for validation during account… [PB-5655] feat(recovery): send backup public keys for validation during account Jan 8, 2026
@douglas-xt douglas-xt force-pushed the feat/send-public-keys-on-recovery branch from 1a0901f to 59f430b Compare January 8, 2026 09:59
Comment on lines 60 to 61
ecc: user.keys?.ecc?.publicKey || '',
kyber: user.keys?.kyber?.publicKey || '',
Copy link
Collaborator

Choose a reason for hiding this comment

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

I see that if for some reason the public keys are not there, empty strings will be exported.
When attempting to send this empty string, do we notify the user?
Shouldn't we notify them if empty strings are going to be exported?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If both ecc and kyber public keys are not present, publicKeys shouldn't be exported at all. In order to keep backward compatibility, I've changed that.

});

it('should successfully update credentials with token and with backup data (ECC only)', async () => {
it('should not send keys when backup data has no publicKeys (legacy backup)', async () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

if doesn't mind, change the test that are modifying to "when X, then Y" format

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 9, 2026

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.

5 participants