Page MenuHomePhabricator

[native] implement Restore protocol for Signed Device List
ClosedPublic

Authored by kamil on Thu, Dec 5, 4:39 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Dec 19, 1:33 AM
Unknown Object (File)
Wed, Dec 18, 7:21 PM
Unknown Object (File)
Wed, Dec 18, 9:14 AM
Unknown Object (File)
Wed, Dec 18, 8:41 AM
Unknown Object (File)
Tue, Dec 17, 1:03 PM
Unknown Object (File)
Tue, Dec 17, 8:08 AM
Unknown Object (File)
Tue, Dec 17, 5:05 AM
Unknown Object (File)
Mon, Dec 16, 1:46 AM
Subscribers

Details

Summary

ENG-8195.

This is a generic hook, used for both password and wallet users.

Do all the steps without what's marked with a red line at the bottom (this is the Full Backup version, not ready yet):

Screenshot 2024-12-06 at 11.11.25.png (1×615 px, 213 KB)

For the Signed Device Lists, we also need this part:

image.png (69×543 px, 13 KB)

It's tracked in ENG-8200

Depends on D14081

Test Plan

Flow, logic tested later in the stack

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

kamil held this revision as a draft.
kamil retitled this revision from [native] implement hook for restore protocol to [native] implement Restore protocol for Signed Device List.Fri, Dec 6, 1:34 AM
kamil published this revision for review.Fri, Dec 6, 2:15 AM
kamil edited the summary of this revision. (Show Details)
kamil edited the summary of this revision. (Show Details)
native/account/restore.js
54–55

retrieveLatestBackupInfo also returns siweBackupData, for SIWE, we want this before running this hook (we need to sign this message to get a signature, which is used as a secret here). We might want to move this call earlier and pass userID and backupID as params to avoid calling retrieveLatestBackupInfo twice, but this could be done later when the full restore flow is ready.

native/account/restore.js
35

Nit

tomek added inline comments.
native/account/restore.js
21–27

How about making it typed more strongly by requiring that message and signature are present for SIWE?

{type:'password', username: string, password: string} | {type:'siwe', address: string, secret: string, message: string, signature:string}?

This revision is now accepted and ready to land.Wed, Dec 11, 2:38 AM
native/account/restore.js
21–27

As discussed in the office, I am going to leave it as it is, and if needed,d @tomek will update this when connected this with UI