relaycorp / awala-endpoint-internet

Middleware for server-side apps to communicate over Awala without implementing any of the networking or cryptography from the protocol suite.
https://docs.relaycorp.tech/awala-endpoint-internet/
GNU Affero General Public License v3.0
0 stars 0 forks source link

chore: Implement endpoint and endpoint manager #19

Closed gnarea closed 1 year ago

gnarea commented 1 year ago

Part of #17.

High-level changes

The most interesting output from this work is the ability to get the connection params, which is to be used in #8:

  // Call this from a Fastify onReady hook.
  const endpointManager = await InternetEndpointManager.init(request.mongoose);

  // Eventually when we define the route...
  fastify.route({
    method: ['GET'],
    url: '/connection-params.der',
    async handler(req, reply): Promise<FastifyReply<any>> {
      const endpoint = await endpointManager.getActiveEndpoint(); // Probably want to decorate this in `fastify`
      return reply.type(CONTENT_TYPES.DER).send(endpoint.getConnectionParams());
    },
  });
github-actions[bot] commented 1 year ago

:tada: This PR is included in version 1.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: