It would be really nice if we implemented PSR-15 which would allow standard middleware to be used within MediaWiki.
Use Cases
It would be really nice if we implemented PSR-15 which would allow standard middleware to be used within MediaWiki.
Use Cases
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
REST: introduce a middleware mechanism (chained) | mediawiki/core | master | +484 -249 | |
REST: introduce a middleware mechanism | mediawiki/core | master | +424 -239 |
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Open | None | T194393 Implement standard middleware interface in MediaWiki (PSR-15) | |||
Open | None | T194397 Implement standard HTTP message interface in MediaWiki (PSR-7) |
It is quite likely that the pursuit of this task is mutually exclusive with T140664 and T106099.
From a quick glance, middleware-based services seems appropiate for web servers, not web applications. The main reason being that it opens up the ability to implement arbitrary new entry points in a way that isn't statically exportable in a stateless pure-data way, which may conflict with the desire to have a centralised registry that can be exported and used for knowing in advance what route and view template will respond to a particular user request.
There are an infinite number of specs and plugin models, but ultimately, we need to solve problems with solutions, and encourage consistency and re-use of solutions where possible. The easiest way to unblock this task would be to have a parent task that describes a particular product or developer need, for which this can be one of N possible solutions.
This is just within MediaWiki core, it wouldn't be outside of that (unless we exposed a hook to register middlewares, which I think we should).
There are an infinite number of specs and plugin models, but ultimately, we need to solve problems with solutions, and encourage consistency and re-use of solutions where possible.
I think implementing industry standards (where appropriate) is a step in that direction.
A middleware could technically define a new endpoint, but that's not typically how they are used; more typically they handle cross-cutting concerns and fulfill a similar role to e.g. request filters in RESTBase.
Also, nothing stops middleware that do define new endpoints from exporting them.
Change 879125 had a related patch set uploaded (by Gergő Tisza; author: Daniel Kinzler):
[mediawiki/core@master] REST: introduce a middleware mechanism
Change 971457 had a related patch set uploaded (by Daniel Kinzler; author: Daniel Kinzler):
[mediawiki/core@master] REST: introduce a middleware mechanism (chained)