[identity] Implement RestoreUser RPCs
Summary:
Address ENG-8212.
Implemented RPCs for backup restore. Added this all in one diff because the RPC calls existing code in sequence
and the whole flow is more obvious.
Test Plan:
Registered a password and a wallet user. Verified that for both:
- RPC fails if username/wallet address not found (cannot get user ID)
- Fails if nonce / SIWE verification fails
- The RPC verifies the device list (the last test case from D13222 is the only valid one)
- The RPC updates device list and sets new primary device
- The RPC performs device key upload
- The RPC removes all old devices' data, OTKs and access tokens
- The RPC returns new CSAT
- For wallet users, social proof is updated in DDB
Reviewers: varun, kamil
Reviewed By: varun
Subscribers: ashoat, tomek
Differential Revision: https://phab.comm.dev/D13226