Page MenuHomePhabricator

[identity] Implement LogOutPrimaryDevice RPC
ClosedPublic

Authored by bartek on Jun 27 2024, 7:38 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 23, 3:28 PM
Unknown Object (File)
Mon, Dec 23, 3:28 PM
Unknown Object (File)
Mon, Dec 23, 3:28 PM
Unknown Object (File)
Mon, Dec 23, 3:27 PM
Unknown Object (File)
Mon, Dec 23, 3:27 PM
Unknown Object (File)
Mon, Dec 23, 4:16 AM
Unknown Object (File)
Wed, Dec 11, 8:22 PM
Unknown Object (File)
Fri, Dec 6, 7:39 PM
Subscribers

Details

Summary

Implemented the RPC for primary device logout. It:

  • Verifies if the RPC is called by a primary device
  • Validates received device list: if it is a singleton of the primary device
  • Applies the updated device list
  • Revokes user device's CSATs
  • Removes devices' data and OTKs

Depends on D12571, D12589

Test Plan

Created a user with a few devices. Used function from D12586 to call this RPC:

  • It failed when called from secondary device
  • It failed when deliberately malformed the device list payload or used a different device ID
  • It succeeded when called from primary device. Verified DDB:
    • Users table item was still there
    • Devices table contained the singleton device list. No device data was present
    • OTKs and tokens were gone

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.Jun 28 2024, 1:08 AM
bartek added inline comments.
services/identity/src/grpc_services/authenticated.rs
493 ↗(On Diff #41758)

This will be done when D12526 is landed

This revision is now accepted and ready to land.Jul 1 2024, 3:12 AM
services/identity/src/grpc_services/authenticated.rs
493 ↗(On Diff #41758)

Addressed in D12649