Skip to main content

safe_client

Function safe_client 

Source
pub fn safe_client(
    policy: &SsrfPolicy,
    timeout: Duration,
) -> Result<Client, AcdpError>
Expand description

Build a reqwest::Client hardened against SSRF for outbound POSTs to operator-configured endpoints (webhook delivery, federation feeds).

Every resolved IP is filtered through policy at DNS time via SafeDnsResolver — defeating DNS rebinding (RFC-ACDP-0008 §4.8) — and redirects are refused outright: such an endpoint must respond directly, not bounce the registry to an internal host (e.g. cloud IMDS). connect and request timeouts are bounded. Use SsrfPolicy::default in production and SsrfPolicy::allow_test_loopback in tests that POST to a local listener.