Page MenuHomePhabricator

[identity] Allow UpdateDeviceList RPC to remove devices
ClosedPublic

Authored by bartek on Apr 18 2024, 6:16 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 3, 5:55 AM
Unknown Object (File)
Oct 12 2024, 5:50 PM
Unknown Object (File)
Oct 12 2024, 5:50 PM
Unknown Object (File)
Oct 12 2024, 5:50 PM
Unknown Object (File)
Oct 12 2024, 5:50 PM
Unknown Object (File)
Oct 12 2024, 5:49 PM
Unknown Object (File)
Oct 12 2024, 5:49 PM
Unknown Object (File)
Oct 10 2024, 3:27 AM
Subscribers

Details

Summary

Updated device list validation logic. Added possibility to remove a device in UpdateDeviceList RPC.

Depends on D11686

Test Plan

Called the RPC with a few scenarios:

  • Add one device - pass
  • Add two devices - fails
  • Remove one device - pass
  • Remove two devices - fail
  • Remove primary device - fail
  • Both remove and add device - fail
  • Keep list unchanged - fail

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.Apr 19 2024, 3:41 AM
bartek added inline comments.
services/identity/src/device_list.rs
89–91 ↗(On Diff #39270)

Currently, the UpdateDeviceList RPC is used only when adding or [soon] logging out a secondary device.
In the future diffs, I'll add the possibility of e.g. replacing a secondary device with another one (replacing a keyserver when we already have one).

We don't do primary device switch with this RPC so it shouldn't be able to do this operation. There's a reason - we're switching primary device only with Identity-managed device list updates because we need to do it in sync with updating social proof for ETH users. Otherwise, we could end up with having social proof for device that is no longer the primary one.

bartek edited the test plan for this revision. (Show Details)
varun added inline comments.
services/identity/src/device_list.rs
67 ↗(On Diff #39270)
102 ↗(On Diff #39270)
This revision is now accepted and ready to land.Apr 23 2024, 5:49 PM