Pristine.OAuth2.CallbackServer (Pristine v0.3.1)

Copy Markdown View Source

Exact loopback callback capture for interactive OAuth flows.

Summary

Types

callback_result()

@type callback_result() ::
  {:ok, %{code: String.t(), request_uri: String.t(), state: String.t() | nil}}
  | {:error, Pristine.OAuth2.Error.t()}

redirect_target()

@type redirect_target() :: %{
  redirect_uri: String.t(),
  host: String.t(),
  ip: :inet.ip_address(),
  path: String.t(),
  port: pos_integer(),
  scheme: String.t()
}

t()

@type t() :: %Pristine.OAuth2.CallbackServer{pid: pid(), redirect_uri: String.t()}

Functions

await(server, timeout_ms)

@spec await(t(), timeout()) :: callback_result()

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

loopback_redirect_uri?(redirect_uri)

@spec loopback_redirect_uri?(String.t()) :: boolean()

start(redirect_uri, opts \\ [])

@spec start(String.t(), keyword()) :: {:ok, t()} | {:error, Pristine.OAuth2.Error.t()}

stop(callback_server)

@spec stop(t()) :: :ok