Page MenuHomePhabricator

[lib] Add function to verify device lists
ClosedPublic

Authored by bartek on May 8 2024, 12:03 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 3, 4:42 AM
Unknown Object (File)
Fri, Nov 1, 10:17 PM
Unknown Object (File)
Oct 11 2024, 5:07 PM
Unknown Object (File)
Oct 11 2024, 5:07 PM
Unknown Object (File)
Oct 11 2024, 5:07 PM
Unknown Object (File)
Oct 11 2024, 5:06 PM
Unknown Object (File)
Oct 11 2024, 5:06 PM
Unknown Object (File)
Aug 29 2024, 5:45 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
No Lint Coverage
Unit
No Test Coverage

Event Timeline

bartek held this revision as a draft.
bartek published this revision for review.May 8 2024, 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.May 10 2024, 4:04 AM

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

This revision was automatically updated to reflect the committed changes.