Conversation
There was a problem hiding this comment.
Are we confident that none of these are used by the two_factor_authentication gem? I was under the impression that was why we had these under the "devise" key.
There was a problem hiding this comment.
Yep. None of these are triggered by our app because we basically don't use any of the gem's controller: https://github.com/Houdini/two_factor_authentication/blob/master/config/locales/en.yml
There was a problem hiding this comment.
Cool. I wonder at what point we should just extract the gem since with the multiple phone configurations presumably we won't be using the model code either?
There was a problem hiding this comment.
Not suggesting we do that here, of course. Just wondering.
There was a problem hiding this comment.
Yeah, that will probably need to happen at some point. It would be great if we wrote our own gem.
**Why**: The Devise locale folder is for Devise-specific strings. None of the strings we had under the `two_factor_authentication` section were related to Devise. We have a separate folder for 2FA localizations: `config/locales/two_factor_authentication` **How**: - Cut and paste anything under `devise.two_factor_authentication` into the `two_factor_authentication` folder - Run `make normalize_yaml` - Do a search and replace for `devise.two_factor_authentication` with `two_factor_authentication`
Why: The Devise locale folder is for Devise-specific strings. None
of the strings we had under the
two_factor_authenticationsectionwere related to Devise. We have a separate folder for 2FA localizations:
config/locales/two_factor_authenticationHow:
devise.two_factor_authenticationinto the
two_factor_authenticationfoldermake normalize_yamldevise.two_factor_authenticationwithtwo_factor_authenticationHi! Before submitting your PR for review, and/or before merging it, please
go through the checklists below. These represent the more critical elements
of our code quality guidelines. The rest of the list can be found in
CONTRIBUTING.md
When adding a new controller that requires the user to be fully
authenticated, make sure to add
before_action :confirm_two_factor_authenticatedas the first callback.
Unsafe migrations are implemented over several PRs and over several
deploys to avoid production errors. The strong_migrations gem
will warn you about unsafe migrations and has great step-by-step instructions
for various scenarios.
Indexes were added if necessary. This article provides a good overview
of indexes in Rails.
Verified that the changes don't affect other apps (such as the dashboard)
When relevant, a rake task is created to populate the necessary DB columns
in the various environments right before deploying, taking into account the users
who might not have interacted with this column yet (such as users who have not
set a password yet)
Migrations against existing tables have been tested against a copy of the
production database. See LG-228 Make migrations safer and more resilient #2127 for an example when a migration caused deployment
issues. In that case, all the migration did was add a new column and an index to
the Users table, which might seem innocuous.
The changes are compatible with data that was encrypted with the old code.
GET requests are not vulnerable to CSRF attacks (i.e. they don't change
state or result in destructive behavior).
When adding user data to the session, use the
user_sessionhelperinstead of the
sessionhelper so the data does not persist beyond the user'ssession.
Tests added for this feature/bug
Prefer feature/integration specs over controller specs
When adding code that reads data, write tests for nil values, empty strings,
and invalid inputs.