fidius-host::executor::name_lookup
Rust
Resolve-and-pin for wasi:sockets name lookups (FIDIUS-I-0034).
fidius shadows wasi:sockets/ip-name-lookup in the linker (after
add_to_linker_sync, with allow_shadowing(true)) with this module’s
implementation, which:
- consults
EgressPolicy::authorize_dnsbefore resolving — a denial fails the guest’s lookup withpermanent-resolver-failure(the same error upstream returns for a lookup denied outright), resolves nothing, and pins nothing; - resolves host-side (std
ToSocketAddrs, matching upstream, unless a test injects a resolver); and - records
name ↔ IPsin a per-storePinTableinside the blocking resolution task — the pin is written before the future completes, so no address ever reaches the guest un-pinned.
socket_addr_check then recovers the dialed name for a connect’s IP from
the pin table and hands the policy a TcpTarget { host: Some(name), .. }.
The shadow is installed only under the same two-key condition that enables
name lookup at all (a tcp/udp grant AND an embedder policy); otherwise
upstream’s implementation stands untouched.