[keyserver] Send SIGNED_IDENTITY_KEYS_BLOB request to client if data missing in DB
Summary:
In handleInitialClientSocketMessage we send SIGNED_IDENTITY_KEYS_BLOB request to native or web client if the signed_identity_keys column of the cookies table is missing for an entry with id=cookieID.
These requests will be handled on the client by nativeGetClientResponsesSelector and webGetClientResponsesSelector which will generate functions that return a Promise for an array of ClientClientResponses.
The responses will then be handled by the keyserver with the session-utils:processClientResponses(...) function... which after the next diff will include SignedIdentityKeysBlob from client response in the serverDB cookies table.
Depends on D7050
Test Plan:
- Shut down keyserver.
- Delete contents of signed_identity_keys column for all rows of cookies table. (Deleting contents for all rows wasn't necessary, but just did it anyways)
- Set breakpoint in handleInitialClientSocketMessage and restart keyserver.
- Observe that isCookieMissingSignedIdentityKeysBlob returns true and SIGNED_IDENTITY_KEYS_BLOB request is added to serverRequests.
- Set breakpoint in native/web nativeGetClientResponsesSelector/webGetClientResponsesSelector and ensure that signedIdentityKeysBlob is being generated and added to clientResponses as expected
- Set breakpoint in processClientResponses and ensure that we're getting expected response.
After next diff:
- Ensure that signedIdentityKeysBlob is valid using same checks in loginResponder and siweAuthResponder.
- Ensure that setCookieSignedIdentityKeysBlob query executes correctly and signed_identity_keys column for row with id=cookieID is correctly populated.
- Force socket to disconnect/reconnect and ensure that SIGNED_IDENTITY_KEYS_BLOB request is NOT sent from the keyserver.
Reviewers: ashoat
Reviewed By: ashoat
Differential Revision: https://phab.comm.dev/D7051