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

Function normalize_gateway_endpoint

crates/openshell-cli/src/main.rs:58–60  ·  view source on GitHub ↗

Resolve the gateway name to a [`GatewayContext`] with the gateway endpoint. Resolution priority: 1. `--gateway-endpoint` flag (direct URL, preserving metadata when available) 2. `--gateway` flag (explicit name) 3. `OPENSHELL_GATEWAY` environment variable 4. Active gateway from `~/.config/openshell/active_gateway` When `--gateway-endpoint` is provided, it is used directly as the endpoint. If stor

(endpoint: &str)

Source from the content-addressed store, hash-verified

56/// If stored metadata can still identify the gateway, the stored gateway name
57/// is preserved so auth and TLS materials continue to resolve correctly.
58fn normalize_gateway_endpoint(endpoint: &str) -> &str {
59 endpoint.trim_end_matches('/')
60}
61
62fn find_gateway_by_endpoint(endpoint: &str) -> Option<String> {
63 let endpoint = normalize_gateway_endpoint(endpoint);

Callers 1

find_gateway_by_endpointFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected