View Source Comeonin behaviour (Comeonin v5.4.0)

Defines a behaviour for higher-level password hashing functions.

Summary

Callbacks

Runs the password hash function, but always returns false.

Types

@type opts() :: keyword()
@type password() :: binary()
@type user_struct() :: map() | nil

Callbacks

Link to this callback

add_hash(password, opts)

View Source
This callback is deprecated. This function will be removed in the next major version..
@callback add_hash(password(), opts()) :: map()
Link to this callback

check_pass(user_struct, password, opts)

View Source
This callback is deprecated. This function will be removed in the next major version..
@callback check_pass(user_struct(), password(), opts()) ::
  {:ok, map()} | {:error, String.t()}
@callback no_user_verify(opts()) :: false

Runs the password hash function, but always returns false.

This function is intended to make it more difficult for any potential attacker to find valid usernames by using timing attacks. This function is only useful if it is used as part of a policy of hiding usernames.