rodauth 2.7.0 → 2.12.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ce2af7161a7aaba17ebb25beda65f8598306b2d040986db0be215b89fb683149
4
- data.tar.gz: cf69c788c9401485610599f0b6996f340ab315fcbceb359bccf01a78dceaadc8
3
+ metadata.gz: 453992f6df1e1a41e30923334f53146ddd575015f57960dcdadb2b3d4bc496e9
4
+ data.tar.gz: 29172b14c9a5c6d88e36c827c4fbc9e4f61fbadadf6b656734ef7058e9dd4a13
5
5
  SHA512:
6
- metadata.gz: 8b2d72d0f9338a359653e90829618f2579afc30095bb0dd1bd0c627730c91117158ef5ebbca9a4a32bb78bd312ebbac308a68efb761cf93c4dfc707d7bdcea24
7
- data.tar.gz: d5eb1fc01df26b8305edec707642d3192e7a5dc3507416d0e60aaf6ffd1b079ac4ddced72a85d61c4623c70df2d784307cfba60b8759741b2991f591c623b0b0
6
+ metadata.gz: 956d8809e6ba87044e5aeba7712cc4e907604a632d7113084cda074bf675952fb4e3081cca5adf19a191df6d073e2b9068a313d8d26e81534b70f9eaba20688e
7
+ data.tar.gz: aaa0cde299ba115ea281bc18dfe5f02a0d2b35dd95231d9e69662ec340194569a288be916abb2fe0e258c50599c6ea6ef42791824f986d6dc2e295f5db67645a
data/CHANGELOG CHANGED
@@ -1,3 +1,37 @@
1
+ === 2.12.0 (2021-04-22)
2
+
3
+ * Add configuration methods to active_sessions plugin to control the inserting and updating of rows (janko) (#159)
4
+
5
+ === 2.11.0 (2021-03-22)
6
+
7
+ * Add same_as_current_login_message and contains_null_byte_message configuration methods to increase translatability (dmitryzuev) (#158)
8
+
9
+ * Allow the rodauth plugin to be loaded without a block (janko) (#157)
10
+
11
+ * Use new-password autocomplete value for the password fields on the reset password form (basabin54) (#155)
12
+
13
+ * Support :auth_class plugin option, to use a specific class instead of creating a Rodauth::Auth subclass (janko) (#153)
14
+
15
+ * Make Rodauth configuration work correctly if the rodauth plugin is loaded more than once (janko) (#152)
16
+
17
+ === 2.10.0 (2021-02-22)
18
+
19
+ * Add argon2 feature to allow use of the argon2 password hash algorithm instead of bcrypt (AlexeyMatskevich, jeremyevans) (#147)
20
+
21
+ * Avoid unnecessary previous password queries when using disallow_password_reuse feature with create_account or verify_account features (AlexeyMatskevich, jeremyevans) (#148)
22
+
23
+ === 2.9.0 (2021-01-22)
24
+
25
+ * Split jwt feature into json and jwt features, with the json feature using standard session support (janko, jeremyevans) (#145)
26
+
27
+ * Mark remember cookie as only transmitted over HTTPS by default if created via an HTTPS request (janko) (#144)
28
+
29
+ === 2.8.0 (2021-01-06)
30
+
31
+ * [SECURITY] Set HttpOnly on remember cookie by default so it cannot be accessed by Javascript (janko) (#142)
32
+
33
+ * Clear JWT session when rodauth.clear_session is called if the Roda sessions plugin is used (janko) (#140)
34
+
1
35
  === 2.7.0 (2020-12-22)
2
36
 
3
37
  * Avoid method redefinition warnings in verbose warning mode (jeremyevans)
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2015-2020 Jeremy Evans
1
+ Copyright (c) 2015-2021 Jeremy Evans
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to
data/README.rdoc CHANGED
@@ -52,10 +52,12 @@ HTML and JSON API for all supported features.
52
52
  * Session Expiration
53
53
  * Active Sessions (Prevent session reuse after logout, allow logout of all sessions)
54
54
  * Single Session (Only one active session per account)
55
- * JWT (JSON API support for all other features)
55
+ * JSON (JSON API support for all other features)
56
+ * JWT (JSON Web Token support for all other features)
56
57
  * JWT Refresh (Access & Refresh Token)
57
58
  * JWT CORS (Cross-Origin Resource Sharing)
58
59
  * Update Password Hash (when hash cost changes)
60
+ * Argon2
59
61
  * HTTP Basic Auth
60
62
  * Change Password Notify
61
63
 
@@ -79,8 +81,10 @@ rack_csrf :: Used for CSRF support if the :csrf=>:rack_csrf plugin
79
81
  option is given (the default is to use Roda's route_csrf
80
82
  plugin, as that allows for more secure request-specific
81
83
  tokens).
82
- bcrypt :: Used by default for password matching, can be skipped
84
+ bcrypt :: Used by default for password hashing, can be skipped
83
85
  if password_match? is overridden for custom authentication.
86
+ argon2 :: Used by the argon2 feature as alternative to bcrypt for
87
+ password hashing.
84
88
  mail :: Used by default for mailing in the reset password, verify
85
89
  account, verify_login_change, change_password_notify,
86
90
  lockout, and email_auth features.
@@ -105,7 +109,7 @@ correctly without it. There may be cases where you cannot use
105
109
  this feature, such as when using a different database or when you
106
110
  do not have full control over the database you are using.
107
111
 
108
- Passwords are hashed using bcrypt, and the password hashes are
112
+ Passwords are hashed using bcrypt by default, and the password hashes are
109
113
  kept in a separate table from the accounts table, with a foreign key
110
114
  referencing the accounts table. Two database functions are added,
111
115
  one to retrieve the salt for a password, and the other to check
@@ -332,7 +336,7 @@ things for the schema changes:
332
336
  foreign_key :id, Sequel[:${DATABASE_NAME}][:accounts], :primary_key=>true, :type=>:Bignum
333
337
  String :password_hash, :null=>false
334
338
  end
335
- Rodauth.create_database_authentication_functions(self, :table_name=>"${DATABASE_NAME}_password.account_password_hashes")
339
+ Rodauth.create_database_authentication_functions(self, :table_name=>Sequel[:${DATABASE_NAME}_password][:account_password_hashes])
336
340
 
337
341
  # if using the disallow_password_reuse feature:
338
342
  create_table(:account_previous_password_hashes) do
@@ -340,7 +344,7 @@ things for the schema changes:
340
344
  foreign_key :account_id, Sequel[:${DATABASE_NAME}][:accounts], :type=>:Bignum
341
345
  String :password_hash, :null=>false
342
346
  end
343
- Rodauth.create_database_previous_password_check_functions(self, :table_name=>"${DATABASE_NAME}_password.account_previous_password_hashes")
347
+ Rodauth.create_database_previous_password_check_functions(self, :table_name=>Sequel[:${DATABASE_NAME}_password][:account_previous_password_hashes])
344
348
 
345
349
  You'll also need to use the following Rodauth configuration methods so that the
346
350
  app account calls functions in a separate schema:
@@ -848,6 +852,9 @@ which configures which dependent plugins should be loaded. Options:
848
852
  still need to load the render plugin manually.
849
853
  :name :: Provide a name for the given Rodauth configuration, used to
850
854
  support multiple Rodauth configurations in a given Roda application.
855
+ :auth_class :: Provide a specific Rodauth::Auth subclass that should be set
856
+ on the Roda application. By default, an anonymous
857
+ Rodauth::Auth subclass is created.
851
858
 
852
859
  === Feature Documentation
853
860
 
@@ -862,6 +869,7 @@ view the appropriate file in the doc directory.
862
869
  * {Account Expiration}[rdoc-ref:doc/account_expiration.rdoc]
863
870
  * {Active Sessions}[rdoc-ref:doc/active_sessions.rdoc]
864
871
  * {Audit Logging}[rdoc-ref:doc/audit_logging.rdoc]
872
+ * {Argon2}[rdoc-ref:doc/argon2.rdoc]
865
873
  * {Change Login}[rdoc-ref:doc/change_login.rdoc]
866
874
  * {Change Password}[rdoc-ref:doc/change_password.rdoc]
867
875
  * {Change Password Notify}[rdoc-ref:doc/change_password_notify.rdoc]
@@ -872,6 +880,7 @@ view the appropriate file in the doc directory.
872
880
  * {Disallow Password Reuse}[rdoc-ref:doc/disallow_password_reuse.rdoc]
873
881
  * {Email Authentication}[rdoc-ref:doc/email_auth.rdoc]
874
882
  * {HTTP Basic Auth}[rdoc-ref:doc/http_basic_auth.rdoc]
883
+ * {JSON}[rdoc-ref:doc/json.rdoc]
875
884
  * {JWT CORS}[rdoc-ref:doc/jwt_cors.rdoc]
876
885
  * {JWT Refresh}[rdoc-ref:doc/jwt_refresh.rdoc]
877
886
  * {JWT}[rdoc-ref:doc/jwt.rdoc]
@@ -1320,7 +1329,13 @@ use the necessary *_email_body configuration options to specify
1320
1329
  the body of the emails.
1321
1330
 
1322
1331
  The JWT feature enables JSON API support for all of the other features
1323
- that Rodauth ships with.
1332
+ that Rodauth ships with. If you would like JSON API access that still uses
1333
+ rack session for storing session data, enable the JSON feature instead:
1334
+
1335
+ plugin :rodauth, :json=>true do
1336
+ enable :login, :logout, :json
1337
+ only_json? true # if you want to only handle JSON requests
1338
+ end
1324
1339
 
1325
1340
  === Adding Custom Methods to the +rodauth+ Object
1326
1341
 
@@ -37,9 +37,13 @@ inactive_session_error_status :: The error status to use when a JSON request is
37
37
  session_id_session_key :: The session key name to use for storing the session id.
38
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
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.
40
41
 
41
42
  == Auth Methods
42
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.
43
47
  add_active_session :: Create a session id for the session and populate the session and add the session id to the database.
44
48
  currently_active_session? :: Whether the session is currently active, by checking the database table.
45
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.
data/doc/argon2.rdoc ADDED
@@ -0,0 +1,49 @@
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, if you are storing
6
+ password hashes in a table that the database user does not have access to
7
+ (the recommended way to use Rodauth), argon2 does not offer significant
8
+ security advantages over bcrypt.
9
+
10
+ If you are using this feature with Rodauth's database authentication functions,
11
+ you need to make sure that the database authentication functions are configured
12
+ to support argon2 in addition to bcrypt. You can do this by passing the
13
+ +:argon2+ option when calling the method to define the database functions.
14
+ In this example, +DB+ should be your Sequel::Database object:
15
+
16
+ require 'rodauth/migrations'
17
+
18
+ # If the functions are already defined and you are not using PostgreSQL,
19
+ # you need to drop the existing functions.
20
+ Rodauth.drop_database_authentication_functions(DB)
21
+
22
+ # If you are using the disallow_password_reuse feature, also drop the
23
+ # database functions related to that if not using PostgreSQL:
24
+ Rodauth.drop_database_previous_password_check_functions(DB)
25
+
26
+ # Define new functions that support argon2:
27
+ Rodauth.create_database_authentication_functions(DB, argon2: true)
28
+
29
+ # If you are using the disallow_password_reuse feature, also define
30
+ # new functions that support argon2 for that:
31
+ Rodauth.create_database_previous_password_check_functions(DB, argon2: true)
32
+
33
+ The argon2 feature provides the ability to allow for a gradual migration
34
+ from transitioning from bcrypt to argon2 and vice-versa, if you are using the
35
+ update_password_hash.
36
+
37
+ Argon2 is more configurable than bcrypt in terms of password hash cost
38
+ speficiation. Instead of specifying the password_hash_cost value as
39
+ an integer, you must specify the password hash cost as a hash, such as
40
+ (<tt>{t_cost: 2, m_cost: 16}</tt>).
41
+
42
+ If you are using the argon2 feature and if you have no bcrypt passwords in
43
+ your database, you should use <tt>require_bcrypt? false</tt> in your
44
+ Rodauth configuration to prevent loading the bcrypt library, which will save
45
+ memory.
46
+
47
+ == Auth Value Methods
48
+
49
+ 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.
data/doc/base.rdoc CHANGED
@@ -15,7 +15,7 @@ domain :: The domain to use, required by some other features. It is recommended
15
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
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
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.
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
19
  session_key :: The key in the session hash storing the primary key of the logged in account.
20
20
  session_key_prefix :: The string that will be prepended to the default value for all session keys.
21
21
  skip_status_checks? :: Whether status checks should be skipped for accounts. Defaults to true unless enabling the verify_account or close_account features.
@@ -13,6 +13,7 @@ change_login_page_title :: The page title to use on the change login form.
13
13
  change_login_redirect :: Where to redirect after a sucessful login change.
14
14
  change_login_requires_password? :: Whether a password is required when changing logins.
15
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.
16
17
 
17
18
  == Auth Methods
18
19
 
@@ -0,0 +1,15 @@
1
+ = Migrate users passwords from bcrypt to argon2 or back
2
+
3
+ If you are currently using the default bcrypt password hash algorithm, and want to
4
+ gradually migrate to the argon2 password hash algorithm, you can use both the argon2
5
+ and update_password_hash features:
6
+
7
+ plugin :rodauth do
8
+ enable :login, :update_password_hash, :argon2
9
+ end
10
+
11
+ When a user with a current bcrypt password hash next successfully uses their
12
+ password, their password hash will be migrated to argon2.
13
+
14
+ If for some reason you want to migrate back from argon2 to bcrypt, you can set
15
+ <tt>use_argon2? false</tt> in your Rodauth configuration.
data/doc/json.rdoc ADDED
@@ -0,0 +1,47 @@
1
+ = Documentation for JSON Feature
2
+
3
+ The json feature adds support for JSON API access for all other
4
+ features that ship with Rodauth.
5
+
6
+ When this feature is used, all other features become accessible via a
7
+ JSON API. The JSON API uses the POST method for all requests, using
8
+ the same parameter names as the features uses. JSON API requests to
9
+ Rodauth endpoints that use a method other than POST will result in a
10
+ 405 Method Not Allowed response.
11
+
12
+ Responses are returned as JSON hashes. In case of an error, the +error+
13
+ entry is set to an error message, and the <tt>field-error</tt> entry is set to
14
+ an array containing the field name and the error message for that field.
15
+ Successful requests by default store a +success+ entry with a success
16
+ message, though that can be disabled.
17
+
18
+ The session state is managed in the rack session, so make sure that
19
+ CSRF protection is enabled. This will be the case when passing the
20
+ <tt>json: true</tt> option when loading the rodauth plugin. If you
21
+ want to only handle JSON requests, set <tt>only_json? true</tt> in
22
+ your rodauth configuration.
23
+
24
+ If you want token-based authentication sent via the Authorization
25
+ header, consider using the jwt feature.
26
+
27
+ == Auth Value Methods
28
+
29
+ json_accept_regexp :: The regexp to use to check the Accept header for JSON if +json_check_accept?+ is true.
30
+ json_check_accept? :: Whether to check the Accept header to see if the client supports JSON responses, true by default.
31
+ json_non_post_error_message :: The error message to use when a JSON non-POST request is sent.
32
+ json_not_accepted_error_message :: The error message to display if +json_check_accept?+ is true and the Accept header is present but does not match +json_request_content_type_regexp+.
33
+ json_request_content_type_regexp :: The regexp to use to recognize a request as a json request.
34
+ json_response_content_type :: The content type to set for json responses, <tt>application/json</tt> by default.
35
+ json_response_custom_error_status? :: Whether to use custom error statuses, instead of always using +json_response_error_status+, true by default, can be set to false for backwards compatibility with Rodauth 1.
36
+ json_response_error_key :: The JSON result key containing an error message, +error+ by default.
37
+ json_response_error_status :: The HTTP status code to use for JSON error responses if not using custom error statuses, 400 by default.
38
+ json_response_field_error_key :: The JSON result key containing an field error message, <tt>field-error</tt> by default.
39
+ json_response_success_key :: The JSON result key containing a success message for successful request, if set. +success+ by default.
40
+ non_json_request_error_message :: The error message to use when a non-JSON request is sent and +only_json?+ is set.
41
+ only_json? :: Whether to have Rodauth only allow JSON requests. True by default if <tt>json: :only</tt> option was given when loading the plugin. If set, rodauth endpoints will issue an error for non-JSON requests.
42
+ use_json? :: Whether to return a JSON response. By default, a JSON response is returned if +only_json?+ is true, or if the request uses a json content type.
43
+
44
+ == Auth Methods
45
+
46
+ json_request? :: Whether the current request is a JSON request, looks at the Content-Type request header by default.
47
+ json_response_body(hash) :: The body to use for JSON response. By default just converts hash to JSON. Can be used to reformat JSON output in arbitrary ways.
data/doc/jwt.rdoc CHANGED
@@ -2,19 +2,7 @@
2
2
 
3
3
  The jwt feature adds support for JSON API access for all other features
4
4
  that ship with Rodauth, using JWT (JSON Web Tokens) to hold the
5
- session information.
6
-
7
- When this feature is used, all other features become accessible via a
8
- JSON API. The JSON API uses the POST method for all requests, using
9
- the same parameter names as the features uses. JSON API requests to
10
- Rodauth endpoints that use a method other than POST will result in a
11
- 405 Method Not Allowed response.
12
-
13
- Responses are returned as JSON hashes. In case of an error, the +error+
14
- entry is set to an error message, and the <tt>field-error</tt> entry is set to
15
- an array containing the field name and the error message for that field.
16
- Successful requests by default store a +success+ entry with a success
17
- message, though that can be disabled.
5
+ session information. It depends on the json feature.
18
6
 
19
7
  In order to use this feature, you have to set the +jwt_secret+ configuration
20
8
  option the secret used to cryptographically protect the token.
@@ -41,32 +29,17 @@ from +rodauth.session+.
41
29
  == Auth Value Methods
42
30
 
43
31
  invalid_jwt_format_error_message :: The error message to use when a JWT with an invalid format is submitted in the Authorization header.
44
- json_accept_regexp :: The regexp to use to check the Accept header for JSON if +jwt_check_accept?+ is true.
45
- json_non_post_error_message :: The error message to use when a JSON non-POST request is sent.
46
- json_not_accepted_error_message :: The error message to display if +jwt_check_accept?+ is true and the Accept header is present but does not match +json_request_content_type_regexp+.
47
- json_request_content_type_regexp :: The regexp to use to recognize a request as a json request.
48
- json_response_content_type :: The content type to set for json responses, <tt>application/json</tt> by default.
49
- json_response_custom_error_status? :: Whether to use custom error statuses, instead of always using +json_response_error_status+, true by default, can be set to false for backwards compatibility with Rodauth 1.
50
- json_response_error_key :: The JSON result key containing an error message, +error+ by default.
51
- json_response_error_status :: The HTTP status code to use for JSON error responses if not using custom error statuses, 400 by default.
52
- json_response_field_error_key :: The JSON result key containing an field error message, <tt>field-error</tt> by default.
53
- json_response_success_key :: The JSON result key containing a success message for successful request, if set. +success+ by default.
54
32
  jwt_algorithm :: The JWT algorithm to use, +HS256+ by default.
55
33
  jwt_authorization_ignore :: A regexp matched against the Authorization header, which skips JWT processing if it matches. By default, HTTP Basic and Digest authentication are ignored.
56
34
  jwt_authorization_remove :: A regexp to remove from the Authorization header before processing the JWT. By default, a Bearer prefix is removed.
57
- jwt_check_accept? :: Whether to check the Accept header to see if the client supports JSON responses, true by default, can be set to false for backwards compatibility with Rodauth 1.
58
35
  jwt_decode_opts :: An optional hash to pass to +JWT.decode+. Can be used to set JWT verifiers.
59
36
  jwt_secret :: The JWT secret to use. Access to this should be protected the same as a session secret.
60
37
  jwt_session_key :: A key to nest the session hash under in the JWT payload. nil by default, for no nesting.
61
38
  jwt_symbolize_deeply? :: Whether to symbolize the session hash deeply. false by default.
62
- non_json_request_error_message :: The error message to use when a non-JSON request is sent and +only_json?+ is set.
63
- only_json? :: Whether to have Rodauth only allow JSON requests. True by default if <tt>json: :only</tt> option was given when loading the plugin. If set, rodauth endpoints will issue an error for non-JSON requests.
64
39
  use_jwt? :: Whether to use the JWT in the Authorization header for authentication information. If false, falls back to using the rack session. By default, the Authorization header is used if it is present, if +only_json?+ is true, or if the request uses a json content type.
65
40
 
66
41
  == Auth Methods
67
42
 
68
- json_request? :: Whether the current request is a JSON request, looks at the Content-Type request header by default.
69
- json_response_body(hash) :: The body to use for JSON response. By default just converts hash to JSON. Can be used to reformat JSON output in arbitrary ways.
70
43
  jwt_session_hash :: The session hash used to create the session_jwt. Can be used to set JWT claims.
71
44
  jwt_token :: Retrieve the JWT token from the request, by default taking it from the Authorization header.
72
45
  session_jwt :: An encoded JWT for the current session.
@@ -6,6 +6,7 @@ use a Rodauth feature that requires setting logins or passwords.
6
6
  == Auth Value Methods
7
7
 
8
8
  already_an_account_with_this_login_message :: The error message to display when there already exists an account with the same login.
9
+ contains_null_byte_message :: The error message to display when the password contains a null byte.
9
10
  login_confirm_label :: The label to use for login confirmations.
10
11
  login_confirm_param :: The parameter name to use for login confirmations.
11
12
  login_does_not_meet_requirements_message :: The error message to display when the login does not meet the requirements you have set.
@@ -19,7 +20,7 @@ logins_do_not_match_message :: The error message to display when login and login
19
20
  password_confirm_label :: The label to use for password confirmations.
20
21
  password_confirm_param :: The parameter name to use for password confirmations.
21
22
  password_does_not_meet_requirements_message :: The error message to display when the password does not meet the requirements you have set.
22
- password_hash_cost :: The bcrypt cost to use for the password hash.
23
+ password_hash_cost :: The cost to use for the password hash algorithm. This should be an integer when using bcrypt (the default), and a hash if using argon2 (supported by the argon2 feature).
23
24
  password_minimum_length :: The minimum length for passwords, 6 by default.
24
25
  password_too_short_message :: The error message fragment to show if the password is too short.
25
26
  passwords_do_not_match_message :: The error message to display when password and password confirmation do not match.
@@ -0,0 +1,47 @@
1
+ = New Features
2
+
3
+ * An argon2 feature has been added that supports using the argon2
4
+ password hashing algorithm instead of the bcrypt password hashing
5
+ algorithm. While argon2 does not provide an advantage over bcrypt
6
+ if the attacker cannot access the password hashes directly (which
7
+ is how Rodauth is recommended to be used), in cases where attackers
8
+ can access the password hashes directly, argon2 is thought to be
9
+ more difficult or expensive to crack due to requiring more memory
10
+ (bcrypt is not a memory-hard password hash algorithm).
11
+
12
+ If you are using this feature with Rodauth's database authentication
13
+ functions, you need to make sure that the database authentication
14
+ functions are configured to support argon2 in addition to bcrypt.
15
+ You can do this by passing the :argon2 option when calling the
16
+ method to define the database functions. In this example, DB should
17
+ be your Sequel::Database object (this could be self if used in a
18
+ Sequel migration):
19
+
20
+ require 'rodauth/migrations'
21
+
22
+ # If the functions are already defined and you are not using PostgreSQL,
23
+ # you need to drop the existing functions.
24
+ Rodauth.drop_database_authentication_functions(DB)
25
+
26
+ # If you are using the disallow_password_reuse feature, also drop the
27
+ # database functions related to that if you are not using PostgreSQL:
28
+ Rodauth.drop_database_previous_password_check_functions(DB)
29
+
30
+ # Define new functions that support argon2:
31
+ Rodauth.create_database_authentication_functions(DB, argon2: true)
32
+
33
+ # If you are using the disallow_password_reuse feature, also define
34
+ # new functions that support argon2 for that:
35
+ Rodauth.create_database_previous_password_check_functions(DB, argon2: true)
36
+
37
+ You can transparently migrate bcrypt password hashes to argon2
38
+ password hashes whenever a user successfully uses their password
39
+ by using the argon2 feature in combination with the
40
+ update_password_hash feature.
41
+
42
+ = Other Improvements
43
+
44
+ * Unnecessary queries to determine whether the new password matches
45
+ a previous password are now skipped when using the create_account
46
+ or verify_account features with the disallow_password_reuse
47
+ feature.
@@ -0,0 +1,31 @@
1
+ = New Features
2
+
3
+ * An :auth_class rodauth plugin option has been added, allowing a user
4
+ to specify a specific Rodauth::Auth subclass to use, instead of
5
+ always using a new subclass of Rodauth::Auth. This is designed for
6
+ advanced configurations or other frameworks that build on top of
7
+ Rodauth, which may want to customize the Rodauth::Auth subclasses to
8
+ use.
9
+
10
+ * Two additional configuration methods have been added for easier
11
+ translatability, fixing issues where English text was hardcoded:
12
+
13
+ * same_as_current_login_message (change_login feature)
14
+ * contains_null_byte_message (login_password_requirements_base
15
+ feature)
16
+
17
+ = Other Improvements
18
+
19
+ * Loading the rodauth plugin multiple times in the same application
20
+ with different blocks now works better. The same context is now
21
+ shared between the blocks, so you can load features in one block
22
+ and call configuration methods added by the feature in the other
23
+ block. Previously, you could only call configuration methods in
24
+ the block that added the feature, and enabling a feature in a
25
+ block that was already enabled in a previous block did not allow
26
+ the use of configuration methods related to the feature.
27
+
28
+ * Passing a block when loading the rodauth plugin is now optional.
29
+
30
+ * The autocomplete attribute on the reset password form now uses
31
+ new-password instead of current-password.