Skip to content

Order two_factor_enabled short-circuiting by usage#10310

Merged
aduth merged 2 commits intomainfrom
aduth-2fa-enabled-usage
Mar 26, 2024
Merged

Order two_factor_enabled short-circuiting by usage#10310
aduth merged 2 commits intomainfrom
aduth-2fa-enabled-usage

Conversation

@aduth
Copy link
Contributor

@aduth aduth commented Mar 26, 2024

🛠 Summary of changes

Reorders checks in MfaContext#two_factor_enabled? to assure higher likelihood of short-circuiting, based on setup rates for common MFAs.

CloudWatch query:

filter name = 'Multi-Factor Authentication Setup'
| stats count(*) as method_count by properties.event_properties.multi_factor_auth_method
| sort method_count desc

📜 Testing Plan

This performs the same checks so it shouldn't have any notable effects.

Verify associated specs pass:

rspec spec/decorators/mfa_context_spec.rb

aduth added 2 commits March 26, 2024 08:42
changelog: Internal, Performance, Optimize check for two-factor enabled account
@aduth aduth merged commit 6391877 into main Mar 26, 2024
@aduth aduth deleted the aduth-2fa-enabled-usage branch March 26, 2024 13:22
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.

2 participants