i_am_webservice() does not recognize USAGE_MODE_MOJO_REST
Categories
(bugzilla.mozilla.org :: API, defect)
Tracking
()
People
(Reporter: xavier.lhour, Unassigned)
Details
Attachments
(1 file)
Bugzilla::Util::i_am_webservice() returns true for USAGE_MODE_JSON and USAGE_MODE_REST, but not for USAGE_MODE_MOJO_REST. The native Mojolicious REST endpoints (Bugzilla/API/V1/*) are therefore treated as browser requests by all call sites.
Two consequences matter:
-
Bugzilla/Template.pm:866: the error_message filter wraps to 72 columns "if we're not in the WebService", so any native REST error message over 72 characters comes back with embedded\n's in the JSON response -
extensions/RestrictComments/Extension.pm:58:object_end_of_set_allforce-clearsrestrict_commentson every bug update made through a native REST endpoint unless the caller passes the field explicitly. This affectsBugzilla/API/V1/Github.pm:364andextensions/PhabBugz/lib/API/V1/PhabBugz.pm:235
Other call sites (MFA and password-reset redirects in Bugzilla.pm and Bugzilla/Auth.pm, Quicksearch shortcuts) are also wrong for API requests. The Bugzilla::Auth::Login::* ones are unreachable, since native REST authenticates via Bugzilla/App/Plugin/Login.pm.
Comment 1•3 hours ago
|
||
Comment 2•3 minutes ago
|
||
Authored by https://github.com/Xzzz
https://github.com/mozilla/bmo/commit/3ae92b83dc873157fb283cbcf280ee49fdc39617
[master] Bug 2074854 - Recognize USAGE_MODE_MOJO_REST as a webservice mode in i_am_webservice
Description
•