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)
Sun, Dec 22, 10:49 PM
Unknown Object (File)
Sat, Dec 21, 9:55 PM
Unknown Object (File)
Fri, Dec 20, 11:41 PM
Unknown Object (File)
Fri, Dec 20, 10:20 AM
Unknown Object (File)
Fri, Dec 20, 10:00 AM
Unknown Object (File)
Fri, Dec 20, 9:39 AM
Unknown Object (File)
Fri, Dec 20, 9:30 AM
Unknown Object (File)
Fri, Dec 20, 4:24 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
Branch
land-restore
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 ↗(On Diff #46226)

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 ↗(On Diff #46226)

Nit

tomek added inline comments.
native/account/restore.js
21–27 ↗(On Diff #46226)

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 ↗(On Diff #46226)

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