HomePhabricator
Diffusion Comm 93732b264eeb

[lib] Add httpMessageUserInfosHandler

Description

[lib] Add httpMessageUserInfosHandler

Summary:
issue: ENG-7821
This function will be called on the result of fetch in callSingleKeyserverEndpoint
Responders return values which are validated on the keyserver side inside the responder functions created by createJSONResponder. The validated response is then returned to either:

  • handleAPIRequestClientSocketMessage in case of socket requests
  • jsonHandler in case of http requests

Following what those functions do with the result, we can tell what fields are being appended before being sent to the client. Those fields are: success, cookieChange, and in the case of an exception: error and payload.
But none of the fields have to be added. So we add those fields to the validator as optional

Test Plan: Tested with the next diff - called this function on the result of fetch and checked that user ids are correctly extracted from respones

Reviewers: tomek, kamil

Reviewed By: tomek

Subscribers: ashoat

Differential Revision: https://phab.comm.dev/D12072

Details

Provenance
inkaAuthored on May 16 2024, 6:37 AM
Reviewer
tomek
Differential Revision
D12072: [lib] Add httpMessageUserInfosHandler
Parents
rCOMMc9dc7ed65003: [lib] Extract user ids from server socket messages
Branches
Unknown
Tags
Unknown