-
Notifications
You must be signed in to change notification settings - Fork 698
Feature/http client #2574
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
base: simplesamlphp-2.5
Are you sure you want to change the base?
Feature/http client #2574
Conversation
381f63b to
941c8a7
Compare
cb14698 to
ec470ce
Compare
98f855c to
e9b1651
Compare
|
Let me know when the draft is ready for a looking at. If that is now then I'm happy to kick the tyres. |
|
Oh you can take a look! I still have to fix |
4c158e2 to
8e1da16
Compare
|
I am thinking that around the creation of So instead of calling Since the HTTP class already has the |
|
They are a different story. This is about SimpleSAMLphp making an outbound connection. |
8bde086 to
3c746a7
Compare
3c746a7 to
3359182
Compare
e1dd008 to
91766d0
Compare
| Assert::isArray($config['context']); | ||
| $context = $config['context']; | ||
| } | ||
| $httpUtils = new Utils\HTTP(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tvdijen Will the dependency injection work here?
- routing/services/simplesamlphp.yml
---
services:
# default configuration for services in *this* file
_defaults:
public: false
SimpleSAML\Configuration:
factory: ['SimpleSAML\Configuration', 'getInstance']
SimpleSAML\Session:
factory: ['SimpleSAML\Session', 'getSessionFromRequest']
SimpleSAML\Auth\AuthenticationFactory:
class: SimpleSAML\Auth\AuthenticationFactory
arguments:
- '@SimpleSAML\Configuration'
- '@SimpleSAML\Session'
SimpleSAML\Utils\HTTP:
class: SimpleSAML\Utils\HTTPand then:
protected function __construct(array $config, private ?Utils\HTTP $httpUtils = null)
{
$this->httpUtils ??= new Utils\HTTP();which will also be backwards compatible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I must say I have no idea how this is supposed to work, but of course we can try?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea of using the Autowiring stuff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had held off mentioning it on this PR to get the code up and running.
One possible follow up for a wider scope we might like to consider things like calls to Configuration::getInstance() to have the instance passed to the ctor by autowiring. Larger changes though.
That much wider scope has a 2.6 feel to it ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we can set the example for this case, the rest can go into 2.6... I don't want to wait much longer with releasing 2.5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds like a good plan. Focus on the http client updates getting in and the routing stuff can be 2.6.
4874a87 to
4398438
Compare
monkeyiq
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good. The CI seems to be in a bit of a hassle.
I haven't tested this here using a proxy, that is probably a good thing before we roll this out in 2.5.
|
|
||
| /* | ||
| * @DEPRECATED: set your proxy using environment variables. | ||
| * |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the symfony http client is honoring the proxy and noproxy lines from
https://symfony.com/doc/current/http_client.html#http-proxies it might make sense to include a reference to that at some stage.
This might be a job for a follow up PR as we don't seem to have a config/packages/framework.yaml at the moment so adding that, explaining where that is, and also then referencing it here to mention the symfony docs for proxy as the new non-deprecated way to set things.
| } else { | ||
| throw new \Exception("Neither source file path/URI nor string data provided"); | ||
| } | ||
| $entities = SAMLParser::parseDescriptorsString($srcXml); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a lot cleaner. Focus being very much on the parseDescriptor and not on if the data comes from a string or a file.
|
There is also a reference to the curl stuff here which doesn't seem to be needed any more with this PR...
|
|
We could maybe also delete a translation
|
|
I thought I would dig around a bit to see what else we might like to do/add before we start considering the merge for this and the attention moved to the modules that we can refresh. |
|
You mentioned a few modules. Looking at metarefresh I see it using [ED: using |
I don't think we can. Symfony's http-client is also using curl, so it is still a required extension |
|
The CI doesn't seem to like AuthnContextComparisonTypeEnum being passed from When I test with that here I can force the $rac to be Constants::COMPARISON_BETTER and the call |
|
I've fixed that in the release-branch, but I still have to rebase this one |
No description provided.