rodauth 2.36.0 → 2.37.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (159) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rodauth/features/base.rb +15 -1
  3. data/lib/rodauth/features/change_login.rb +2 -2
  4. data/lib/rodauth/features/create_account.rb +2 -2
  5. data/lib/rodauth/features/email_auth.rb +1 -1
  6. data/lib/rodauth/features/internal_request.rb +4 -4
  7. data/lib/rodauth/features/json.rb +5 -0
  8. data/lib/rodauth/features/jwt.rb +5 -9
  9. data/lib/rodauth/features/lockout.rb +1 -1
  10. data/lib/rodauth/features/login.rb +1 -1
  11. data/lib/rodauth/features/login_password_requirements_base.rb +13 -0
  12. data/lib/rodauth/features/reset_password.rb +1 -1
  13. data/lib/rodauth/features/two_factor_base.rb +6 -13
  14. data/lib/rodauth/features/verify_account.rb +2 -2
  15. data/lib/rodauth/features/webauthn_autofill.rb +2 -1
  16. data/lib/rodauth/features/webauthn_login.rb +1 -1
  17. data/lib/rodauth/version.rb +1 -1
  18. data/lib/rodauth.rb +6 -2
  19. metadata +3 -258
  20. data/CHANGELOG +0 -521
  21. data/README.rdoc +0 -1555
  22. data/doc/account_expiration.rdoc +0 -41
  23. data/doc/active_sessions.rdoc +0 -56
  24. data/doc/argon2.rdoc +0 -54
  25. data/doc/audit_logging.rdoc +0 -44
  26. data/doc/base.rdoc +0 -123
  27. data/doc/change_login.rdoc +0 -25
  28. data/doc/change_password.rdoc +0 -26
  29. data/doc/change_password_notify.rdoc +0 -14
  30. data/doc/close_account.rdoc +0 -26
  31. data/doc/confirm_password.rdoc +0 -32
  32. data/doc/create_account.rdoc +0 -27
  33. data/doc/disallow_common_passwords.rdoc +0 -17
  34. data/doc/disallow_password_reuse.rdoc +0 -30
  35. data/doc/email_auth.rdoc +0 -55
  36. data/doc/email_base.rdoc +0 -18
  37. data/doc/error_reasons.rdoc +0 -77
  38. data/doc/guides/admin_activation.rdoc +0 -46
  39. data/doc/guides/already_authenticated.rdoc +0 -10
  40. data/doc/guides/alternative_login.rdoc +0 -46
  41. data/doc/guides/change_table_and_column_names.rdoc +0 -19
  42. data/doc/guides/create_account_programmatically.rdoc +0 -38
  43. data/doc/guides/delay_password.rdoc +0 -25
  44. data/doc/guides/email_only.rdoc +0 -16
  45. data/doc/guides/i18n.rdoc +0 -29
  46. data/doc/guides/internals.rdoc +0 -233
  47. data/doc/guides/links.rdoc +0 -12
  48. data/doc/guides/login_return.rdoc +0 -37
  49. data/doc/guides/migrate_password_hash_algorithm.rdoc +0 -15
  50. data/doc/guides/password_column.rdoc +0 -25
  51. data/doc/guides/password_confirmation.rdoc +0 -37
  52. data/doc/guides/password_requirements.rdoc +0 -43
  53. data/doc/guides/paths.rdoc +0 -51
  54. data/doc/guides/query_params.rdoc +0 -9
  55. data/doc/guides/redirects.rdoc +0 -17
  56. data/doc/guides/registration_field.rdoc +0 -68
  57. data/doc/guides/render_confirmation.rdoc +0 -17
  58. data/doc/guides/require_mfa.rdoc +0 -30
  59. data/doc/guides/reset_password_autologin.rdoc +0 -21
  60. data/doc/guides/share_configuration.rdoc +0 -34
  61. data/doc/guides/status_column.rdoc +0 -28
  62. data/doc/guides/totp_or_recovery.rdoc +0 -16
  63. data/doc/http_basic_auth.rdoc +0 -18
  64. data/doc/internal_request.rdoc +0 -539
  65. data/doc/json.rdoc +0 -56
  66. data/doc/jwt.rdoc +0 -52
  67. data/doc/jwt_cors.rdoc +0 -22
  68. data/doc/jwt_refresh.rdoc +0 -58
  69. data/doc/lockout.rdoc +0 -73
  70. data/doc/login.rdoc +0 -39
  71. data/doc/login_password_requirements_base.rdoc +0 -44
  72. data/doc/logout.rdoc +0 -22
  73. data/doc/otp.rdoc +0 -93
  74. data/doc/otp_lockout_email.rdoc +0 -30
  75. data/doc/otp_modify_email.rdoc +0 -19
  76. data/doc/otp_unlock.rdoc +0 -58
  77. data/doc/password_complexity.rdoc +0 -34
  78. data/doc/password_expiration.rdoc +0 -38
  79. data/doc/password_grace_period.rdoc +0 -24
  80. data/doc/password_pepper.rdoc +0 -52
  81. data/doc/path_class_methods.rdoc +0 -10
  82. data/doc/recovery_codes.rdoc +0 -61
  83. data/doc/release_notes/1.0.0.txt +0 -443
  84. data/doc/release_notes/1.1.0.txt +0 -8
  85. data/doc/release_notes/1.10.0.txt +0 -80
  86. data/doc/release_notes/1.11.0.txt +0 -32
  87. data/doc/release_notes/1.12.0.txt +0 -61
  88. data/doc/release_notes/1.13.0.txt +0 -34
  89. data/doc/release_notes/1.14.0.txt +0 -19
  90. data/doc/release_notes/1.15.0.txt +0 -21
  91. data/doc/release_notes/1.16.0.txt +0 -31
  92. data/doc/release_notes/1.17.0.txt +0 -23
  93. data/doc/release_notes/1.18.0.txt +0 -26
  94. data/doc/release_notes/1.19.0.txt +0 -116
  95. data/doc/release_notes/1.2.0.txt +0 -18
  96. data/doc/release_notes/1.20.0.txt +0 -175
  97. data/doc/release_notes/1.21.0.txt +0 -12
  98. data/doc/release_notes/1.22.0.txt +0 -11
  99. data/doc/release_notes/1.23.0.txt +0 -32
  100. data/doc/release_notes/1.3.0.txt +0 -21
  101. data/doc/release_notes/1.4.0.txt +0 -11
  102. data/doc/release_notes/1.5.0.txt +0 -74
  103. data/doc/release_notes/1.6.0.txt +0 -37
  104. data/doc/release_notes/1.7.0.txt +0 -6
  105. data/doc/release_notes/1.8.0.txt +0 -14
  106. data/doc/release_notes/1.9.0.txt +0 -15
  107. data/doc/release_notes/2.0.0.txt +0 -361
  108. data/doc/release_notes/2.1.0.txt +0 -31
  109. data/doc/release_notes/2.10.0.txt +0 -47
  110. data/doc/release_notes/2.11.0.txt +0 -31
  111. data/doc/release_notes/2.12.0.txt +0 -17
  112. data/doc/release_notes/2.13.0.txt +0 -19
  113. data/doc/release_notes/2.14.0.txt +0 -17
  114. data/doc/release_notes/2.15.0.txt +0 -48
  115. data/doc/release_notes/2.16.0.txt +0 -20
  116. data/doc/release_notes/2.17.0.txt +0 -10
  117. data/doc/release_notes/2.18.0.txt +0 -27
  118. data/doc/release_notes/2.19.0.txt +0 -61
  119. data/doc/release_notes/2.2.0.txt +0 -39
  120. data/doc/release_notes/2.20.0.txt +0 -10
  121. data/doc/release_notes/2.21.0.txt +0 -28
  122. data/doc/release_notes/2.22.0.txt +0 -43
  123. data/doc/release_notes/2.23.0.txt +0 -15
  124. data/doc/release_notes/2.24.0.txt +0 -15
  125. data/doc/release_notes/2.25.0.txt +0 -8
  126. data/doc/release_notes/2.26.0.txt +0 -45
  127. data/doc/release_notes/2.27.0.txt +0 -35
  128. data/doc/release_notes/2.28.0.txt +0 -16
  129. data/doc/release_notes/2.29.0.txt +0 -27
  130. data/doc/release_notes/2.3.0.txt +0 -37
  131. data/doc/release_notes/2.30.0.txt +0 -15
  132. data/doc/release_notes/2.31.0.txt +0 -47
  133. data/doc/release_notes/2.32.0.txt +0 -65
  134. data/doc/release_notes/2.33.0.txt +0 -18
  135. data/doc/release_notes/2.34.0.txt +0 -36
  136. data/doc/release_notes/2.35.0.txt +0 -22
  137. data/doc/release_notes/2.36.0.txt +0 -35
  138. data/doc/release_notes/2.4.0.txt +0 -22
  139. data/doc/release_notes/2.5.0.txt +0 -20
  140. data/doc/release_notes/2.6.0.txt +0 -37
  141. data/doc/release_notes/2.7.0.txt +0 -33
  142. data/doc/release_notes/2.8.0.txt +0 -20
  143. data/doc/release_notes/2.9.0.txt +0 -21
  144. data/doc/remember.rdoc +0 -79
  145. data/doc/reset_password.rdoc +0 -66
  146. data/doc/reset_password_notify.rdoc +0 -17
  147. data/doc/session_expiration.rdoc +0 -28
  148. data/doc/single_session.rdoc +0 -37
  149. data/doc/sms_codes.rdoc +0 -138
  150. data/doc/two_factor_base.rdoc +0 -70
  151. data/doc/update_password_hash.rdoc +0 -7
  152. data/doc/verify_account.rdoc +0 -67
  153. data/doc/verify_account_grace_period.rdoc +0 -19
  154. data/doc/verify_login_change.rdoc +0 -59
  155. data/doc/webauthn.rdoc +0 -118
  156. data/doc/webauthn_autofill.rdoc +0 -19
  157. data/doc/webauthn_login.rdoc +0 -16
  158. data/doc/webauthn_modify_email.rdoc +0 -19
  159. data/doc/webauthn_verify_account.rdoc +0 -9
