"Fossies" - the Fresh Open Source Software Archive

Member "wire-server-2021-10-01/docs/reference/federation/pull-requests/1319_initial_federation_request_across_backends.md" (4 Oct 2021, 2634 Bytes) of package /linux/misc/wire-server-2021-10-01.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format (assuming markdown format). Alternatively you can here view or download the uninterpreted source code file. A member file download can also be achieved by clicking within a package contents listing on the according byte size field.

This PR #1319 is one small piece in the context of Federation, namely code for the first few bytes to travel from one backend to another backend. The example implemented here is exact handle search as per https://wearezeta.atlassian.net/browse/SQCORE-108

For general context about federation design, see (sorry non-Wire employees, this documentation will eventually be made available) https://github.com/wearezeta/documentation/blob/master/topics/federation/federation-design.md

This introduces the mu-haskell set of libraries as a new stack dependency to gain support in wire-server for http2 / GRPC (based on protobuf).

We make use of GRPC as a protocol as a new intra-service call internally from brig to federator (for the reverse flow from federator to brig we still use a REST API for the time being to not change too much at once), and also as a protocol between backends.

The following networking flow is implemented:

(to modify this diagram, see the swimlanes.io source)

remote_user_handle_lookup

  1. A component (e.g. 'brig') will send some data of type 'FederatedRequest' to the 'federator' server (more precisely: the 'Outward' service part of the federator) within a same private network.
  2. The federator will use the domain from the 'FederatedRequest' to discover where to send some data of type 'Request' to.
  3. On the other side, a publicly exposed 'Inward' service (also co-hosted on the federator) will turn the received 'Request' into a 'Response' by making a call to a component (e.g. brig) on its private network.

See also wire-api-federation/proto/router.proto for details of the grpc protocol.

Note: Server-server authentication is not yet implemented, so this code uses plain TCP between different backends at this point. This should be okay for the time being, since:

The core types allowing an easy extension of this code to support other requests and endpoints than the handle lookup can be found in libs/wire-server-api (notably the proto/router.proto file).