Documentation
¶
Overview ¶
Package safehttp builds outbound HTTP clients that refuse to connect to non-public addresses. It is shared by every feature that fetches a URL an untrusted party can influence (CIMD documents, client jwks_uri, ...).
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrBlockedAddress = errors.New("safehttp: destination address is not publicly routable")
ErrBlockedAddress is returned when a fetch would connect to a non-public address (loopback, private, link-local, CGNAT, metadata).
Functions ¶
func ClientWithDialer ¶
ClientWithDialer is NewClient with a caller-supplied dialer, so tests can substitute a resolver while keeping the same transport hardening.
func GuardedControl ¶
GuardedControl returns a net.Dialer.Control function. It runs after DNS resolution on every connection attempt, so a rebinding resolver cannot swap in a private address after validation.
func IsBlockedIP ¶
IsBlockedIP reports whether ip must never be the target of a guarded fetch.
Types ¶
This section is empty.