Page MenuHomePhabricator

[identity] Implement LogOutPrimaryDevice RPC
Needs ReviewPublic

Authored by bartek on Thu, Jun 27, 7:38 AM.
Tags
None
Referenced Files
F2143542: D12590.diff
Sat, Jun 29, 5:19 PM
Unknown Object (File)
Thu, Jun 27, 1:14 PM
Unknown Object (File)
Thu, Jun 27, 12:55 PM
Unknown Object (File)
Thu, Jun 27, 9:47 AM
Unknown Object (File)
Thu, Jun 27, 9:47 AM
Unknown Object (File)
Thu, Jun 27, 9:47 AM
Unknown Object (File)
Thu, Jun 27, 9:45 AM
Subscribers

Details

Reviewers
kamil
varun
will
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.Fri, Jun 28, 1:08 AM
bartek added inline comments.
services/identity/src/grpc_services/authenticated.rs
493

This will be done when D12526 is landed