Repository navigation
Bug 2078770 - Migrate User REST resource to native Mojo API: MFA (enroll, verify_totp_code) - #2792
Merged
Merged
Conversation
… with MFA enabled
…oll, verify_totp_code)
dklawren
approved these changes
Oct 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ports the MFA endpoints (
enroll,verify_totp_code) fromBugzilla::WebService::Userinto a nativeBugzilla::API::V1::UserMFAMojo controller, and removes the legacy User module, which has no methods left.Last sub-bug of 2071909.
As agreed,
login,logoutandvalid_loginare not ported: API keys replace them.Changes
Bugzilla/API/V1/UserMFA.pm, with the same responses as the legacy endpoints:GET /rest/user/mfa/<provider>/enroll(MFA preferences page,js/account.js)POST /rest/user/mfa/verify_totp_code(TOTP verification form,js/mfa_totp.js)OPTIONSon bothverify_totp_codeidentifies the user by themfa_tokenfrom the form, not by a login: the user is still logging in.Bugzilla/WebService/User.pm,Resources/User.pm, theUserdispatch entry, and the login tokenBugzilla/Auth.pmkept on the user object forUser.login.Bugzilla/WebService.pmPOD: dropUser.login, and useBug.getin theinclude_fields/exclude_fieldsexamples.GET /rest/login,/rest/logoutand/rest/valid_loginare gone, withqa/t/rest_user_login_logout.tand their sections inuser.rst.general.rst: the resources still on the legacy auth path are now onlyBugandBugzilla.t/app-user-mfa.tt/app-user-whoami.tchecksmfa_statustrue (first commit)qa/t/rest_legacy_credentials.tkeeps theBugzilla_login/Bugzilla_passwordcases of the removedrest_user_login_logout.t, for the resources still on the legacy serverTest plan
GET /rest/user/mfa/totp/enrolllogged out, expectinglogin_requiredGET /rest/user/mfa/unknown/enroll, expecting a 400POST /rest/user/mfa/verify_totp_codewith a bogusmfa_token, expecting{"error": 1, "message": "invalid verification token"}GET /rest/login, expectingrest_invalid_resource(32614)GET /rest/whoamiwith an API key and withX-Phabricator-Tokenis unchangedReferences