Page MenuHomePhabricator

Remove access to the IPInfo API if the beta feature is not enabled [M]
Closed, ResolvedPublic

Description

Background

If IPInfo is a beta feature on some wiki, there are some circumstances under which a user can access IPInfo's API while having the beta feature disabled. This should not be possible: if the beta feature is disabled for a user, they shouldn't have access to any part of it.

See T292802#7613187 for more details.

Acceptance criteria

  • If a user has the right to use IPInfo, but has it disabled as a beta feature, they should not be able to access the IPInfo API

Notes

  • If a wiki does not have the BetaFeatures extension enabled, IPInfo users with the right to use IPInfo should still be able to access all parts of it

Event Timeline

Prtksxna renamed this task from Remove access to the IPInfo API if the beta feature is not enabled to Remove access to the IPInfo API if the beta feature is not enabled [M].Jan 12 2022, 2:49 PM

Change 754942 had a related patch set uploaded (by STran; author: STran):

[mediawiki/extensions/IPInfo@master] Disallow API access when feature is not beta enabled

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

Change 754942 merged by jenkins-bot:

[mediawiki/extensions/IPInfo@master] Disallow API access when feature is not beta enabled

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

dom_walden subscribed.

The API will only return data if:

  • The Beta Features extension is installed and all three user options (ipinfo-beta-feature-enable, ipinfo-enable and ipinfo-use-agreement) are turned on
  • The Beta Features extension is not installed and both ipinfo-enable and ipinfo-use-agreement are turned on

If ipinfo-enable and ipinfo-use-agreement are on but ipinfo-beta-feature-enable is off the API will return 403: You do not have permission to perform the action.

Test environments:

  • https://en.wikipedia.beta.wmflabs.org IP Info 0.0.0 (961af0e) 14:10, 18 January 2022 (for testing with Beta Features extension installed)
  • local docker IP Info 0.0.0 (b2f2568) 08:17, 20 January 2022 (for testing with Beta Features extension not installed)