Page MenuHomePhabricator

Update 'revisions' query API to not allow filtering for revisions based on private tags the user cannot see
Closed, ResolvedPublic

Description

Summary

Currently the revisions API allows a user to search for revisions with a specified private tag even if the user cannot see said private tag

Steps to reproduce

  1. Define a private tag that only users with a specific right can see (not given to anon users)
  2. Add the private tag to an edit
  3. Open Special:ApiSandbox while logged out
  4. Use the revisions query API, with the tag filter set to the private tag you defined above
  5. Run the API query
What happens

The revision that has the private tag is shown. While the tags for that revision properly hide the tag (as addressed in T431667), the existence of the tag in the result still means you know the revision has the tag on the edit

Acceptance criteria

  • The ApiQueryRevisions class pretends the tag does not exist if the user cannot see it
  • A search for other APIs that allow searching by tag is done and those APIs are fixed too

Event Timeline

Dreamy_Jazz removed subscribers: kostajh, Aklapper, Tgr and 11 others.

While doing this we should probably look through other APIs to find others which allow searching for entries based on a specific tag and fix them too

Change #1310127 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] Query APIs: Make tag filter respect rights-restricted tags

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

Change #1310992 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/core@master] ApiQueryRevisions: Vary cache mode when filtering by tag

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

Change #1310127 merged by jenkins-bot:

[mediawiki/core@master] Query APIs: Make tag filter respect rights-restricted tags

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

Change #1310992 merged by jenkins-bot:

[mediawiki/core@master] ApiQueryRevisions: Vary cache mode when filtering by tag

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

Change #1311051 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/core@master] ApiQueryRecentChanges: Vary cache mode when filtering by tag

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

Change #1311051 merged by jenkins-bot:

[mediawiki/core@master] ApiQueryRecentChanges: Vary cache mode when filtering by tag

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

Dreamy_Jazz updated the task description. (Show Details)

Doing some testing on test.wikipedia.org suggests this is fixed, moving to done