FusionAuth (FusionAuth v0.3.0) View Source

The FusionAuth module provides functions for building a dynamic HTTP client as well as standardizing the responses returned from the FusionAuth API.

Examples

iex> FusionAuth.client("http://localhost:9011", "sQ9wwELaI0whHQqyQUxAJmZvVzZqUL-hpfmAmPgbIu8", "6b40f9d6-cfd8-4312-bff8-b082ad45e93c")
%Tesla.Client{
  adapter: {Tesla.Adapter.Hackney, :call, [[recv_timeout: 30000]]},
  fun: nil,
  post: [],
  pre: [
    {Tesla.Middleware.BaseUrl, :call, ["http://localhost:9011"]},
    {Tesla.Middleware.JSON, :call, [[]]},
    {Tesla.Middleware.Headers, :call,
    [
      [
        {"Authorization", "sQ9wwELaI0whHQqyQUxAJmZvVzZqUL-hpfmAmPgbIu8"},
        {"X-FusionAuth-TenantId", "6b40f9d6-cfd8-4312-bff8-b082ad45e93c"}
      ]
    ]}
  ]
}

Link to this section Summary

Functions

Builds a dynamic client for executing HTTP requests to the FusionAuth API using Application variables specified in config/{env}.exs.

Builds a dynamic client for executing HTTP requests to the FusionAuth API based on runtime arguments.

Standardizes the response to be returned from the FusionAuth API request.

Link to this section Types

Specs

client() :: Tesla.Client.t()

Specs

result() :: {:ok, map() | String.t(), Tesla.Env.t()} | {:error, map(), any()}

Link to this section Functions

Specs

client() :: client()

Builds a dynamic client for executing HTTP requests to the FusionAuth API using Application variables specified in config/{env}.exs.

  config :fusion_auth,
    api_key: "FUSION_AUTH_API_KEY",
    api_url: "FUSION_AUTH_URL",
    tenant_id: "FUSION_AUTH_TENANT_ID"
Link to this function

client(base_url, api_key, tenant_id)

View Source

Specs

client(String.t(), String.t(), String.t()) :: client()

Builds a dynamic client for executing HTTP requests to the FusionAuth API based on runtime arguments.

Specs

result({:ok, Tesla.Env.t()}) :: result()
result({:ok, Tesla.Env.t()}) :: result()
result({:error, any()}) :: result()

Standardizes the response to be returned from the FusionAuth API request.