Rivet.Auth.Access (rivet_ident v3.5.0)

View Source

Validation of tokens for accessing site (after refresh)

Note: this is the start of the next iteration, and it will replace Rivet.Auth.Token

Summary

Functions

iex> alias Rivet.Auth iex> check([""], %Auth.Domain{}) {:missing, %Auth.Domain{log: "Missing authorization header value"}} iex> check([], %Auth.Domain{}) {:missing, %Auth.Domain{log: "Missing authorization header value"}} iex> check(["bearer token"], %Auth.Domain{}) {:error, %Auth.Domain{log: "Invalid authorization"}} iex> check(["narf"], %Auth.Domain{}) {:error, %Auth.Domain{log: "Authorization header exists but is not formatted properly"}} iex> check(["narf narf"], %Auth.Domain{}) {:error, %Auth.Domain{log: "Invalid authorization type: narf"}}

Functions

check(arg1, auth)

@spec check(auth_header :: [String.t()], Rivet.Auth.Domain.t()) ::
  {:ok | :missing | :error, Rivet.Auth.Domain.t()}

iex> alias Rivet.Auth iex> check([""], %Auth.Domain{}) {:missing, %Auth.Domain{log: "Missing authorization header value"}} iex> check([], %Auth.Domain{}) {:missing, %Auth.Domain{log: "Missing authorization header value"}} iex> check(["bearer token"], %Auth.Domain{}) {:error, %Auth.Domain{log: "Invalid authorization"}} iex> check(["narf"], %Auth.Domain{}) {:error, %Auth.Domain{log: "Authorization header exists but is not formatted properly"}} iex> check(["narf narf"], %Auth.Domain{}) {:error, %Auth.Domain{log: "Invalid authorization type: narf"}}