rubygems / rubygems.org

The Ruby community's gem hosting service.
https://rubygems.org
MIT License
2.31k stars 905 forks source link

Move TOTP CRUD actions to TotpsController #4823

Closed martinemde closed 1 week ago

martinemde commented 1 week ago

Extracted from MultifactorAuthsController and contains no code or behavior changes, just moved code.

This seems worth doing because it simplifies a complex controller that has no overlap in behavior and no shared code. In the new controller we only do TOTP create and destroy, whileMultifactorAuthsController now does just recovery and mfa levels.

This also mirrors the organization of Webauthn creation.

In a follow-up PR, I'd suggest created a landing page for /multifactor_auth/new that gives both TOTP and WebAuthN as options on the same page. Currently this is only presented on /settings/edit but we direct people to the page that's only useful for creating a TOTP.

codecov[bot] commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 97.04%. Comparing base (1ab1c8c) to head (bf589fd). Report is 1 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #4823 +/- ## ========================================== - Coverage 97.05% 97.04% -0.01% ========================================== Files 399 400 +1 Lines 8449 8459 +10 ========================================== + Hits 8200 8209 +9 - Misses 249 250 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.