Page MenuHomePhabricator

Give RESTBase / MCS requests the apihighlimits right
Open, Needs TriagePublic

Description

apihighlimits allows more efficient batching (500 titles instead of 50 in a single query; larger continuations, typically 5000 instead of 500; no ping limiter, although that probably does not affect RESTBase/MCS). It might improve performance (although not sure; large batches are faster but small batches are parallelized - it would definitely decrease API load though). There are various ways (some) RESTBase requests could have that right:

  • create a RESTBase system user (as in User::newSystemUser), and authenticate via OAuth.
  • create a RESTBase system user, create a new session provider that authenticates requests coming from RESTBase based on IP (and maybe some kind of header mechanism to allow RESTBase to select which requests this should happen for).
  • add the permission via UserGetRights (I think that would work for anonymous users, although not 100% sure)

The drawback is that it introduces a new failure point: if you set 500 titles but don't get the permission for some reason (e.g. IP changesdand someone forgot to update the config), the query will error out.

Event Timeline

I'm not sure I understand which use case is targeted here?

Specifically it came up in the discussion of this changeset.

I'm not sure I understand which use case is targeted here?

For one example, the media endpoint we're developing works by scraping media file page names from the Parsoid HTML and submitting those to the MW API imageinfo module in a follow-up query for additional metadata. There are frequently more than 50 such files. The changeset @Tgr linked adds batching for submitting them 50 at a time, but it would be nicer to be able to submit them all in one shot.

Having a system user with special/elevated rights will allow us to finally enable the whole RESTBase/ChangeProp system on private wikis T88016, but for that the system user will need to have even more elevated rights