Short-lived localhost HTTP server for the Codex browser OAuth callback (ADR 0002).
Binds 127.0.0.1:1455 by default, accepts a single /auth/callback request, validates
the OAuth state, and returns the authorization code. The registered redirect URI
uses localhost (Pi/Codex convention) even though the listener binds to loopback.
Summary
Functions
Close the listen socket.
Start listening for one browser callback. Accepts :host, :port (testing).
Registered OAuth redirect URI for the browser flow.
Accept one callback connection and return the authorization code.
Types
@type listen_socket() :: port()
Functions
@spec close(listen_socket()) :: :ok
Close the listen socket.
@spec listen(keyword()) :: {:ok, listen_socket()} | {:error, map()}
Start listening for one browser callback. Accepts :host, :port (testing).
@spec redirect_uri() :: String.t()
Registered OAuth redirect URI for the browser flow.
@spec wait_for_callback( listen_socket(), keyword() ) :: {:ok, String.t()} | {:error, map()}
Accept one callback connection and return the authorization code.
Options: :state (required), :timeout_ms (default 15 min).