-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Specification
Authentication a node on the other side of a connection is done buy the Proxy class when a connection is made. This includes obtaining the NodeId, certificates and connection info. I assume that the certificates are authenticated at this stage. This is all the information that we need to authenticate and add a node to the node graph with the added benefit of it being obtained at the time a connection is established.
We need to add a callback to the Proxy that is triggered with the NodeId, remoteHost and remotePort information whenever a connection is made. For simplicity this will be triggered when a ForwardConnection and ReverseConnection is made. So Proxy needs to take a (remoteNodeId, remoteHost, remotePort) => void callback that is triggered whenever a connection is established and authenticated.
A new event needs to be added to the EventBus for this connection event. The handler for this event needs to call NodeManager.setNode() to add the information to the nodeGraph.
Additional context
- Proxies was updated in Refactor proxies to use the same UTP socket for external connections #360 , refactor: combined
ForwardProxyandReverseProxyintoProxy#361. Changes affect this. - Uses the same events system from Propagate root keypair changes to domains external to
KeyManager#312 CLI and Client & Agent Service test splitting #311 ? I'm not sure where it was implemented.
Tasks
- 1. Add a
connectionEstablishedCallbackto theProxythat is triggered whenever a connection is authenticated and established. - 2. Add a new event to the
eventsEventBusin thePolykeyAgentand have this triggered by the callback. - 3. Add an event handler for the new event that calls the
NodeManager.setNode()method thus adding the node to the nodeGraph. - 4. add tests for;
- Proxy triggering the callback with the correct information.
- Integration test for the
PolykeyAgentto check that the event properly propagates and updates theNodeGraph.