Skip to content

Bug 2073282 - Add deprecated api_key=<key> query-parameter fallback to native Mojo REST auth - #2753

Merged
dklawren merged 5 commits into
mozilla:masterfrom
Xzzz:bug-2073282
Sep 24, 2026
Merged

dklawren merged 5 commits into
mozilla:masterfrom
Xzzz:bug-2073282

Conversation

@Xzzz

@Xzzz Xzzz commented Sep 18, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Adds a fallback to Bugzilla::App::Plugin::Login's Mojo login check so ?api_key=<key> query parameters are accepted the same way the legacy WebService dispatcher already accepts them, in case undiscovered callers rely on it (like k8s monitoring service actually do).

Please note that this is a deprecation-pending stopgap, not a first-class supported method (docs already warn this method is likely to be deprecated due to security concerns).

Changes

  • Bugzilla::App::Plugin::Login's bugzilla.login helper: fall back to the api_key query/body parameter when the X-Bugzilla-API-Key header is absent, same precedence and validation path (revoked/sticky-IP checks, rate limiting) as the header case
  • qa/t/rest_native_login.t: cover authentication via ?api_key=
  • docs/en/rst/api/core/v1/general.rst: note that native Mojo REST resources also accept the deprecated api_key query parameter as a fallback

Test plan

  • GET a native Mojo REST endpoint with ?api_key=<valid key> and no header -> authenticates
  • Existing qa/t/rest_native_login.t cases (header, cookie + token) unaffected

References

@dklawren dklawren left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for jumping on this quickly.

Comment thread Bugzilla/App/Plugin/Login.pm Outdated
Comment thread qa/t/rest_native_login.t
Comment thread docs/en/rst/api/core/v1/general.rst
@Xzzz
Xzzz requested a review from dklawren September 24, 2026 14:04

@dklawren dklawren left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. r=dkl

@dklawren
dklawren merged commit 92bd3f1 into mozilla:master Sep 24, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants