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

Function plaintext_gateway_metadata

crates/openshell-cli/src/run.rs:793–815  ·  view source on GitHub ↗
(
    name: &str,
    endpoint: &str,
    remote: Option<&str>,
    local: bool,
)

Source from the content-addressed store, hash-verified

791}
792
793fn plaintext_gateway_metadata(
794 name: &str,
795 endpoint: &str,
796 remote: Option<&str>,
797 local: bool,
798) -> GatewayMetadata {
799 let (remote_host, resolved_host) = remote.map_or((None, None), |dest| {
800 let ssh_host = extract_host_from_ssh_destination(dest);
801 let resolved = resolve_ssh_hostname(&ssh_host);
802 (Some(dest.to_string()), Some(resolved))
803 });
804
805 GatewayMetadata {
806 name: name.to_string(),
807 gateway_endpoint: endpoint.to_string(),
808 is_remote: plaintext_gateway_is_remote(endpoint, remote, local),
809 gateway_port: 0,
810 remote_host,
811 resolved_host,
812 auth_mode: Some("plaintext".to_string()),
813 ..Default::default()
814 }
815}
816
817fn gateway_select_with<F>(
818 name: Option<&str>,

Callers 1

gateway_addFunction · 0.85

Calls 3

resolve_ssh_hostnameFunction · 0.85

Tested by

no test coverage detected