Remove the obsolete api_key_only user preference now that the native REST API only accepts API keys, OAuth2 tokens, or cookie + api token
Categories
(bugzilla.mozilla.org :: API, enhancement)
Tracking
()
People
(Reporter: dkl, Assigned: dkl)
Details
Attachments
(1 external file)
The api_key_only user preference ("Require API key authentication for API requests") is now dead code. The legacy REST server is gone (bug 2081819), and every API endpoint in Bugzilla/API/V1/* now authenticates through the native Mojo login helper (Bugzilla/App/Plugin/Login.pm). An API request can only be authenticated with:
- an API key (X-Bugzilla-API-Key header, or the deprecated query-param fallback)
- an OAuth2 bearer token
- a login cookie plus a valid Bugzilla_api_token (internal web UI calls)
Username/password and login-token authentication, the methods this preference blocked, are no longer accepted on any API path. The native helper never reads the setting, and the remaining checks in Bugzilla/Auth/Login/Cookie.pm and Bugzilla/Auth/Verify/DB.pm can't be reached from an API request.
Leaving the preference in place is misleading:
- Users can toggle a setting that has no effect.
- Enabling MFA forces it on, and turning it off triggers an MFA prompt to protect a choice that no longer exists.
- The privileged group members report marks MFA users as "(weakened)" when the setting is off, even though they are no weaker than anyone else.
Proposed changes:
- Remove the api_key_only checks from Bugzilla/Auth/Login/Cookie.pm and Bugzilla/Auth/Verify/DB.pm.
- Remove the setting from Bugzilla/Install.pm and have checksetup delete the existing setting rows (remove_setting).
- Remove the api_key_only save/MFA logic from userprefs.cgi (SaveSettings, MfaSettings, SaveMFAupdate) and the related text in the settings and MFA preference templates, js/account.js and skins/standard/admin.css.
- Remove the "(weakened)" marker and the api_key_only field from the BMO group members report (HTML and JSON output).
Note: the group members report JSON output will no longer contain the api_key_only key. Anyone who consumes that output should be told.
Comment 1•2 days ago
|
||
(via GitHub webhook, authenticated as shared-secret)
Description
•