rails/activerecord/test/schema
Jonathan Hefner 9becc41df9 Add authenticate_by when using has_secure_password
This method is intended to replace code like the following, which
returns early when a user with a matching email is not found:

```ruby
User.find_by(email: "...")&.authenticate("...")
```

Such code is vulnerable to timing-based enumeration attacks, wherein an
attacker can determine if a user account with a given email exists.
After confirming that an account exists, the attacker can try passwords
associated with that email address from other leaked databases, in case
the user re-used a password across multiple sites (a common practice).
Additionally, knowing an account email address allows the attacker to
attempt a targeted phishing ("spear phishing") attack.

`authenticate_by` addresses the vulnerability by taking the same amount
of time regardless of whether a user with a matching email is found.
2021-12-03 10:06:43 -06:00
..
mysql2_specific_schema.rb Fix "Specified key was too long; max key length is 1000 bytes (Mysql2::Error)" 2021-10-14 15:43:52 +09:00
oracle_specific_schema.rb Use squiggly heredoc to strip odd indentation in the executed SQL 2018-11-22 19:43:53 +09:00
postgresql_specific_schema.rb PostgreSQL: handle timestamp with time zone columns correctly in schema.rb 2021-02-10 10:59:31 -07:00
schema.rb Add authenticate_by when using has_secure_password 2021-12-03 10:06:43 -06:00
sqlite_specific_schema.rb add mysql and sqlite3 default test 2018-09-01 22:09:01 -04:00