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

Function is_known_metadata_hostname

crates/openshell-prover/src/queries.rs:61–64  ·  view source on GitHub ↗

Return true for static cloud metadata hostnames that should be treated like link-local metadata reach without performing DNS resolution.

(host: &str)

Source from the content-addressed store, hash-verified

59/// Return true for static cloud metadata hostnames that should be treated like
60/// link-local metadata reach without performing DNS resolution.
61pub(crate) fn is_known_metadata_hostname(host: &str) -> bool {
62 let normalized = host.trim().trim_end_matches('.').to_ascii_lowercase();
63 matches!(normalized.as_str(), "metadata.google.internal")
64}
65
66fn is_link_local_or_metadata_host(host: &str) -> bool {
67 is_link_local(host) || is_known_metadata_hostname(host)

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected