-
-
Notifications
You must be signed in to change notification settings - Fork 474
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement prs-7 request/response handling #162
Comments
prs-7 seems interesting and something to take in mind. Thanks or sharing this. |
It should probably be done by adding another interface which consumes and produces psr7 type format parameters, while keeping the old pre-psr7 interface which uses urls and parameters in arrays and strings. Then internally the new code can handle the data objects however is best. Probably best to add a class which does the conversion for you, and can output its contents either in psr7 format, or scheme/uri/url/parameters/cookies/etc strings format. Probably this class already exists. |
I think a 3.X version makes sense. Focused on PHP7 and PRE-PSR7 and witthout the mcrypt requirement |
@pitbulk
How to use guzzlehttp psr7 it's quite simple: http://docs.guzzlephp.org/en/stable/psr7.html |
@chris001 and @pitbulk: I started an experimental rewrite a few weeks ago. Hope to finish a great deal of it this week. |
Also, I'm working with php-saml in a Symfony app and would like to use the Symfony PSR-7 bridge with php-saml to inject requests and return responses. |
Hi @Hikariii, any progress on this? |
@Hikariii I made some progress on the 3.0.0 branch. I want to know if you have time to work on it, or if I may continue your work of that branch: https://github.com/Hikariii/php-saml/commits/feature-rewrite |
What is the status of this work ? I would be interested in this, as it would integrate much more cleanly in my Symfony project. |
I have not worked on that, the only work done is the one that can be found at: Don't know how much PSR-7 conversion will affect current 3.0.0 branch. will the implementation be compatible with current implementation? You have contributed a lot today on 3.0.0 branch, do you think you gonna have time to work on the PSR-7 stuff? |
Any help is welcome, I'm currently out of time since I had to jump in other projects. |
@pitbulk Did you like the idea of using zend-diactoros or would you be open to using guzzle/psr7? I have substantially more experience with guzzle but happy to learn more about zend-diactoros if thats the direction you want to go. |
Based on @Hikariii I think makes more sense to use zend-diactoros |
Sounds good, I'll review what @Hikariii did and keep pushing forward |
Reviewing what @Hikariii has done is almost impossible, as he deleted the whole codebase and added the new code in a different folder (making any git diffing unusable) |
@stof I agree that I did do far too many changes to the codebase to come to a PR that is diffable. The work I did ended up to be a restructure/rewrite combined with integrating new features(too much going on). The codebase heavily uses php globals and gets it input from $_GET and $_POST. Even more, the code also writes its own headers and even exits (can be bypassed). I do think it is wise to explore a way of restructuring the code in a way that it can be reviewed and refactored nicely and in smaller bits. |
@Hikariii is this still on your radar somewhere? |
@jorijn Nope not really. Refactoring this in a structured way requires a lot of planning/testing/rewriting and probably some help. It is not a priority (anymore). |
Doesn't seem to much work to simply make the $_GET variable an optional input parameter? https://github.com/search?q=repo%3ASAML-Toolkits%2Fphp-saml%20%24_GET&type=code Its only in Auth and LogoutRequest? |
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:
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.
The text was updated successfully, but these errors were encountered: