Comeonin behaviour (Comeonin v5.3.2) View Source
Defines a behaviour for higher-level password hashing functions.
Link to this section Summary
Callbacks
Hashes a password and returns the password hash in a map.
Checks the password by comparing its hash with the password hash found in a user struct, or map.
Runs the password hash function, but always returns false.
Link to this section Types
Link to this section Callbacks
Specs
Hashes a password and returns the password hash in a map.
Specs
check_pass(user_struct(), password(), opts()) :: {:ok, map()} | {:error, String.t()}
Checks the password by comparing its hash with the password hash found in a user struct, or map.
The first argument to check_pass/3
should be a user struct, a regular
map, or nil.
Specs
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.