Move to global Kernel#2630
Conversation
|
Maybe we should document somewhere that the included modules also have an explicit line in the .gitignore to include the deployed files such as Since the included modules is not likely to change I am not sure if it is worth adding a test in the deployment script |
I've updated the docs and also added a small unit tests that will check modules in the repo that have assets if they are noted in .gitignore, this should do it... |
|
|
Yes, it's only use was the |
|
I went over them and it's fair to say we need to get the documentation right immediately, because well.. We all know what happens if we don't :') Other than that I would merge this. |
|
Some of the comments I had were more "nice to have" and I have tried to add that to them when converting from brain-dump in emacs to this PR. I am also happy to move more to symfony and think that having it in subsequent PRs is a good way to break it up a little for reasonable sized review chunks. |
|
I think the logging change was mentioned in a few places. Symfony comes with some PSR-3 loggers including monolog support. https://symfony.com/doc/current/logging.html If there was a common base class or some form of mix in we might be able to have the existing Logger class forward to the injected Symfony logger and then avoid needing to think about that change when logging. I haven't explored that but it might be a handy way to move to that so that as a dev we don't have to think is it |
Huh, good point... since exchanged metadata will not be updated between entities at the exact time of upgrade to v3, bunch of things will break when they try to upgrade, until they refresh their metadata. We definitely need a transition... How about in v3 I simply do a second pass when loading routes and give those a |
This is only necessary for the metadata-endpoints and other SAML endpoints where we receive SAML-messages. |
It is also relevant for oidc module which exposes its metadada and relevant endponts in it, I guss casserver also... any endpoint that other services had to register, any API endpoint that is memorized... this will all stop working for them until they update to new URLs |
Absolutely! Add the adfs-module to that list too! |
I'm afraid that we don't know all of the relevant endpoints... Those are not just protocol related endpoints. For example, cron module - in our federation we call its endpoints in crons. WIth metadata aggregator we have automations... The problem is, when upgrading to v3 of SimpleSAMLphp I'll have to upgrade all related external stuff that calls SSP endpoints at the same time. I can't do that in advance because new URLs won't work until I upgrade SSP to v3, and old URLs won't work after I upgrade to v3. I'm in favor of "transition period", where in v3 we will support all routes - new and legacy (with new ones being published in metadata). And in a next major version, or even minor - so in v3.1 - we remove support for legacy routes. This way people will have a chance to announce the change, publish any new metadata, for which ever protocol, change any external calls to SSP endpoints to cron, metadata, whatever - while old routes work. With this, in theory, there shouldn't be downtime regarding the new URL form for any module, even custom module ones... |
I suggest the following as a solution in transition period: b17496b |
I suggest the following solution in v3.0 in tranistion period: b17496b |
Yes, indeed... I've added twig example in |
Indeed... here is the added note: 66a9cc7 |
Ok, added: 595d9a4
Huh... I see what you mean, this could even be implemented in a way to track many config options, and present any deprecated ones in the UI where users will clearly get the message... but I'm now sure about it... but I would certainly like to keep it out of scope of this PR... |
I can live with that :) One question though: what would be a reasonable time for the transition period? What is a "normal" interval to refresh metadata? I do this once every three year, because that's the lifetime of our signing keys, however SAML2INT for instance preaches to use long-lived self-signed certificates.. Could easily be 10 yrs? Other than that, I think this PR is ready to merge. |
The related method is below, it points to public function getLoginURL(?string $returnTo = null): string
{
if ($returnTo === null) {
$httpUtils = new Utils\HTTP();
$returnTo = $httpUtils->getSelfURL();
}
$login = Module::getModuleURL('saml/sp/login/' . urlencode($this->authSource), [
'ReturnTo' => $returnTo,
]);
return $login;
} |
|
We should check the docs for any mention of |
I don't know what is reasonable timeframe would be.... I didn't introduce a config option to enable or disable legacy URLs in the end, to not pollute config file with something that will be removed anyways in the future. So everyone will have to wait for a new SSP version which will have legacy URLs removed. For which version should this be, you guys can decide this at any time - just remove the one-line in Kernel to stop supporting legacy URLs in some future version release... |
This should already be fixed. |
I think I went through all your suggestions. I did try things out while working on this, but it would be great if you guys do that also... |
|
I knew this would have some interaction with #2645 I can take a look at updating the 4 breaks in 2645 |
This is a proposal only PR for v3, and should be carefully tested before merge.
The point is to route all requests through
public/index.php, where globalKernelis instantiated, which loads all available services and routes, including from all enabled modules.Module endpoints would now live under
/module/<module>/....LegacyLegacy URLs containingmodule.phpentry point is no longer supported. Also, any other direct public PHP entry point is no longer supported./module.php/are supported in v3.0 to allow a transition period, so all peers can update the newly published URLs in a reasonable timeframe. The module assets now have to be "published" to SSPs public dir to be available (dedicated asset publishing command is introduced).My initial thought was to "only" remove "module.php", but this ended up being whole request process refactoring.... But this should enable easier maintenance and testing, and adding more Symfony features in the future, I think....
I did some manual testing locally where I had an IdP with this implementation and an SP using SSP v2.4. I tried doing basic SAML authentication and it worked. However, I didn't do any other testing with the overall SSP ecosystem...