View Source Xandra.Authenticator behaviour (Xandra v0.18.1)

A behaviour module for implementing a Cassandra authenticator.

Examples

defmodule MyAuthenticator do
  @behaviour Xandra.Authenticator

  def response_body(options) do
    ["user:", Keyword.fetch!(options, :user), "_password:", Keyword.fetch!(options, :password)]
  end
end

To use the authenticator defined above:

Xandra.start_link(authentication: {MyAuthenticator, user: "foo", password: "bar"})

Xandra supports Cassandra's PasswordAuthenticator by default, see Xandra.Authenticator.Password for more information.

Summary

Callbacks

Returns an iodata that's used as the response body to Cassandra's auth challenge.

Callbacks

@callback response_body(options :: keyword()) :: iodata()

Returns an iodata that's used as the response body to Cassandra's auth challenge.