Skip to main content

Module network

Module network 

Source
Expand description

Network — outbound requests, and whether they may leave.

Every client in the engine builds its requests through this. What a host can replace today is narrower: the provider a tool uses arrives through ToolContext.exec, while the model, OAuth, telemetry and registry clients each construct their own. Their traffic is Origin::Operator, which no policy restricts, so the behavior is right — but auditing or going offline as a whole needs an injection point that does not exist yet.

Structs§

HttpRequest
HttpResponse
HttpStream
A response whose body has not been read yet.

Enums§

Origin
Who chose this destination.

Constants§

DEFAULT_MAX_REDIRECTS
How many redirects a provider follows when the caller does not say.

Traits§

Network
Every outbound request, in one place.

Functions§

carried_v4
The IPv4 address an IPv6 one is a way of reaching: mapped (::ffff:a.b.c.d), SIIT (::ffff:0:a.b.c.d), compatible (::a.b.c.d), NAT64 (64:ff9b::/96, and the local-use 64:ff9b:1::/48 with the address in its last 32 bits), 6to4 (2002::/16) and Teredo’s client (2001::/32, stored inverted).
domain_key
A web.allowed_domains entry or a host, in the form domains_name_host compares them in.
domains_name_host
Whether ip is this machine or a network behind it rather than the public internet: unspecified, loopback, private, link-local, carrier-grade NAT, unique-local, site-local, multicast and the reserved blocks, and an IPv6 address that carries one of those IPv4 ones (mapped, compatible, NAT64, 6to4).
is_internal_address
The one answer to “may a destination chosen from outside reach this”, for a model-directed fetch and an HTTP hook alike.
names_loopback
Whether a web.allowed_domains entry names this machine’s loopback: localhost or a loopback address.