MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / grpc_client

Function grpc_client

crates/openshell-cli/src/tls.rs:437–441  ·  view source on GitHub ↗

Build a gRPC [`OpenShellClient`]. When `tls.edge_token` is set, the returned client is wrapped with an interceptor that injects authentication headers on every request. Otherwise, standard mTLS is used (interceptor is a no-op).

(server: &str, tls: &TlsOptions)

Source from the content-addressed store, hash-verified

435/// interceptor that injects authentication headers on every request.
436/// Otherwise, standard mTLS is used (interceptor is a no-op).
437pub async fn grpc_client(server: &str, tls: &TlsOptions) -> Result<GrpcClient> {
438 let channel = build_channel(server, tls).await?;
439 let interceptor = interceptor_from_tls(tls)?;
440 Ok(OpenShellClient::with_interceptor(channel, interceptor))
441}
442
443fn interceptor_from_tls(tls: &TlsOptions) -> Result<EdgeAuthInterceptor> {
444 EdgeAuthInterceptor::new(tls.oidc_token.as_deref(), tls.edge_token.as_deref())

Callers 15

ssh_session_configFunction · 0.85
sandbox_connect_editorFunction · 0.85
sandbox_ssh_proxyFunction · 0.85
gateway_statusFunction · 0.85
gateway_reachableFunction · 0.85
sandbox_createFunction · 0.85
sandbox_getFunction · 0.85
sandbox_exec_grpcFunction · 0.85
service_forward_tcpFunction · 0.85
sandbox_listFunction · 0.85
sandbox_provider_listFunction · 0.85
sandbox_provider_attachFunction · 0.85

Calls 2

build_channelFunction · 0.85
interceptor_from_tlsFunction · 0.85