Enable overriding properties for particular IdP in case of multiple hosted IdPs#2270
Conversation
* docs: make a link to the release process * lint the things that do not matter
…samlphp#2263) * docs: update SP example to new non string endpoint format * add the certificate back there
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## simplesamlphp-2.4 #2270 +/- ##
=======================================================
+ Coverage 44.80% 44.97% +0.16%
- Complexity 3902 3903 +1
=======================================================
Files 163 163
Lines 13008 13008
=======================================================
+ Hits 5828 5850 +22
+ Misses 7180 7158 -22 |
|
I was thinking about the update in In short the thought I had was if you have a few hosted IdP defined and are relying on the value for There are a few options for this: For the longer story... Consider a For demonstration purposes I have created a bin/test4.php file as follows: This gives the following... Notice that If I change Then I get the following where idp-2 has a different SingleSignOnService value. |
|
Ok, yes, this is not only "fix", since it may come as a surprise for those that have 2+ IdPs and have tried to override for example 'SingleSignOnService' but didn't notice that it actually wasn't overridden in non-default IdPs, since with this PR it will come into effect. So if they have something non-functional set in non-default IdPs, it will break :/. So, should I point this to master branch, or 2.4? I'm more in favor to postpone this rather to introduce problems for people upgrading to 2.3.*, even if it is a low chance of mentioned scenarios... |
|
I did a bunch of other testing and sniffing around. Playing with falling back to the value from My experiment was along the lines of updating
Though it was mostly aimed at replicating the current results with a modification of this PR. Should we try to fallback to the Though this doesn't cover the case you mentioned that |
Since you got deep into it, I would say yes, definitely. The problem with 'something non functional set and not noticed' can be softened with releasing this in next version release and not 2.3, with upgrade docs updated... (I had something set and I didn't notice until this PR). |
|
I guess looking at 2.4 as the rebase then. The only remaining question is if we fallback to the DEFAULT if nothing is explicit in the $entityId. I am thinking it makes the most sense to do that. |
|
I'm not fond of doing rebases with already shared code... This is small PR, but in general this can cause confusion and conflicts for anyone else who is working with it when trying to synchronize... However, out of curiosity I've gone ahead with it and some conflicts arose that I don't feel comfortable resolving (only small one in docs/simplesamlphp-upgrade-notes-2.3.md, but still). Care to do that yourself? |
|
The change here seems to be |
|
I have also cherry picked this over to master. |
|
TODO: describe the difference mentioned in #2270 (comment) for 2.4. |
This PR comes with assumption that it is totally OK to have multiple hosted IdPs defined in single SSP instance.
I have a scenario in which I need to have multiple hosted IdP configured, and I have to override particular properties (for example 'SingleSignOnService') for non-default ones. The idp-hosted docs from https://simplesamlphp.org/docs/stable/simplesamlphp-reference-idp-hosted.html says that we can set (override) particular options for hosted IdPs.
However, this only works as expected for single (default) hosted IdP. The
\SimpleSAML\Metadata\MetaDataStorageHandler::getGeneratedmethod "only" usedgetMetaDataCurrentmehod to resolve metdata..., and with that I always get, for example, the same value for 'SingleSignOnService' (the default one) as the value for all hosted IdPs when checking the generated IdP metadata on "Federation" screen or when fetching metadata XML for particular non default IdP.This PR expands
MetaDataStorageHandler::getGeneratedwith new optional argumententityId, which is then used (if provided) when fetching metadata for (particular) IdP.I have added tests in
\SimpleSAML\Test\Metadata\MetaDataStorageHandlerTestand also modified it so it's a bit easier to expand it with new unit test. I was not sure how would I add new tests to\SimpleSAML\Test\Module\saml\IdP\SAML2Test, since it seems that it is totally oriented to single hosted IdP scenario, so if you have a suggestion...This should be a non-braking fix.