Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expanding connectionInfoGetter functionality #355

Closed
5 tasks
tegefaulkes opened this issue Feb 28, 2022 · 4 comments
Closed
5 tasks

Expanding connectionInfoGetter functionality #355

tegefaulkes opened this issue Feb 28, 2022 · 4 comments
Assignees
Labels
development Standard development r&d:polykey:core activity 4 End to End Networking behind Consumer NAT Devices

Comments

@tegefaulkes
Copy link
Contributor

tegefaulkes commented Feb 28, 2022

Specification

We need to expand the functionality of connectionInfoGet to obtain the connection directly from the GRPCServer in the case where we are connecting directly to the GRPCServer instead of via the proxies.

So if the GRPCServer is secured we obtain the connection information from the GRPCServer. This can also be undefined

if (grpcServer.secured) {
  const certs = grpcServer.getClientCertificates(session);
  // process the certs
} else {
  const connInfo = revProxy.getConnectionInfoByEgress(host, port);
  // process the connInfo
}

The session can possiby be obtained via but this will need to be verified.

/**
 * Acqure the HTTP2 session for a GRPC connection from the server side
 * This relies on monkey patching the gRPC library internals
 * The `ServerSurfaceCall` is expected to be an instance of `Http2ServerCallStream`
 * It will contain `stream` property, which will contain the `session` property
 */
function getServerSession(
  call: ServerSurfaceCall
): Http2Session {
  // @ts-ignore
  return call.stream.session;
}

This may need to be speced out further.

Additional context

Tasks

  • expand connectionInfoGetter's functionality to obtain the relevant connection info directly from the RPCServer if it is secured.
  • 2. Update tests to test
    • getting connection info when connection through proxies
    • getting connection info when connecting securly and directly to GRPCServer
    • getting connection info when connection insecurly directly to GRPCServer
@CMCDragonkai
Copy link
Member

Also suggesting to change to authenticateTLS. But if the function ultimately returns ConnectionInfo type even by acquiring the information from GRPC server, then the name can remain.

@CMCDragonkai
Copy link
Member

With the new RPC server structure, this function is no longer relevant.

Instead every RPC handler would be expected to take a record of properties.

These properties can include the connecting stream, the remote peer information, the context (including signal and timer), the IOC container for service locating our singleton instances.

@tegefaulkes
Copy link
Contributor Author

This issue was to add the ability to obtain the connection data from the GRPC connection itself. It was needed if we ever did an agent - agent connection directly without a proxy since this information was obtained from the proxy.

With the new RPC we won't be using a proxy. The connection data will be obtained from the QUIC system in this case. This essentially makes this issue irrelevant now. I think we should just close it.

@CMCDragonkai
Copy link
Member

Ok as long as the content of #355 (comment) is being addressed in the PR.

@CMCDragonkai CMCDragonkai closed this as not planned Won't fix, can't repro, duplicate, stale Jan 9, 2023
@CMCDragonkai CMCDragonkai added the r&d:polykey:core activity 4 End to End Networking behind Consumer NAT Devices label Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development Standard development r&d:polykey:core activity 4 End to End Networking behind Consumer NAT Devices
Development

No branches or pull requests

2 participants