Page MenuHomePhabricator

REST: Stop using getParamSettings for body parameters
Closed, ResolvedPublic

Description

When introducing the "body" parameter source, we initially added body parameters to getParamSettings(). We later introduced getBodyParamSettings(), because callers generally want either real (body or query) params or body params, but not both. Also, body params are not inclued in the return value of getValidatedParams(), which was confusing.

We should prohibit "body" parameters in the return value of getParamSettings(). This could be enforced by RestStructureTest. Before we can do that, we need to update extensions that are now returning bodyparams from getParaSettings. CheckUser, ReportIncident, and WikimediaCampaignEvents are already correctly using getBodyParamSettings.

  • fix CampaignEvents
  • fix ReadingLists
  • fix GrowthExperiments
  • fix FlaggedRevs
  • make RestStructureTest fail when "body" parameters are returned from getParamSettings
  • remove backwards compatibility code from the default implementation of getBodyParamSettings, so it simply returns an empty array.

Event Timeline

Reedy renamed this task from REST: Stop using getParamSettings for body parameters. to REST: Stop using getParamSettings for body parameters.Jun 13 2024, 12:42 PM
FJoseph-WMF changed the task status from Open to In Progress.Jun 13 2024, 3:28 PM
FJoseph-WMF triaged this task as Unbreak Now! priority.
FJoseph-WMF lowered the priority of this task from Unbreak Now! to Medium.
FJoseph-WMF raised the priority of this task from Medium to High.

Change #1043182 had a related patch set uploaded (by Daniel Kinzler; author: Fgoodwin):

[mediawiki/extensions/CognitiveProcessDesigner@master] Use body parameter instead of post parameter

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

Change #1043823 had a related patch set uploaded (by Daniel Kinzler; author: Fgoodwin):

[mediawiki/extensions/Checklists@master] Use body parameters instead of post parameters

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

Change #1046677 had a related patch set uploaded (by Atieno; author: Atieno):

[mediawiki/extensions/ReadingLists@master] body-param: Stop using getParamSettings for body params

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

Change #1046680 had a related patch set uploaded (by Atieno; author: Atieno):

[mediawiki/extensions/GrowthExperiments@master] body-param: Stop using getParamSettings for body params

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

Change #1046683 had a related patch set uploaded (by Atieno; author: Atieno):

[mediawiki/extensions/CampaignEvents@master] body-param: Stop using getParamSettings for body params

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

Change #1047111 had a related patch set uploaded (by Atieno; author: Atieno):

[mediawiki/extensions/FlaggedRevs@master] body-param: Stop using getParamSettings for body params

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

Change #1047111 merged by jenkins-bot:

[mediawiki/extensions/FlaggedRevs@master] body-param: Stop using getParamSettings for body params

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

Change #1046680 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] body-param: Stop using getParamSettings for body params

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

Change #1048007 had a related patch set uploaded (by Atieno; author: Atieno):

[mediawiki/core@master] param-settings: Remove backward compatibility code from default

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

Change #1046683 merged by jenkins-bot:

[mediawiki/extensions/CampaignEvents@master] body-param: Stop using getParamSettings for body params

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

Change #1046677 merged by jenkins-bot:

[mediawiki/extensions/ReadingLists@master] body-param: Stop using getParamSettings for body params

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

Change #1048007 merged by jenkins-bot:

[mediawiki/core@master] param-settings: Remove backward compatibility code from default

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