Page MenuHomePhabricator

[lib] Add function to verify device lists
ClosedPublic

Authored by bartek on Wed, May 8, 12:03 AM.
Tags
None
Referenced Files
F1789376: D11929.id40066.diff
Sun, May 19, 3:05 AM
Unknown Object (File)
Sat, May 18, 4:39 PM
Unknown Object (File)
Fri, May 17, 12:05 PM
Unknown Object (File)
Wed, May 15, 9:19 PM
Unknown Object (File)
Wed, May 15, 1:18 PM
Unknown Object (File)
Wed, May 15, 1:05 PM
Unknown Object (File)
Tue, May 14, 9:18 PM
Unknown Object (File)
Tue, May 14, 3:06 PM
Subscribers

Details

Summary

Added function that verifies device lists timestamps and signatures on client side - Whitepaper 6.2.4
Now, we use Identity Service as a source of truth for device list updates.
Signatures are optional at this point, unsigned lists should still be accepted.

Depends on D11901, D11907

Test Plan

Added unit tests in D11930. More detailed plan will be performed when the function is used.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bartek held this revision as a draft.
bartek published this revision for review.Wed, May 8, 11:51 PM
lib/shared/device-list-utils.js
10–23 ↗(On Diff #39911)

Should we make all of these fields read-only by prefixing them with a +? (eg. { +valid: true })

Instead of calling JSON.parse to get RawDeviceList I would extract code parsing code with asserting from here to a separate function and use it here in all call sites.

This revision is now accepted and ready to land.Fri, May 10, 4:04 AM

Make types read-only. Extract function to parse raw device list.

This revision was automatically updated to reflect the committed changes.