Ueberauth.Strategy.Cognito.HttpClient behaviour (Ueberauth Cognito v0.6.0)

View Source

Minimal Mint-based HTTP client used by the Cognito strategy.

Defines the strategy's http_client contract as a behaviour and is its default implementation: request/2 and request/4 return {:ok, status, headers, body} on a completed response, or {:error, reason}.

The whole request — connecting included — is bounded by an overall deadline, 30 seconds by default:

config :ueberauth_cognito, request_timeout: 10_000

Summary

Types

headers()

@type headers() :: [{binary(), binary()}]

response()

@type response() :: {:ok, status(), headers(), binary()} | {:error, term()}

status()

@type status() :: non_neg_integer()

Callbacks

request(method, url)

@callback request(method :: atom(), url :: binary()) :: response()

request(method, url, headers, body)

@callback request(method :: atom(), url :: binary(), headers(), body :: iodata()) ::
  response()