Skip to content
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

Issue768 extlib upgrade #774

Merged

Conversation

sarahjcotton
Copy link
Contributor

Fix for issue #768

Some re-factoring was required in order to make the plugin compatible with simplesamlphp 2.0 as per the docs: https://simplesamlphp.org/docs/2.0/simplesamlphp-upgrade-notes-2.0.html

In addition, a new BINDING_HTTP_ARTIFACT const seems to cause artifact to always take priority instead of redirect. Removal rather than re-order might be preferable here but I've left it in as there are settings in the plugin that refer to artifact bindings, although I'm not sure sure how to configure and test if the two are related. I couldn't see an obvious way to achieve this programmatically, unfortunately.

A number of unit tests are skipped when I run locally due to Redis and the Prophecy library not being available, again, not sure how to test.

Otherwise, @Peterburnett has kindly offered to peer review this. Happy to make any further changes as per your guidance.

@sarahjcotton sarahjcotton force-pushed the issue768_extlib-upgrade branch 3 times, most recently from a260e4d to 1017990 Compare October 3, 2023 15:09
classes/store.php Outdated Show resolved Hide resolved
classes/store.php Outdated Show resolved Hide resolved
db/upgrade.php Outdated Show resolved Hide resolved
sp/saml2-acs.php Outdated Show resolved Hide resolved
sp/saml2-logout.php Outdated Show resolved Hide resolved
db/upgrade.php Outdated Show resolved Hide resolved
@Peterburnett
Copy link
Contributor

Hi @sarahjcotton

All is largely looking good. Couple of comments could help to explain some stuff, and I think that there are a bunch of asserts in place that we dont need anymore as they are superseded by type guards on the parameters. Additionally there is a small syntax issue causing CI fails that ive put a comment on.

Other than that, I've seen this working with keycloak, so I think this is good to start rolling out. Anything else will have to be found in whatever complex integrations surface the issues.

@sarahjcotton sarahjcotton force-pushed the issue768_extlib-upgrade branch from 1017990 to ddc33de Compare October 4, 2023 10:35
@sarahjcotton
Copy link
Contributor Author

Thanks so much Peter; I've addressed all the issues you flagged if you wouldn't mind reviewing those, however whilst trying to run some unit tests yesterday I set the $CFG vars up for Redis and on trying to login using SAML today a bunch of new errors have been thrown that need fixing, so marking this PR as draft for now as it's not ready to be merged.

@sarahjcotton sarahjcotton marked this pull request as draft October 4, 2023 10:40
@sarahjcotton
Copy link
Contributor Author

New commit added to fix the redis_store class. I then also managed to get the redis unit tests to run locally and they all passed:

./vendor/bin/phpunit --verbose --filter auth_saml2_redis_store_testcase
Runtime:       PHP 8.0.29
Configuration: /var/www/moodle41/phpunit.xml

.......                                                             7 / 7 (100%)

Time: 00:01.598, Memory: 324.00 MB

OK (7 tests, 7 assertions)

@sarahjcotton sarahjcotton marked this pull request as ready for review October 4, 2023 12:05
@Peterburnett
Copy link
Contributor

Hi @sarahjcotton

This is looking much better now, things are looking really clean. The CI has exposed something interesting, in that PHP 7.4 is now the minimum PHP version supported. All 7 versions are EOL, so I dont think its a major issue to set the minimum to 7.4, but we should update the README table to reflect that, and additionally update the CI grid so that PHP 7.2 and 7.3 are excluded (see https://github.com/catalyst/catalyst-moodle-workflows#with-options)

I think thats the last thing before we can land this one.

@danmarsden
Copy link
Member

Great work Sarah!!

+1 to merge after

  1. update readme to state that php 7.4 and higher is required on the 3.9 stable branch as Peter mentioned.
  2. add the min_php setting to the github actions workflow config to only run 7.4 and higher tests (see: https://github.com/catalyst/catalyst-moodle-workflows/#with-options)

@sarahjcotton
Copy link
Contributor Author

Thanks both, hopefully that's good to go now!

@danmarsden danmarsden merged commit 19a9088 into catalyst:MOODLE_39_STABLE Oct 5, 2023
locallib.php Outdated
@@ -57,16 +57,16 @@ function auth_saml2_get_sp_metadata($baseurl = '') {

$entityId = $source->getEntityId();
$spconfig = $source->getMetadata();
$store = SimpleSAML\Store::getInstance();
\SimpleSAML\Store\StoreFactory::getInstance('\\auth_saml2\\store');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit confused by this. It doesn't seem that $store was ever used. So could we not just delete this line?

jay-oswald pushed a commit that referenced this pull request Nov 20, 2024
extlib-simplesaml: backport mods to extlib. 3063297
Added support for IdP initiation flow #105 6ebf501
Fixed bug with Idp initiatied entityid ca34393

Edited 04/10/23 for peer review of pull #774
jay-oswald pushed a commit that referenced this pull request Nov 28, 2024
extlib-simplesaml: backport mods to extlib. 3063297
Added support for IdP initiation flow #105 6ebf501
Fixed bug with Idp initiatied entityid ca34393

Edited 04/10/23 for peer review of pull #774
gbarat87 pushed a commit that referenced this pull request Dec 11, 2024
extlib-simplesaml: backport mods to extlib. 3063297
Added support for IdP initiation flow #105 6ebf501
Fixed bug with Idp initiatied entityid ca34393

Edited 04/10/23 for peer review of pull #774
gbarat87 pushed a commit that referenced this pull request Dec 13, 2024
extlib-simplesaml: backport mods to extlib. 3063297
Added support for IdP initiation flow #105 6ebf501
Fixed bug with Idp initiatied entityid ca34393

Edited 04/10/23 for peer review of pull #774
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants