TamaOAuth.RemoteJSON (tama_oauth v0.1.0)

Copy Markdown View Source

Fetches bounded JSON documents through an SSRF-resistant network policy.

DNS answers are validated before a request is made, the connection is pinned to a validated address, and redirects are revalidated. Callers may inject a resolver and requester for tests or controlled egress environments.

Summary

Types

response()

@type response() :: %{
  body: binary(),
  document: map(),
  url: String.t(),
  cache_ttl: non_neg_integer() | nil
}

Functions

fetch(url, opts \\ [])

@spec fetch(
  term(),
  keyword()
) :: {:ok, response()} | {:error, atom()}