[keyserver] implement socket and update code to interact with Tunnelbroker API
Summary:
- Updates old code to new API
- Implement Socket
- Remove old types
There is some code duplication with what's in lib/. I'll try to refactor this later.
Looks like RefreshKeyRequest is defined not properly in Rust codebase, should not be a separate message but part of MessageToDevice. I'll fix that as followup - shouldn't affect this code.
Depends on D9596
Test Plan:
- Check if the keyserver can connect to Tunnelbroker
- Check if the socket is properly closed when eg. Tunnelbroker is killed
- Check if socket issues don't cause the keyserver to crash
- Send RefreshKeyRequest and verify on keyserver and Identity logs that it is properly processed
- Kill keyserver, send RefreshKeyRequest, launch keyserver and check if the message was delivered and processed.
Reviewers: michal, bartek, varun
Reviewed By: michal
Subscribers: ashoat, tomek, wyilio
Differential Revision: https://phab.comm.dev/D9623