# `Arangox.Auth`
[🔗](https://github.com/ArangoDB-Community/arangox/blob/v0.8.0/lib/arangox/auth.ex#L1)

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.

# `password`

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

# `t`

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

# `token`

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

# `username`

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

# `validate`

```elixir
@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.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
