Page MenuHomePhabricator

[identity] Implement LogOutPrimaryDevice RPC
ClosedPublic

Authored by bartek on Jun 27 2024, 7:38 AM.
Tags
None
Referenced Files
F3342082: D12590.diff
Fri, Nov 22, 12:24 AM
Unknown Object (File)
Tue, Nov 19, 9:40 PM
Unknown Object (File)
Fri, Nov 8, 10:36 PM
Unknown Object (File)
Fri, Nov 8, 1:30 PM
Unknown Object (File)
Fri, Nov 8, 12:23 PM
Unknown Object (File)
Fri, Nov 8, 12:23 PM
Unknown Object (File)
Fri, Nov 8, 12:23 PM
Unknown Object (File)
Sep 25 2024, 9:33 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
No Lint Coverage
Unit
No Test Coverage

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