Page MenuHomePhabricator

[client-backup] implement API call to get BackupID
ClosedPublic

Authored by kamil on Aug 29 2023, 2:15 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 1, 11:39 AM
Unknown Object (File)
Sun, Oct 27, 4:09 PM
Unknown Object (File)
Sat, Oct 12, 8:21 AM
Unknown Object (File)
Sat, Oct 12, 3:16 AM
Unknown Object (File)
Sat, Oct 12, 12:55 AM
Unknown Object (File)
Sat, Oct 12, 12:42 AM
Unknown Object (File)
Sat, Oct 12, 12:26 AM
Unknown Object (File)
Sat, Oct 12, 12:11 AM
Subscribers

Details

Summary

Call without auth to get latest BackupID.

Depends on D8993

Test Plan

Call this with mock data and verify it's lastly uploaded backupID

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kamil held this revision as a draft.
kamil added inline comments.
native/backup/api.js
74 ↗(On Diff #30473)

it was generated and sent as string do we can be confident is decodable

kamil published this revision for review.Aug 29 2023, 3:17 AM
native/backup/api.js
58 ↗(On Diff #30473)

Why isn't this one authenticated?

native/backup/api.js
58 ↗(On Diff #30473)

Both "backups/latest/" endpoints (one for fetching backupID and one for fetching user keys) will be used in the primary device restoration flow.
When the primary device restores from backup we only know username and password (or eth equivalent) that user put in. But to authenticate with the identity service we need to first download userKeys and decrypt them. So we can't require authorisation for backupID and userKeys.

After decrypting userKeys the device can authenticate with the identity service. Then it can download the userData (which requires authentication).

72–75 ↗(On Diff #30473)

I might be missing something but isn't there just like response.json() method?

use json()

native/backup/api.js
72–75 ↗(On Diff #30473)

right! updating

This revision is now accepted and ready to land.Aug 29 2023, 9:08 AM