Page MenuHomePhabricator

Figure out a way to inject/request a current user from REST API handlers
Closed, ResolvedPublic

Description

Currently in all the handlers we grab the current MW user from main request context with a TODO comment that we need to figure out how to make it available to the handler more in line with DI. We need to figure that out, add support to the REST framework and use it in out already implemented handlers.

Event Timeline

we need to figure out how to make it available to the handler more in line with DI.

I think the way this should work is a service that takes a request, and returns a user (and session). The request is known to the handler, the service can be injected.

Change 654473 had a related patch set uploaded (by Ppchelko; owner: Ppchelko):
[mediawiki/core@master] Use Authority throughout Rest

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

Change 654656 had a related patch set uploaded (by Ppchelko; owner: Ppchelko):
[mediawiki/core@master] Rest: use Authority in all core handlers

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

Change 654473 merged by jenkins-bot:
[mediawiki/core@master] Rest: inject Authority into Handler

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

Change 654656 merged by jenkins-bot:
[mediawiki/core@master] Rest: use Authority in all core handlers

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

  NODES
HOME 1
Note 3
os 3
text 1
todo 1