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

Reference UserWebauthnMethods into UserMultifactorMethods [3/4] #3808

Merged
merged 2 commits into from May 19, 2023

Conversation

jenshenny
Copy link
Member

What problem are you solving?

This PR is based off of a larger PR #3805

As part of #3800, there are methods in UserMultifactorMethods that are specific to Webauthn.

What approach did you choose and why?

This PR moves verify_webauthn_otp method to UserWebauthnMethods. I also moved the inclusion of UserWebauthnMethods into UserMultifactorMethods as methods in UserMultifactorMethods relies on the methods in UserWebauthnMethods.

@codecov
Copy link

codecov bot commented May 18, 2023

Codecov Report

Merging #3808 (4bfbf57) into master (d872189) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #3808   +/-   ##
=======================================
  Coverage   98.81%   98.81%           
=======================================
  Files         214      214           
  Lines        5243     5244    +1     
=======================================
+ Hits         5181     5182    +1     
  Misses         62       62           
Impacted Files Coverage Δ
app/models/user.rb 100.00% <ø> (ø)
app/models/concerns/user_multifactor_methods.rb 100.00% <100.00%> (ø)
app/models/concerns/user_webauthn_methods.rb 100.00% <100.00%> (ø)

@jenshenny jenshenny changed the title Reference UserWebauthnMethods into UserMultifactorMethods Reference UserWebauthnMethods into UserMultifactorMethods [3/4] May 18, 2023
Copy link
Contributor

@ericherscovich ericherscovich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somewhat related to my comment in #3806 but is there any benefits in moving this from User into UserMultifactorMethods? My thought is it may be better to keep it at the higher level, in the User, so these can be included individually if needed, instead of including all multifactor methods to get just the OTP ones, as an example.

@jenshenny
Copy link
Member Author

My thought is it may be better to keep it at the higher level, in the User, so these can be included individually if needed, instead of including all multifactor methods to get just the OTP ones, as an example.

That's a good point. However if you just include UserMultifactorMethods, there are some methods from UserOtpMethods and UserWebauthnMethods that are required for UserMultifactorMethods to work. This includes references to verify_webauthn_otp and verify_digit_otp. I think it would be nice for the user to include UserMultifactorMethods and not worry about needing to include all the other concerns. wdyt?

Copy link
Contributor

@bettymakes bettymakes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice clean up 🧹 💯 . LGTM 👍 .

@jenshenny jenshenny merged commit 0d0a5fe into rubygems:master May 19, 2023
11 checks passed
@jenshenny jenshenny deleted the cleanup-webauthn-concern branch May 19, 2023 15:19
@rubygems-org-shipit rubygems-org-shipit bot temporarily deployed to staging May 19, 2023 15:32 Inactive
@rubygems-org-shipit rubygems-org-shipit bot temporarily deployed to production May 21, 2023 16:50 Inactive
@rubygems-org-shipit rubygems-org-shipit bot temporarily deployed to dev May 28, 2023 15:24 Inactive
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.

None yet

3 participants