async fn fetch_bounded(
http: &Client,
client_id: &str,
url: &Url,
loopback: LoopbackClients,
json_only: bool,
) -> Result<Vec<u8>, ClientMetadataError>Expand description
GETs url on client_id’s behalf, under every bound resolve_client
names: FETCH_TIMEOUT for the whole fetch, MAX_DOCUMENT_BYTES for
the body, and no redirect. Only a 200 OK is read, and when json_only,
only one served as application/json.
On a deployment that reaches its own machine the fetch goes through
http, to the port didbot_identity::did::RESOLVE_PORTS names for a
loopback host when url names none. Every other deployment fetches
through a client pinned to the addresses url’s host resolves to,
refused unless every one of them is public. That is the same gate the
loopback carve-out is on, and deliberately so:
LoopbackClients::for_zone is the one place that decides which
deployments may reach their own machine.