Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strip out Enable/Disable #568

Merged
merged 5 commits into from
Jul 27, 2022
Merged

Strip out Enable/Disable #568

merged 5 commits into from
Jul 27, 2022

Conversation

J0
Copy link
Contributor

@J0 J0 commented Jul 27, 2022

What kind of change does this PR introduce?

Strips out the /enable and /disable routes on MFA as they are no longer relevant. Whether or not a user has MFA enabled will be determined by whether a user has >= 1 verified factors linked to their account.

Also contains the changes from Karl's PR to speed up tests so that they can be used within the MFA branch

What is the current behavior?

There are /enable and /disable routes which allow a user to toggle whether or not they can use factor related routes

What is the new behavior?

Feel free to include screenshots if it includes visual changes.

Additional context

We still need to strip out the notion of MFAEnabled on a user as well as on the DB as well as the user model but that will be done on a follow up PR as it affects most all of the methods and will be huge.

The implementation order for refactoring will be:

  • Remove the /enable and /disable routes
  • Change the route structure
  • Remove or substitute the notion of MFAEnabled and instead check if there is a verified factor for relevant endpoints.

karlseguin and others added 5 commits July 26, 2022 14:10
On a not-so-good laptop, a full test run went from ~90seconds to less
than 10. Three independent changes were made:

1 - In TruncateAll, use `delete from` instead of `truncate`. While
  truncate is faster for large tables, for small tables, it has
considerably more overhead (my understanding is that delete just flags
the tuple as dead, whereas truncate involves a vacuum-like operation).

2 - In tests, use bcrypt.MinCost instead of bcrypt.DefaultCost

3 - Use a 10 millisecond timeout, instead of 1 second timeout, for
TestHookTimeout
@J0 J0 requested review from inian, hf and kangmingtay July 27, 2022 06:31
@J0 J0 merged commit 3274e85 into mfa Jul 27, 2022
@J0 J0 deleted the j0_refactor_endpoint_routes branch July 27, 2022 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants