Resolve-and-pin egress policy for MCP OAuth HTTP requests.
An endpoint must use an installed origin. Every candidate address is classified before connection; one denied address rejects the complete DNS answer. Callers race the returned addresses while preserving the original hostname and verify the connected peer against the same approved set before sending request bytes.
Summary
Functions
Returns whether an endpoint uses an origin installed for the authority.
Builds a connected-peer verifier for one approved DNS answer.
Types
@type address() :: :inet.ip_address()
Functions
@spec endpoint_allowed?(binary(), PtcRunner.Kernel.MCPOAuth.Authority.t()) :: boolean()
Returns whether an endpoint uses an origin installed for the authority.
Builds a connected-peer verifier for one approved DNS answer.
@spec resolve(binary(), PtcRunner.Kernel.MCPOAuth.Authority.t(), keyword()) :: {:ok, %{ addresses: [address()], hostname: binary(), port: :inet.port_number(), origin: binary() }} | {:error, :egress_denied | :name_not_resolved | :resolution_failed}