-
-
Notifications
You must be signed in to change notification settings - Fork 498
Description
At the moment this library does a lot of request parsing and response handling on it's own.
This issue proposes moving to psr-7 for request/response handling.
Bypass and/or resolve current and possible future issues:
- Assumptions are made about the incoming request and superglobals are being interpreted sometimes leading to misbehaving code.
- The toolkit (in some cases) sets headers and exits (in case of redirecting). It is possible to circumvent, but it is considered bad practise to even have the option of exiting php within a library.
There is a standard, please use it:
Up until last year here was a lot of different request/response handling going on within different frameworks. Since psr-7 a lot of frameworks have moved to prs-7 for their response/request handling.
Just check https://mwop.net/blog/2015-01-26-psr-7-by-example.html and how this is a great standard for handling this.
Increase interoperability and collaboration:
Using psr-7 internally would greatly improve the integration in different frameworks and would make it a lot easier to write middleware around php-saml. Requests and responses could be interpreted and returned in a standardized psr-7 way, clear for everyone who uses it.
Provide backwards compatibility layer for old-style usage:
To provide a form of backwards compatibility the library could provide it's own utility to create and resolve psr-7 requests and responses for usage outside of a framework. I actually forsee that most of the implementations will actually use this library within a framework and do not need this layer, but it's still nice to have and be able to use this library in a stand-alone way.
Requires a lot of refactoring
This is probably something for a 3.* version, because it will change the outer api.
Internally it will probably be quite some work to upgrade this, but it will definitely improve adoption and ease of use for this library within the context of bigger applications.