@@ -1,41 +0,0 @@
1
- = Documentation for Account Expiration Feature
2
-
3
- The account expiration feature disallows access to accounts after
4
- a configurable amount of time since the last login or activity
5
- (default: 180 days since last login). By default, this feature
6
- does not track activity times as that can slow things down, but if
7
- you want to record activity times, you can do so by adding the
8
- following code to your routing block:
9
-
10
- rodauth.update_last_activity
11
-
12
- Note that it only makes sense to do this if you are also expiring
13
- accounts based on last activity instead of last login, via the
14
- +expire_account_on_last_activity?+ configuration setting.
15
-
16
- Note that this feature does not support the reenabling of expired
17
- accounts, that is something you would have to implement yourself,
18
- if you need such a feature.
19
-
20
- == Auth Value Methods
21
-
22
- account_activity_expired_column :: The column in the +account_activity_table+ storing the expiration timestamp.
23
- account_activity_id_column :: The column in the +account_activity_table+ storing the account id.
24
- account_activity_last_activity_column :: The column in the +account_activity_table+ storing the last activity timestamp.
25
- account_activity_last_login_column :: The column in the +account_activity_table+ storing the last login timestamp.
26
- account_activity_table :: The database table use for storing account login/activity/expiration timestamps.
27
- account_expiration_error_flash :: The flash error to show when attempting to login to an account that has expired.
28
- account_expiration_redirect :: Where to redirect after attempting to login to an account that has expired.
29
- expire_account_after :: How long in seconds from last login or activity until an account is considered expired.
30
- expire_account_on_last_activity? :: Whether to use the last activity timestamp when checking an account for expiration. By default, this is false and it uses the last login timestamp.
31
-
32
- == Auth Methods
33
-
34
- account_expired? :: Whether the current account has expired.
35
- account_expired_at :: The expiration timestamp for the current account, nil if the account hasn't been expired.
36
- after_account_expiration :: Run arbitrary code after account expiration.
37
- last_account_activity_at :: The last activity timestamp for the current account, nil if the account hasn't had activity recorded yet.
38
- last_account_login_at :: The last login timestamp for the current account, nil if the account hasn't had a login recorded yet.
39
- set_expired :: Set the current account as having expired.
40
- update_last_activity :: Update the last activity timestamp for the account.
41
- update_last_login :: Update the last login timestamp for the account.
@@ -1,56 +0,0 @@
1
- = Documentation for Active Sessions Feature
2
-
3
- The active sessions feature stores an id for each session in a
4
- database table whenever a user logs in to the system. In your
5
- routing block, you can check that the session id given is
6
- still listed as an active session:
7
-
8
- rodauth.check_active_session
9
-
10
- On logout, the session id is removed from the database table,
11
- so attempts to reuse the session id after that will fail.
12
- Additionally, this supports an option on logout to globally
13
- logout all sessions, which removes all active session ids for
14
- the account from the database table.
15
-
16
- In addition to removing sessions on logout, this also by default
17
- supports session inactivity deadlines (based on time since last
18
- use) and session lifetime deadlines (based on time since session
19
- creation). To prevent the sessions table from growing
20
- indefinitely, sessions that are passed either deadline are
21
- removed when checking if the current session is active.
22
-
23
- This depends on the logout feature.
24
-
25
- == Auth Value Methods
26
-
27
- active_sessions_account_id_column :: The column in the +active_sessions_table+ containing the account id.
28
- active_sessions_created_at_column :: The column in the +active_sessions_table+ containing the time of session creation.
29
- active_sessions_error_flash :: The flash error to display if the current session is no longer active.
30
- active_sessions_last_use_column :: The column in the +active_sessions_table+ containing the time the session was last used.
31
- active_sessions_redirect :: Where to redirect if the current session is no longer active.
32
- active_sessions_session_id_column :: The column in the +active_sessions_table+ containing the session_id.
33
- active_sessions_table :: The database table storing active session keys.
34
- global_logout_label :: The label for the global logout checkbox on the logout page.
35
- global_logout_param :: The parameter name for the global logout checkbox on the logout page.
36
- inactive_session_error_status :: The error status to use when a JSON request is made and the session is no longer active, 401 by default.
37
- session_id_session_key :: The session key name to use for storing the session id.
38
- session_inactivity_deadline :: The number of seconds since last use after which the session will be considered expired (1 day by default). Can be set to nil to not check session inactivity.
39
- session_lifetime_deadline :: The number of seconds since session creation after which the session will be considered expired (30 days by default). Can be set to nil to not check session lifetimes.
40
- update_current_session? :: Whether the update current session with +active_sessions_update_hash+. By default returns true if +session_inactivity_deadline+ is set.
41
-
42
- == Auth Methods
43
-
44
- active_sessions_insert_hash :: The hash to insert into the +active_sessions_table+.
45
- active_sessions_key :: The active session key for the current account.
46
- active_sessions_update_hash :: The hash to update the currently active session when +update_current_session?+ is true. By default updates last use to current time.
47
- add_active_session :: Create a session id for the session and populate the session and add the session id to the database.
48
- currently_active_session? :: Whether the session is currently active, by checking the database table.
49
- handle_duplicate_active_session_id(exception) :: How to handle the case where a duplicate session id for the account is inserted into the table. Does nothing by default. This should only be called if the random number generator is broken.
50
- no_longer_active_session :: What action to take if +rodauth.check_active_session+ is called and the session is no longer active.
51
- remove_active_session(session_id) :: Removes the active session matching the given session ID from the database. Useful for implementing session revoking.
52
- remove_all_active_sessions :: Remove all active sessions for the account from the database, used for global logouts and when closing accounts.
53
- remove_all_active_sessions_except_for(session_id) :: Remove all active sessions for the account from the database, except for the session id given.
54
- remove_all_active_sessions_except_current :: Remove all active sessions for the account from the database, except for the current session.
55
- remove_current_session :: Remove current session from the database, used for regular logouts.
56
- remove_inactive_sessions :: Remove inactive sessions from the database, run before checking for whether the current session is active.
data/doc/argon2.rdoc DELETED
@@ -1,54 +0,0 @@
1
- = Documentation for Argon2 Feature
2
-
3
- The argon2 feature adds the ability to replace the bcrypt password hash
4
- algorithm with argon2 (specifically, argon2id). Argon2 is an alternative to
5
- bcrypt that offers the ability to be memory-hard. However, argon2 is weaker
6
- than bcrypt for interactive login environments (e.g. password check times
7
- under a second), so for the vast majority of web applications, using the
8
- argon2 feature will weaken the application's security. You should not use
9
- the argon2 feature unless the usage of argon2 is required or you are a
10
- cryptographer and understand why argon2 would be better than bcrypt for your
11
- application.
12
-
13
- If you are using this feature with Rodauth's database authentication functions,
14
- you need to make sure that the database authentication functions are configured
15
- to support argon2 in addition to bcrypt. You can do this by passing the
16
- +:argon2+ option when calling the method to define the database functions.
17
- In this example, +DB+ should be your Sequel::Database object:
18
-
19
- require 'rodauth/migrations'
20
-
21
- # If the functions are already defined and you are not using PostgreSQL,
22
- # you need to drop the existing functions.
23
- Rodauth.drop_database_authentication_functions(DB)
24
-
25
- # If you are using the disallow_password_reuse feature, also drop the
26
- # database functions related to that if not using PostgreSQL:
27
- Rodauth.drop_database_previous_password_check_functions(DB)
28
-
29
- # Define new functions that support argon2:
30
- Rodauth.create_database_authentication_functions(DB, argon2: true)
31
-
32
- # If you are using the disallow_password_reuse feature, also define
33
- # new functions that support argon2 for that:
34
- Rodauth.create_database_previous_password_check_functions(DB, argon2: true)
35
-
36
- The argon2 feature provides the ability to allow for a gradual migration
37
- from transitioning from bcrypt to argon2 and vice-versa, if you are using the
38
- update_password_hash feature.
39
-
40
- Argon2 is more configurable than bcrypt in terms of password hash cost
41
- speficiation. Instead of specifying the password_hash_cost value as
42
- an integer, you must specify the password hash cost as a hash, such as
43
- (<tt>{t_cost: 2, m_cost: 16}</tt>).
44
-
45
- If you are using the argon2 feature and if you have no bcrypt passwords in
46
- your database, you should use <tt>require_bcrypt? false</tt> in your
47
- Rodauth configuration to prevent loading the bcrypt library, which will save
48
- memory.
49
-
50
- == Auth Value Methods
51
-
52
- argon2_old_secret :: The previous secret key used as input at hashing time, used for argon2_secret rotation. In order to rotate the argon2_secret, you must also use the update_password_hash feature, and rotation will not be finished until all users have logged in using the new secret.
53
- argon2_secret :: A secret key used as input at hashing time, folded into the value of the hash.
54
- use_argon2? :: Whether to use the argon2 password hash algorithm for new passwords (true by default). The only reason to set this to false is if you have existing passwords using argon2 that you want to support, but want to use bcrypt for new passwords.
@@ -1,44 +0,0 @@
1
- = Documentation for Audit Logging Feature
2
-
3
- The audit logging feature adds audit logging of rodauth actions to a
4
- database table. It ties into the after hook processing used by all
5
- features so that all features that use after hooks automatically
6
- support audit logging.
7
-
8
- In addition to the configuration methods defined below, the audit
9
- logging feature also offers two additional configuration methods
10
- for action specific audit log messages and metadata,
11
- +audit_log_message_for+ and +audit_log_metadata_for+. These
12
- methods take the action symbol and either take a value or a
13
- block that returns a value to use for the message and metadata
14
- for that action:
15
-
16
- audit_log_message_for :login, "I have logged in"
17
- audit_log_metadata_for :logout, 'Uses'=>'JSON Metadata'
18
-
19
- audit_log_message_for :login_failure do
20
- "Login failure on domain #{request.host}"
21
- end
22
- audit_log_metadata_for :login_failure do
23
- {'ip'=>request.ip}
24
- end
25
-
26
- To skip audit logging for a particular action, you can set the
27
- log message for the action to nil.
28
-
29
- == Auth Value Methods
30
-
31
- audit_logging_account_id_column :: The id column in the +audit_logging_table+, should be a foreign key referencing the accounts table.
32
- audit_logging_message_column :: The message column in the +audit_logging_table+, containing the log message.
33
- audit_logging_metadata_column :: The metadata column in the +audit_logging_table+, storing metadata for the log (if any).
34
- audit_logging_table :: The name of the audit logging table.
35
- audit_log_metadata_default :: The default metadata to use for logs that do not have custom metadata specified by +audit_log_metadata_for+.
36
-
37
- == Auth Methods
38
-
39
- add_audit_log(account_id, action) :: Add an appropriate audit log entry for the account id and action.
40
- audit_log_insert_hash(account_id, action) :: A hash to use when inserting into the +audit_logging_table+.
41
- audit_log_message(action) :: The log message to use when logging the action, by default using +audit_log_message_for+ and +audit_log_message_default+.
42
- audit_log_message_default(action) :: The log message to use when logging the action for logs that do not have custom metadata specified by +audit_log_message_for+
43
- audit_log_metadata(action) :: The metadata to use when logging the action, by default using +audit_log_metadata_for+ and +audit_log_metadata_default+.
44
- serialize_audit_log_metadata(metadata) :: Serialize the metadata for insertion into the database. By default, this converts the metadata using +to_json+, unless the metadata is nil.
data/doc/base.rdoc DELETED
@@ -1,123 +0,0 @@
1
- = Documentation for Base Feature
2
-
3
- The base feature is automatically loaded when you use Rodauth. It contains
4
- shared functionality that is used by multiple features.
5
-
6
- == Auth Value Methods
7
-
8
- === Most Commonly Used
9
-
10
- account_password_hash_column :: Set if the password hash column is in the same table as the login. If this is set, Rodauth will check the password hash in ruby. This is often used if you are replacing a legacy authentication system with Rodauth.
11
- accounts_table :: The database table containing the accounts.
12
- base_url :: The base URL to use, used when construct absolute links. It is recommended to set this if the application can be reached using arbitrary Host headers, as otherwise it is possible for an attacker to control the value.
13
- db :: The Sequel::Database object used for database access.
14
- domain :: The domain to use, required by some other features. It is recommended to set this if the application can be reached using arbitrary Host headers, as otherwise it is possible for an attacker to control the value.
15
- hmac_secret :: This sets the secret to use for all of Rodauth's HMACs. This is not set by default, in which case Rodauth does not use HMACs for additional security. However, it is highly recommended that you set this, and some features require it.
16
- mark_input_fields_as_required? :: Whether input fields should be marked as required, so browsers will not allow submission without filling out the field (default: true).
17
- prefix :: The routing prefix used for Rodauth routes. If you are calling in a routing subtree, this should be set to the root path of the subtree. This should include a leading slash if set, but not a trailing slash.
18
- require_bcrypt? :: Set to false to not require bcrypt, useful if using custom authentication or when using the argon2 feature without existing bcrypt password hashes.
19
- session_key :: The key in the session hash storing the primary key of the logged in account.
20
- session_key_prefix :: The string that will be prepended to the default value for all session keys.
21
- skip_status_checks? :: Whether status checks should be skipped for accounts. Defaults to true unless enabling the verify_account or close_account features.
22
- title_instance_variable :: The instance variable to set in the Roda scope with the page title. The layout should use this instance variable if available to set the title of the page. You can use +set_title+ if setting the page title is not done through an instance variable.
23
-
24
- === Other
25
-
26
- account_id_column :: The primary key column of the +accounts_table+.
27
- account_open_status_value :: The integer representing open accounts.
28
- account_select :: An array of columns to select from +accounts_table+. By default, selects all columns in the table.
29
- account_status_column :: The status id column in the +accounts_table+.
30
- account_unverified_status_value :: The integer representating unverified accounts.
31
- authenticated_by_session_key :: The key in the session hash storing an array of methods used to authenticate.
32
- autocomplete_for_field?(param) :: Whether to use an autocomplete attribute for the given parameter, defaults to +mark_input_fields_with_autocomplete?+.
33
- autologin_type_session_key :: The key in the session hash storing the type of autologin method used, if autologin was used to authenticate.
34
- cache_templates :: Whether to cache templates. True by default. It may be worth switching this to false in development if you are using your own templates instead of the templates provided by Rodauth.
35
- check_csrf? :: Whether Rodauth should use Roda's +check_csrf!+ method for checking CSRF tokens before dispatching to Rodauth routes, true by default.
36
- check_csrf_opts :: Options to pass to Roda's +check_csrf!+ if Rodauth calls it before dispatching.
37
- check_csrf_block :: Proc for block to pass to Roda's +check_csrf!+ if Rodauth calls it before dispatching.
38
- convert_token_id_to_integer? :: Whether token ids should be converted to a valid 64-bit integer value. If not set, defaults to true if +account_id_column+ uses an integer type, and false otherwise.
39
- default_field_attributes :: The default attributes to use for input field tags, if field_attributes returns nil for the field.
40
- default_redirect :: Where to redirect after most successful actions.
41
- field_attributes(field) :: The attributes to use for the input field tags for the given field (parameter name).
42
- field_error_attributes(field) :: The attributes to use for the input field tags for the given field (parameter name), if the input has an error.
43
- flash_error_key :: The flash key to use for error messages (default: +:error+ or <tt>'error'</tt> depending on session support for symbols).
44
- flash_notice_key :: The flash key to use for notice messages (default: +:notice+ or <tt>'notice'</tt> depending on session support for symbols).
45
- formatted_field_error(field, error) :: HTML to use for error messages for the field (parameter name), if the field has an error. By default, uses a span tag for the error message.
46
- hmac_old_secret :: This sets the previous secret used for Rodauth's HMACs, to allow for secret rotation.
47
- hook_action(hook_type, action) :: Arbitrary action to take on all hook processing, with hook type being +:before+ or +:after+, and action being symbol for related action.
48
- input_field_error_class :: The CSS class to use for input fields with errors. Can be a space separated string for multiple CSS classes.
49
- input_field_error_message_class :: The CSS class to use for error messages. Can be a space separated string for multiple CSS classes.
50
- input_field_label_suffix :: The suffix to use for all labels. Useful for noting that the fields are required.
51
- inputmode_for_field?(param) :: Whether to use an inputmode attribute for the given parameter, defaults to mark_input_fields_with_inputmode?.
52
- invalid_field_error_status :: The response status to use for invalid field value errors, 422 by default.
53
- invalid_key_error_status :: The response status to use for invalid key codes, 401 by default.
54
- invalid_password_error_status :: The response status to use for invalid passwords, 401 by default.
55
- invalid_password_message :: The error message to display when a given password doesn't match the stored password hash.
56
- lockout_error_status :: The response status to use a login is attempted to an account that is locked out, 403 by default.
57
- login_column :: The login column in the +accounts_table+.
58
- login_input_type :: The input type to use for logins. Defaults to email if login column is email and text otherwise.
59
- login_label :: The label to use for logins.
60
- login_param :: The parameter name to use for logins.
61
- login_required_error_status :: The response status to return when a login is required and you are not logged in, if not redirecting, 401 by default
62
- login_uses_email? :: Whether the login field uses email, used to set the type of the login field as well as the autocomplete setting.
63
- mark_input_fields_with_autocomplete? :: Whether input fields should be marked with autocomplete attribute appropriate for the field, true by default.
64
- mark_input_fields_with_inputmode? :: Whether input fields should be marked with inputmode attribute appropriate for the field, true by default.
65
- max_param_bytesize :: The maximum bytesize allowed for submitted parameters, 1024 by default. Use nil for no limit.
66
- modifications_require_password? :: Whether making changes to an account requires the user reinputing their password. True by default if the account has a password.
67
- no_matching_login_error_status :: The response status to use when the login is not in the database, 401 by default.
68
- no_matching_login_message :: The error message to display when the login used is not in the database.
69
- password_hash_column :: The password hash column in the +password_hash_table+.
70
- password_hash_id_column :: The account id column in the +password_hash_table+.
71
- password_hash_table :: The table storing the password hashes.
72
- password_label :: The label to use for passwords.
73
- password_param :: The parameter name to use for passwords.
74
- require_login_error_flash :: The flash error to display when accessing a page that requires a login, when you are not logged in.
75
- require_login_redirect :: A redirect to the login page.
76
- set_deadline_values? :: Whether deadline values should be set. True by default on MySQL, as that doesn't support default values that are not constant. Can be set to true on other databases if you want to vary the value based on a request parameter.
77
- strftime_format :: The format to pass to Time#strftime when formatting timestamps to display to the user, '%F %T' by default.
78
- template_opts :: Any template options to pass to view/render. This can be used to set a custom layout, for example.
79
- token_separator :: The string used to separate account id from the random key in links.
80
- unmatched_field_error_status :: The response status to use when two field values should match but do not, 422 by default.
81
- unopen_account_error_status :: The response status to use when trying to login to an account that isn't open, 403 by default.
82
- use_database_authentication_functions? :: Whether to use functions to do authentication. True by default on PostgreSQL, MySQL, and Microsoft SQL Server, false otherwise.
83
- use_date_arithmetic? :: Whether the date_arithmetic extension should be loaded into the database. Defaults to whether deadline values should be set.
84
- use_request_specific_csrf_tokens? :: Whether to use request-specific CSRF tokens. True if the default CSRF setting are used.
85
-
86
- == Auth Methods
87
-
88
- account_from_id(id, status_id=nil) :: Retrieve the account hash for the given account id and status.
89
- account_from_login(login) :: Retrieve the account hash related to the given login or nil if no login matches.
90
- account_from_session :: Retrieve the account hash related to the currently logged in session.
91
- account_id :: The primary key value of the current account.
92
- account_session_value :: The primary value of the current account to store in the session when logging in.
93
- after_login :: Run arbitrary code after a successful login.
94
- after_login_failure :: Run arbitrary code after a login failure due to an invalid password.
95
- already_logged_in :: What action to take if you are already logged in and attempt to access a page that only makes sense if you are not logged in.
96
- around_rodauth(&block) :: Run arbitrary code around handling any rodauth route. Call <tt>super(&block)</tt> for Rodauth to handle the action.
97
- authenticated? :: Whether the user has been authenticated. If multifactor authentication has been enabled for the account, this is true only if the session is multifactor authenticated.
98
- before_login :: Run arbitrary code after password has been checked, but before updating the session.
99
- before_login_attempt :: Run arbitrary code after an account has been located, but before the password has been checked.
100
- before_rodauth :: Run arbitrary code before handling any rodauth route, but after CSRF checks if Rodauth is doing CSRF checks.
101
- check_csrf :: Checks CSRF token using Roda's +check_csrf!+ method.
102
- clear_session :: Clears the current session.
103
- convert_token_id(id) :: Convert the token id string to an appropriate object to use for the token id (or return +nil+ to signal an invalid token id). By default, converts to a 64-bit signed integer if +convert_token_id_to_integer?+ is true.
104
- csrf_tag(path=request.path) :: The HTML fragment containing the CSRF tag to use, if any.
105
- function_name(name) :: The name of the database function to call. It's passed either :rodauth_get_salt or :rodauth_valid_password_hash.
106
- logged_in? :: Whether the current session is logged in.
107
- login_required :: Action to take when a login is required to access the page and the user is not logged in.
108
- null_byte_parameter_value(key, value) :: The value to use for the parameter if the parameter includes an ASCII NUL byte ("\0"), nil by default to ignore the parameter.
109
- open_account? :: Whether the current account is an open account (not closed or unverified).
110
- over_max_bytesize_param_value(key, value) :: The value to use for the parameter if the parameter is over the maximum allowed bytesize, nil by default to ignore the parameter.
111
- password_match?(password) :: Check whether the given password matches the stored password hash.
112
- random_key :: A randomly generated string, used for creating tokens.
113
- redirect(path) :: Redirect the request to the given path.
114
- session_value :: The value for session_key in the current session.
115
- set_error_flash(message) :: Set the current error flash to the given message.
116
- set_error_reason(reason) :: You can override this method to customize handling of specific error types (does nothing by default). Each separate error type has a separate reason symbol, you can see the {list of error reason symbols}[rdoc-ref:doc/error_reasons.rdoc].
117
- set_notice_flash(message) :: Set the next notice flash to the given message.
118
- set_notice_now_flash(message) :: Set the current notice flash to the given message.
119
- set_redirect_error_flash(message) :: Set the next error flash to the given message.
120
- set_title(title) :: Set the title of the page to the given title.
121
- translate(key, default_value) :: Return a translated version for the key (uses the default value by default).
122
- unverified_account_message :: The message to use when attempting to login to an unverified account.
123
- update_session :: Clear the session, then set the session key to the primary key of the current account.
@@ -1,25 +0,0 @@
1
- = Documentation for Change Login Feature
2
-
3
- The change login feature implements a form that a user can use to
4
- change their login.
5
-
6
- == Auth Value Methods
7
-
8
- change_login_additional_form_tags :: HTML fragment containing additional form tags to use on the change login form.
9
- change_login_button :: The text to use for the change login button.
10
- change_login_error_flash :: The flash error to show for an unsuccessful login change.
11
- change_login_notice_flash :: The flash notice to show after a successful login change.
12
- change_login_page_title :: The page title to use on the change login form.
13
- change_login_redirect :: Where to redirect after a sucessful login change.
14
- change_login_requires_password? :: Whether a password is required when changing logins.
15
- change_login_route :: The route to the change login action. Defaults to +change-login+.
16
- same_as_current_login_message :: The error message to display if using the same value as the current login when changing the login.
17
-
18
- == Auth Methods
19
-
20
- after_change_login :: Run arbitrary code after successful login change.
21
- before_change_login :: Run arbitrary code before changing a login.
22
- before_change_login_route :: Run arbitrary code before handling a change login route.
23
- change_login(login) :: Change the users login to the given login, or return nil/false if the login cannot be changed to the given login.
24
- change_login_response :: Return a response after a successful login change. By default, redirects to +change_login_redirect+.
25
- change_login_view :: The HTML to use for the change login form.
@@ -1,26 +0,0 @@
1
- = Documentation for Change Password Feature
2
-
3
- The change password feature implements a form that a user can use to
4
- change their password.
5
-
6
- == Auth Value Methods
7
-
8
- change_password_additional_form_tags :: HTML fragment containing additional form tags to use on the change password form.
9
- change_password_button :: The text to use for the change password button.
10
- change_password_error_flash :: The flash error to show for an unsuccessful password change.
11
- change_password_notice_flash :: The flash notice to show after a successful password change.
12
- change_password_page_title :: The page title to use on the change password form.
13
- change_password_redirect :: Where to redirect after a sucessful password change.
14
- change_password_requires_password? :: Whether a password is required when changing passwords.
15
- change_password_route :: The route to the change password action. Defaults to +change-password+.
16
- invalid_previous_password_message :: The message to use when the previous password was incorrect. Defaults to +invalid_password_message+.
17
- new_password_label :: The label to use for the new password.
18
- new_password_param :: The parameter name to use for new passwords.
19
-
20
- == Auth Methods
21
-
22
- after_change_password :: Run arbitrary code after successful password change.
23
- before_change_password :: Run arbitrary code before changing the password for an account.
24
- before_change_password_route :: Run arbitrary code before handling a change password route.
25
- change_password_response :: Return a response after a successful password change. By default, redirects to +change_password_redirect+.
26
- change_password_view :: The HTML to use for the change password form.
@@ -1,14 +0,0 @@
1
- = Documentation for Change Password Notify Feature
2
-
3
- The change password notify feature emails the user when their password
4
- is changed using the change password feature.
5
-
6
- == Auth Value Methods
7
-
8
- password_changed_email_body :: Body to use for the password changed emails
9
- password_changed_email_subject :: Subject to use for the password changed emails
10
-
11
- == Auth Methods
12
-
13
- create_password_changed_email :: A Mail::Message for the password changed email to send.
14
- send_password_changed_email :: Send the password changed email.
@@ -1,26 +0,0 @@
1
- = Documentation for Close Account Feature
2
-
3
- The close account feature allows users to close their accounts.
4
-
5
- == Auth Value Methods
6
-
7
- account_closed_status_value :: The integer representing closed accounts.
8
- close_account_additional_form_tags :: HTML fragment containing additional form tags to use on the close account form.
9
- close_account_button :: The text to use for the close account button.
10
- close_account_error_flash :: The flash error to show if there is an error closing the account.
11
- close_account_notice_flash :: The flash notice to show after closing the account.
12
- close_account_page_title :: The page title to use on the close account form.
13
- close_account_redirect :: Where to redirect after closing the account.
14
- close_account_requires_password? :: Whether a password is required when closing accounts.
15
- close_account_route :: The route to the close account action. Defaults to +close-account+.
16
- delete_account_on_close? :: Whether to delete the account when closing it, default value is to use +skip_status_checks?+.
17
-
18
- == Auth Methods
19
-
20
- after_close_account :: Run arbitrary code after closing the account.
21
- before_close_account :: Run arbitrary code before closing an account.
22
- before_close_account_route :: Run arbitrary code before handling a close account route.
23
- close_account :: Close the account, by default setting the account status to closed.
24
- close_account_response :: Return a response after successfully closing the account . By default, redirects to +close_account_redirect+.
25
- close_account_view :: The HTML to use for the close account form.
26
- delete_account :: If +delete_account_on_close?+ is true, delete the account when closing it.
@@ -1,32 +0,0 @@
1
- = Documentation for Confirm Password Feature
2
-
3
- The confirm password feature allows you to redirect users to a page to
4
- confirm their password.
5
-
6
- When confirming passwords, if authenticated via autologin, a remember token,
7
- or an email_auth token, switches the authentication type from that login
8
- method to password.
9
-
10
- == Auth Value Methods
11
-
12
- confirm_password_additional_form_tags :: HTML fragment containing additional form tags to use on the confirm password form.
13
- confirm_password_button :: The text to use for the confirm password button.
14
- confirm_password_error_flash :: The flash error to show if password confirmation is unsuccessful.
15
- confirm_password_link_text :: The text to use for the link from the two factor auth page.
16
- confirm_password_notice_flash :: The flash notice to show after password confirmed successful.
17
- confirm_password_page_title :: The page title to use on the confirm password form.
18
- confirm_password_redirect :: Where to redirect after successful password confirmation. By default, uses <tt>session[confirm_password_redirect_session_key]</tt> if set, allowing an easy way to redirect back to the page requesting password confirmation.
19
- confirm_password_redirect_session_key :: The session key used to check for the confirm_password_redirect.
20
- confirm_password_route :: The route to the confirm password form. Defaults to +confirm-password+.
21
- password_authentication_required_error_flash :: The flash error to show if going to a page requiring password confirmation.
22
- password_authentication_required_error_status :: The response status to use if going to a page requiring password confirmation, 401 by default.
23
- password_authentication_required_redirect :: Where to redirect when going to a page requiring password confirmation.
24
-
25
- == Auth Methods
26
-
27
- after_confirm_password :: Run arbitrary code after successful confirmation of password.
28
- before_confirm_password :: Run arbitrary code before setting that the password has been confirmed.
29
- before_confirm_password_route :: Run arbitrary code before handling the password confirmation route.
30
- confirm_password :: Update the session to reflect the password has been confirmed.
31
- confirm_password_response :: Return a response after successful password confirmation. By default, redirects to +confirm_password_redirect+.
32
- confirm_password_view :: The HTML to use for the confirm password form.
@@ -1,27 +0,0 @@
1
- = Documentation for Create Account Feature
2
-
3
- The create account feature allows users to create new accounts.
4
-
5
- == Auth Value Methods
6
-
7
- create_account_additional_form_tags :: HTML fragment containing additional form tags to use on the create account form.
8
- create_account_button :: The text to use for the create account button.
9
- create_account_error_flash :: The flash error to show for unsuccessful account creation.
10
- create_account_notice_flash :: The flash notice to show after successful account creation.
11
- create_account_page_title :: The page title to use on the create account form.
12
- create_account_redirect :: Where to redirect after creating the account.
13
- create_account_route :: The route to the create account action. Defaults to +create-account+.
14
- create_account_set_password? :: Whether to ask for a password to be set on the create account form. Defaults to true if not verifying accounts. If set to false, an alternative method to set the password should be used (assuming you want to allow password authentication).
15
-
16
- == Auth Methods
17
-
18
- after_create_account :: Run arbitrary code after creating the account.
19
- before_create_account :: Run arbitrary code before creating the account.
20
- before_create_account_route :: Run arbitrary code before handling a create account route.
21
- create_account_autologin? :: Whether to autologin the user upon successful account creation, true by default unless verifying accounts.
22
- create_account_link_text :: The text to use for a link to the create account form.
23
- create_account_response :: Return a response after successful account creation. By default, redirects to +create_account_redirect+.
24
- create_account_view :: The HTML to use for the create account form.
25
- new_account(login) :: Instantiate a new account hash for the given login, without saving it.
26
- save_account :: Insert the account into the database, or return nil/false if that was not successful.
27
- set_new_account_password :: Set the password for a new account if +account_password_hash_column+ is set, without saving.
@@ -1,17 +0,0 @@
1
- = Documentation for Disallow Common Passwords Feature
2
-
3
- The disallow common passwords feature disallows setting of a password
4
- that matches one of the most common passwords. By default, a list of
5
- 10,000 of the most common passwords is used, but you can supply your
6
- own file. Using a larger list is recommended, but Rodauth doesn't
7
- ship with a larger list to avoid bloating the size of the gem.
8
-
9
- == Auth Value Methods
10
-
11
- most_common_passwords :: An object that responds to +include?+ which will return true if the password given is one of the most common passwords. Useful for custom password sets where they are not stored in files and kept in memory.
12
- most_common_passwords_file :: The path to the file containing the most common passwords, which are not allowed to be used for new passwords. Defaults to a list of 10,000 most common passwords that ships with Rodauth. Can be set to nil/false if you do not want to to load common passwords from a file.
13
- password_is_one_of_the_most_common_message :: The error message fragment to display if the given password matches one of the most common passwords.
14
-
15
- == Auth Methods
16
-
17
- password_one_of_most_common?(password) :: This can be used to override the default check for whether the given password is contained in the most_common_passwords_file. This method may be useful when using very large password databases where you don't want to keep the list of most common passwords in memory.
@@ -1,30 +0,0 @@
1
- = Documentation for Disallow Password Reuse Feature
2
-
3
- The disallow password reuse feature disallows setting of a password
4
- that matches a number of previous passwords (6 by default).
5
-
6
- On databases where Rodauth supports the use of database authentication
7
- functions, Rodauth also supports the use of database functions for checking
8
- previous passwords, so previous password hashes enjoy the same database
9
- security as current password hashes.
10
-
11
- It is not recommended to use this feature unless you have a policy that
12
- requires it. This will significantly slow down setting a new password
13
- due to the need to check all of the previous stored passwords. Additionally,
14
- storing previous passwords means that if attackers can get access to the
15
- the database, they can get the previous stored passwords in addition to the
16
- current password.
17
-
18
- == Auth Value Methods
19
-
20
- password_same_as_previous_password_message :: The error message fragment to display if the given password is the same as a previous password.
21
- previous_password_account_id_column :: The column in the +previous_password_hash_table+ that stores the account id.
22
- previous_password_hash_column :: The column in the +previous_password_hash_table+ that stores the password hash.
23
- previous_password_hash_table :: The table storing previous password hashes.
24
- previous_password_id_column :: The column in the +previous_password_hash_table+ that stores the autoincrementing primary key.
25
- previous_passwords_to_check :: The number of previous password hashes to store and check.
26
-
27
- == Auth Methods
28
-
29
- add_previous_password_hash(hash) :: Add the given hash to the list of previous hashes for the current account.
30
- password_doesnt_match_previous_password?(password) :: Whether the password given matches any of the previous passwords.
data/doc/email_auth.rdoc DELETED
@@ -1,55 +0,0 @@
1
- = Documentation for Email Auth Feature
2
-
3
- The email auth feature implements passwordless login using links sent via email. It is
4
- similar to the reset password feature, except you don't need to update
5
- a password, or even have a password to login. It depends on the login and
6
- email_base features.
7
-
8
- == Auth Value Methods
9
-
10
- email_auth_additional_form_tags :: HTML fragment containing additional form tags to use on the email auth login form.
11
- email_auth_deadline_column :: The column name in the +email_auth_table+ storing the deadline after which the token will be ignored.
12
- email_auth_deadline_interval :: The amount of time for which to allow users to use email auth keys, 1 day by default. Only used if set_deadline_values? is true.
13
- email_auth_email_last_sent_column :: The email auth last sent column in the +email_auth_table+, storing the last time the email was sent. Set to nil to always send an email when requested.
14
- email_auth_email_recently_sent_error_flash :: The flash error to show if not sending an email auth email because another was sent recently.
15
- email_auth_email_recently_sent_redirect :: Where to redirect after not sending an email auth email because another was sent recently.
16
- email_auth_email_sent_notice_flash :: The flash notice to show after an email auth email has been sent.
17
- email_auth_email_sent_redirect :: Where to redirect after sending an email auth email.
18
- email_auth_email_subject :: The subject to use for email auth emails.
19
- email_auth_error_flash :: The flash error to show if unable to login using email authentication.
20
- email_auth_id_column :: The id column in the +email_auth_table+, should be a foreign key referencing the accounts table.
21
- email_auth_key_column :: The email auth key/token column in the +email_auth_table+.
22
- email_auth_key_param :: The parameter name to use for the email auth key.
23
- email_auth_page_title :: The page title to use on the email auth form.
24
- email_auth_request_additional_form_tags :: HTML fragment containing additional form tags to use on the email auth request form.
25
- email_auth_request_button :: The text to use for the email auth request button.
26
- email_auth_request_error_flash :: The flash error to show if not able to send an email auth email.
27
- email_auth_request_route :: The route to the email auth request action. Defaults to +email-auth-request+.
28
- email_auth_route :: The route to the email auth action. Defaults to +email-auth+.
29
- email_auth_session_key :: The key in the session to hold the email auth key temporarily.
30
- email_auth_skip_resend_email_within :: The number of seconds required before sending another email auth email, 5 minutes by default.
31
- email_auth_table :: The name of the table storing email auth keys.
32
- force_email_auth? :: Whether email auth should be forced for the account. False by default, which results in email auth only be used automatically if the account does not have a password.
33
- no_matching_email_auth_key_error_flash :: The flash error message to show if attempting to access the email auth form with an invalid key.
34
-
35
- == Auth Methods
36
-
37
- account_from_email_auth_key(key) :: Retrieve the account using the given email auth key, or return nil if no account matches.
38
- after_email_auth_request :: Run arbitrary code after sending the email auth email.
39
- before_email_auth_request :: Run arbitrary code before sending the email auth email.
40
- before_email_auth_request_route :: Run arbitrary code before handling an email auth request route.
41
- before_email_auth_route :: Run arbitrary code before handling an email auth route.
42
- create_email_auth_email :: A Mail::Message for the email auth email.
43
- create_email_auth_key :: Add the email auth key data to the database.
44
- email_auth_email_body :: The body to use for the email auth email.
45
- email_auth_email_link :: The link to the email auth form in the email auth email.
46
- email_auth_email_sent_response :: Return a response after successfully sending an email auth email. By default, redirects to +email_auth_email_sent_redirect+.
47
- email_auth_key_insert_hash :: The hash to insert into the +email_auth_table+.
48
- email_auth_key_value :: The email auth key for the current account.
49
- email_auth_request_form :: The HTML to use for a form to request an email auth email, shown on the login page after the user submits their login, if +force_email_auth?+ is false and email authentication is not the only possible for of authentication for the user.
50
- email_auth_view :: The HTML to use for the email auth form.
51
- get_email_auth_email_last_sent :: Get the last time an email auth email is sent, or nil if there is no last sent time.
52
- get_email_auth_key(id) :: Get the email auth key for the given account id from the database.
53
- remove_email_auth_key :: Remove the email auth key for the current account, run after successful email auth.
54
- send_email_auth_email :: Send the email auth email.
55
- set_email_auth_email_last_sent :: Set the last time an email auth email is sent. This is only called if there is a previous email auth token still active.
data/doc/email_base.rdoc DELETED
@@ -1,18 +0,0 @@
1
- = Documentation for Email Base Feature
2
-
3
- The email base feature is automatically loaded when you use a Rodauth feature
4
- that requires sending emails.
5
-
6
- == Auth Value Methods
7
-
8
- allow_raw_email_token? :: When +hmac_secret+ is used, this allows the use of the raw token. This should only be set to true temporarily during a transition period from using raw tokens to using HMACed tokens. After the transition period, this should not be set, as setting this to true removes the security that HMACed tokens add.
9
- default_post_email_redirect :: Where to redirect after sending an email. This is the default redirect location for all redirects after an email is sent when the account is not logged in. Also includes cases where an email is not sent due to rate limiting.
10
- email_from :: The from address to use for emails sent by Rodauth.
11
- email_subject_prefix :: The prefix to use for email subjects
12
- require_mail? :: Set to false to not require mail, useful if using a different library for sending email.
13
-
14
- == Auth Methods
15
-
16
- create_email(subject, body) :: Return a Mail::Message instance with the given subject and body.
17
- email_to :: The email address to send emails to, by default the login of the current account.
18
- send_email(email) :: Deliver a given Mail::Message instance.