Arangox.Auth (Arangox v0.8.0)

Copy Markdown View Source

The shapes the :auth start option accepts.

validate/1 rejects anything else without printing the value: the value is the credential, and a start_link/1 that raises is the most likely thing anyone pastes into an issue.

Summary

Functions

Returns :ok for a supported :auth value, raises ArgumentError otherwise.

Types

password()

@type password() :: String.t()

t()

@type t() :: {:basic, username(), password()} | {:bearer, token()}

token()

@type token() :: String.t()

username()

@type username() :: String.t()

Functions

validate(auth)

@spec validate(term()) :: :ok

Returns :ok for a supported :auth value, raises ArgumentError otherwise.

Every credential must be a string: these values are interpolated into an authorization header (or a VelocyStream auth message), and only a string has a rendering that is the credential itself rather than a term dump.

The raised message describes the shape it received and never the value.