Current section

Files

Jump to
xberg lib xberg auth_config.ex
Raw

lib/xberg/auth_config.ex

# This file is auto-generated by alef — DO NOT EDIT.
# alef:hash:b2c29ab80fb9cdb8c5190a7808ad862ad890f416ad887092447b282a5b1b69e0
# To regenerate: alef generate
# To verify freshness: alef verify --exit-code
defmodule Xberg.AuthConfig do
@moduledoc "Authentication configuration."
@typedoc "Authentication configuration."
@type t :: term()
@typedoc "HTTP Basic authentication."
@type basic :: %{type: :basic, username: String.t(), password: String.t()}
@typedoc "Bearer token authentication."
@type bearer :: %{type: :bearer, token: String.t()}
@typedoc "Custom authentication header."
@type header :: %{type: :header, name: String.t(), value: String.t()}
def basic(username, password), do: {:basic, %{username: username, password: password}}
def bearer(token), do: {:bearer, %{token: token}}
def header(name, value), do: {:header, %{name: name, value: value}}
end