Page MenuHomePhabricator

Improve test coverage of SpecialMWOAuthConsumerRegistration
Open, In Progress, Needs TriagePublic

Description

SpecialMWOAuthConsumerRegistration is the flow for registering and updating OAuth 1 and OAuth 2 consumers. It would most likely involve writing unit and integration tests to cover the functionality.

We'll likely write integration tests to cover functionality related to the Special page UI, the /propose and /update features, and their interactions with the action API and the DB (e.g., SubmitControl for the aforementioned endpoints). It's probably possible to use SpecialPageTestBase, since this will involve testing a special page and ApiTestCase for action API-related functionality.

Impact

Event Timeline

Adding QS-Test-Automation to keep aware of this, this is a great effort. Where's test coverage going to be documented? Will it flow to https://doc.wikimedia.org/cover-extensions/ or somewhere else?

Adding QS-Test-Automation to keep aware of this, this is a great effort. Where's test coverage going to be documented? Will it flow to https://doc.wikimedia.org/cover-extensions/ or somewhere else?

Ack! It'll flow to the site you linked above. Specifically: https://doc.wikimedia.org/cover-extensions/OAuth/src/index.html

For /propose:

  • owner-only / non-owner-only workflow is very different
  • OAuth 1 and 2 are quite different
  • should test consumers using RSA keys vs. a secret
  • need separate tests for auto-approved ($wgOAuthAutoApprove) and non-auto-approved consumers
  • there are a bunch of error conditions that should have tests, like using http: for OAuth 2 (although maybe better handled in ConsumerSubmitControl unit tests)

For /update, I think the only meaningful difference is RSA keys vs. secrets (and even that only when the reset option is used).

DAlangi_WMF changed the task status from Open to In Progress.Mon, Feb 9, 8:41 AM
DAlangi_WMF claimed this task.

Change #1238314 had a related patch set uploaded (by D3r1ck01; author: Derick Alangi):

[mediawiki/extensions/OAuth@master] tests: Add integration tests for Special:MWOAuthConsumerRegistration

https://gerrit.wikimedia.org/r/1238314

(17/02/2026): A measure of code coverage report generated locally for this class:

Screenshot 2026-02-17 at 3.01.48 PM.png (1×3 px, 458 KB)
Screenshot 2026-02-17 at 3.00.24 PM.png (644×1 px, 169 KB)