[identity] Implement RPC to log out secondary device
Summary:
Implementation of the RPC described in D12119. Details and linked issues there.
This RPC needs to:
- Verify if the device is on the device list
- Clear device CSAT
- Clear device data (prekeys etc)
- Clear OTKs
Depends on D12119
Test Plan:
- Registered a user (Identity-auto created device list with primary device).
- Logged in with a second device (secondary device added to the list)
- Called the RPC on the secondary device
- Confirmed that CSAT as well as device keys were cleared by viewing DDB tables
- Confirmed that the device ID still exists on the device list
Also confirmed that the RPC fails:
- If the device is not on the device list
- If the device is a primary device
Reviewers: varun, will, kamil
Reviewed By: kamil
Subscribers: ashoat, tomek
Differential Revision: https://phab.comm.dev/D12120