Package-level declarations

Types

Link copied to clipboard

Small, dependency-free URL policy helpers shared by the protocol plugins.

Link copied to clipboard

SSRF guard for outbound HTTP requests whose target host is derived from untrusted input — e.g. a did:web identifier (did:web:example.com → https://example.com/...) or an OID4VP/OID4VCI request_uri / credential_offer_uri.

Link copied to clipboard
object SsrfBlockingDns : Dns

An OkHttp Dns that refuses to resolve any host mapping to an internal address (loopback, private, link-local, cloud-metadata, IPv6-ULA — see PrivateNetworkGuard).

Link copied to clipboard

Transport-security policy for operator-configured endpoints: blockchain RPC nodes, resolver services, and anything else whose URL comes from deployment configuration rather than from an untrusted document.

Properties

Link copied to clipboard

Default cap for protocol response bodies (1 MiB).

Functions

Link copied to clipboard
fun Response.readBodyBounded(maxBytes: Long = DEFAULT_MAX_RESPONSE_BODY_BYTES): String?

Reads the response body as UTF-8 text, failing with IOException if it exceeds maxBytes rather than buffering an unbounded body. Returns null when the response has no body. The response is always closed.

Link copied to clipboard
fun ssrfGuardedOkHttpClient(): OkHttpClient

A default OkHttpClient hardened for fetching attacker-influenced URLs: it blocks internal hosts via SsrfBlockingDns (names) and a connect-time PrivateNetworkGuard check (IP literals, and every redirect hop), ignores system proxies, and bounds every call with timeouts (defeating slow-loris / hung reads). Callers that need different behaviour can inject their own client.