Open Bug 2099092 Opened 2 days ago Updated 2 days ago

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)

Production
enhancement

Tracking

()

ASSIGNED

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:

  1. Remove the api_key_only checks from Bugzilla/Auth/Login/Cookie.pm and Bugzilla/Auth/Verify/DB.pm.
  2. Remove the setting from Bugzilla/Install.pm and have checksetup delete the existing setting rows (remove_setting).
  3. 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.
  4. 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.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: