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)
Wed, Jun 19, 3:15 PM
Unknown Object (File)
Thu, Jun 13, 8:38 PM
Unknown Object (File)
Wed, Jun 12, 9:53 PM
Unknown Object (File)
Wed, Jun 12, 4:52 AM
Unknown Object (File)
Wed, Jun 12, 4:34 AM
Unknown Object (File)
Sun, May 26, 9:23 AM
Unknown Object (File)
May 19 2024, 9:09 AM
Unknown Object (File)
May 19 2024, 9:09 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