Current section

Files

Jump to
crawlberg lib crawlberg auth_config.ex
Raw

lib/crawlberg/auth_config.ex

# This file is auto-generated by alef — DO NOT EDIT.
# alef:hash:e0600612767fdd3d51e9128afdb0ffcd1fb490e9942f3839a5120ab7a4e3b658
# To regenerate: alef generate
# To verify freshness: alef verify --exit-code
defmodule Crawlberg.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