Haytni.PasswordPolicyPlugin (Haytni v0.7.0) View Source

This plugin provides a basic password policy based on its length and its content (character types). If you are looking for a more advanced policy you'll probably want to disable this plugin and write your own.

Fields: none

Configuration:

  • password_length (default: 6..128): define min and max password length as an Elixir Range. It's worth noting, if you use bcrypt to hash passwords, that there is no point to allow a length beyond 72 bytes because bcrypt silently truncates keys to this length.

  • password_classes_to_match (default: 2): the minimum character classes between digit, lowercase, uppercase and others a password has to match to be accepted

    stack Haytni.PasswordPolicyPlugin,
      password_length: 6..128,
      password_classes_to_match: 2

Routes: none

Link to this section Summary

Functions

Callback implementation for Haytni.Plugin.fields/1.

The translated string to display when the password doesn't contain at least config.password_classes_to_match different types of characters in it.

Link to this section Functions

Callback implementation for Haytni.Plugin.fields/1.

Link to this function

files_to_install(base_path, web_path, scope, timestamp)

View Source

Callback implementation for Haytni.Plugin.files_to_install/4.

Link to this function

find_user(conn, module, config)

View Source

Callback implementation for Haytni.Plugin.find_user/3.

Link to this function

invalid?(user, module, config)

View Source

Callback implementation for Haytni.Plugin.invalid?/3.

Link to this function

invalid_password_format_message(config)

View Source

Specs

invalid_password_format_message(
  config :: Haytni.PasswordPolicyPlugin.Config.t()
) :: String.t()

The translated string to display when the password doesn't contain at least config.password_classes_to_match different types of characters in it.

Link to this function

on_delete_user(multi, user, module, config)

View Source

Callback implementation for Haytni.Plugin.on_delete_user/4.

Link to this function

on_email_change(multi, changeset, module, config)

View Source

Callback implementation for Haytni.Plugin.on_email_change/4.

Link to this function

on_failed_authentication(user, multi, keywords, module, config)

View Source

Callback implementation for Haytni.Plugin.on_failed_authentication/5.

Link to this function

on_logout(conn, module, config)

View Source

Callback implementation for Haytni.Plugin.on_logout/3.

Link to this function

on_registration(multi, module, config)

View Source

Callback implementation for Haytni.Plugin.on_registration/3.

Link to this function

on_successful_authentication(conn, user, multi, keywords, module, config)

View Source

Callback implementation for Haytni.Plugin.on_successful_authentication/6.

Link to this function

routes(config, prefix_name, options)

View Source

Callback implementation for Haytni.Plugin.routes/3.

Link to this function

validate_create_registration(changeset, module, config)

View Source

Callback implementation for Haytni.Plugin.validate_create_registration/3.

Link to this function

validate_update_registration(changeset, module, config)

View Source

Callback implementation for Haytni.Plugin.validate_update_registration/3.