Page MenuHomePhabricator

Document CSRF token body parameters in TokenAware handlers
Closed, ResolvedPublic3 Estimated Story Points

Description

Document the CSRF token body parameter in TokenAwareHandlerTrait, and ReadingListsTokenAwareHandlerTrait in the ReadingLists extension, using a descriptive, translatable system message. Since OpenAPI 3.0 does not allow request body payloads, such as CSRF tokens, to be defined in the global securitySchemes object, we must document this conditional constraint inline on the parameters themselves.

The description should express that CSRF is conditional. CSRF is required for Cookie-based sessions, but not for OAuth because OAuth is CSRF-safe.

Conditions of Acceptance

References

View of This Task in Context of Related Tasks

implementation_tasks_result_T423552_spike_security_scheme_information_MediaWiki_REST_API_description.png (4,372×8,192 px, 1 MB)

Event Timeline

Async estimate results:

3 points:  4 votes (@Moriel (she/her), @aschulz, @aghirelli, @Hua Szu Yang
2 points: 2 votes (@BPirkle, @mgoncalves)
1 point: 1 vote (@aschulz)

BPirkle set the point value for this task to 3.Jun 4 2026, 2:12 PM

Decided on a 3 after sync discussion

Change #1311297 had a related patch set uploaded (by KineticPelagic; author: KineticPelagic):

[mediawiki/core@master] rest: Incorporate CSRF token parameter

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

Change #1311305 had a related patch set uploaded (by KineticPelagic; author: KineticPelagic):

[mediawiki/extensions/ReadingLists@master] rest: Incorporate CSRF token parameter

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

Change #1311297 merged by jenkins-bot:

[mediawiki/core@master] rest: Incorporate CSRF token parameter

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

Change #1311305 merged by jenkins-bot:

[mediawiki/extensions/ReadingLists@master] rest: Incorporate CSRF token parameter

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