Page MenuHomePhabricator

🥐 Require clients to identify themselves by providing User-Agent header
Closed, ResolvedPublic5 Estimated Story Points

Description

As a Product Manager of Wikidata I want to understand what client are using the REST API on Wikidata.

Further down the line User Agent information could be used to limit, or allow additional resource usage for certain clients. This is not the purpose of this task -- it purely about identifying clients at this stage.

Acceptance criteria:

  • Request not containing User-Agent HTTP header (absent or empty) results in a 400 response (error code: missing-user-agent, message: Request must include User-Agent header.)
  • The User-Agent check takes precedence over any other request validation.

Event Timeline

Jakob_WMDE set the point value for this task to 5.

Change 834585 had a related patch set uploaded (by Ollie Shotton; author: Ollie Shotton):

[mediawiki/extensions/Wikibase@master] REST: Add middleware to check for a User-Agent

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

Ollie.Shotton_WMDE renamed this task from Require clients to identify themselves by providing User-Agent header to 🥐 Require clients to identify themselves by providing User-Agent header.Sep 26 2022, 9:29 AM

Change 834585 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] REST: Add middleware to check for a User-Agent

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