From 71d7f8c0f22ddb1e39b10ebd5bbacda9afa1c2ed Mon Sep 17 00:00:00 2001 From: Brian Gilbert Date: Wed, 15 Feb 2023 14:26:44 +1100 Subject: [PATCH 01/13] Update composer.json --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index f812457..7799ebd 100644 --- a/composer.json +++ b/composer.json @@ -21,8 +21,8 @@ } ], "require": { - "php": "^5.6.0|^7.0|^8.0", - "simplesamlphp/simplesamlphp": "~1.0", + "php": "^5.6.0|^7.0|^8.0|^8.1", + "simplesamlphp/simplesamlphp": "~1.0|~2.0", "simplesamlphp/composer-module-installer": "~1.0" }, "require-dev": { From 359ce0907742fa0cea4347027b241951821fa1ed Mon Sep 17 00:00:00 2001 From: Stuart Clark Date: Mon, 6 Mar 2023 13:26:24 +1100 Subject: [PATCH 02/13] chore: update for simplesamlphp 2 --- lib/Auth/Source/External.php | 10 ++++++---- lib/ConfigHelper.php | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/Auth/Source/External.php b/lib/Auth/Source/External.php index 6be7226..a744541 100755 --- a/lib/Auth/Source/External.php +++ b/lib/Auth/Source/External.php @@ -169,7 +169,7 @@ private function getUser() * * @param array &$state Information about the current authentication. */ - public function authenticate(&$state) + public function authenticate(array &$state): void { assert(is_array($state)); @@ -235,7 +235,8 @@ public function authenticate(&$state) * Note the 'ReturnTo' parameter. This must most likely be replaced with * the real name of the parameter for the login page. */ - HTTP::redirectTrustedURL($authPage, [ + $http_utils = new HTTP(); + $http_utils->redirectTrustedURL($authPage, [ 'ReturnTo' => $returnTo, ]); @@ -327,7 +328,7 @@ public static function resume() * * @param array &$state The logout state array. */ - public function logout(&$state) + public function logout(array &$state): void { assert(is_array($state)); @@ -347,6 +348,7 @@ public function logout(&$state) $parameters['ReturnTo'] = $state['ReturnTo']; } - HTTP::redirectTrustedURL($logout_url, $parameters); + $http_utils = new HTTP(); + $http_utils->redirectTrustedURL($logout_url, $parameters); } } diff --git a/lib/ConfigHelper.php b/lib/ConfigHelper.php index 0b72c0c..11e0753 100644 --- a/lib/ConfigHelper.php +++ b/lib/ConfigHelper.php @@ -93,7 +93,8 @@ public function __construct($config, $location) $this->drupal_login_url = $config->getString('drupal_login_url', null); $this->cookie_path = Configuration::getInstance()->getBasePath(); - $this->cookie_salt = Config::getSecretSalt(); + $config_utils = new Config(); + $this->cookie_salt = $config_utils->getSecretSalt(); } From 0ba6c5d865f98f6ac5981c9806e59b54582339ec Mon Sep 17 00:00:00 2001 From: Brian Gilbert Date: Sat, 11 Mar 2023 16:12:09 +1100 Subject: [PATCH 03/13] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 7799ebd..f1ab96c 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ ], "require": { "php": "^5.6.0|^7.0|^8.0|^8.1", - "simplesamlphp/simplesamlphp": "~1.0|~2.0", + "simplesamlphp/simplesamlphp": "~1.0|~2.0.2", "simplesamlphp/composer-module-installer": "~1.0" }, "require-dev": { From 15a849eac12b644aa2e28f4c1d2c7cbfebd809b1 Mon Sep 17 00:00:00 2001 From: Brian Gilbert Date: Tue, 14 Mar 2023 10:28:06 +1100 Subject: [PATCH 04/13] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index f1ab96c..4bc05a9 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ ], "require": { "php": "^5.6.0|^7.0|^8.0|^8.1", - "simplesamlphp/simplesamlphp": "~1.0|~2.0.2", + "simplesamlphp/simplesamlphp": "~1.0|~2.0.2|dev-master", "simplesamlphp/composer-module-installer": "~1.0" }, "require-dev": { From 82ec1a69a2f05246d3c60b1c950d2dc034b30fe8 Mon Sep 17 00:00:00 2001 From: Brian Gilbert Date: Tue, 9 May 2023 14:51:53 +1000 Subject: [PATCH 05/13] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 4bc05a9..30785c4 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ ], "require": { "php": "^5.6.0|^7.0|^8.0|^8.1", - "simplesamlphp/simplesamlphp": "~1.0|~2.0.2|dev-master", + "simplesamlphp/simplesamlphp": "~1.0|~2.0.3|dev-master", "simplesamlphp/composer-module-installer": "~1.0" }, "require-dev": { From c651bdfbf909e12a74cdc57332093a052afa2c79 Mon Sep 17 00:00:00 2001 From: Brian Gilbert Date: Thu, 29 Jun 2023 14:29:33 +1000 Subject: [PATCH 06/13] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 30785c4..6180363 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ ], "require": { "php": "^5.6.0|^7.0|^8.0|^8.1", - "simplesamlphp/simplesamlphp": "~1.0|~2.0.3|dev-master", + "simplesamlphp/simplesamlphp": "~1.0|^2.0.0", "simplesamlphp/composer-module-installer": "~1.0" }, "require-dev": { From 870a0d3e66bacab8ed5eb60f074cdb9ac209ead2 Mon Sep 17 00:00:00 2001 From: Brian Gilbert Date: Thu, 29 Jun 2023 14:42:20 +1000 Subject: [PATCH 07/13] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 6180363..2b8058b 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ ], "require": { "php": "^5.6.0|^7.0|^8.0|^8.1", - "simplesamlphp/simplesamlphp": "~1.0|^2.0.0", + "simplesamlphp/simplesamlphp": "^2.0.0", "simplesamlphp/composer-module-installer": "~1.0" }, "require-dev": { From 45ec9490f24d8ff4167f4cf00e7517f2385df886 Mon Sep 17 00:00:00 2001 From: Brian Gilbert Date: Thu, 29 Jun 2023 14:46:33 +1000 Subject: [PATCH 08/13] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 2b8058b..415d354 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,7 @@ }, "extra": { "branch-alias": { - "dev-master": "1.8.x-dev" + "dev-master": "1.9.x-dev" } } } From 05b95b36cdaf777da3932d4f4c23f6e41136b28b Mon Sep 17 00:00:00 2001 From: Stuart Clark Date: Thu, 27 Jul 2023 10:03:21 +1000 Subject: [PATCH 09/13] update external source as required --- lib/Auth/Source/External.php | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/lib/Auth/Source/External.php b/lib/Auth/Source/External.php index a744541..e06c60a 100755 --- a/lib/Auth/Source/External.php +++ b/lib/Auth/Source/External.php @@ -13,6 +13,8 @@ use SimpleSAML\Module\drupalauth\ConfigHelper; use SimpleSAML\Module\drupalauth\DrupalHelper; use SimpleSAML\Utils\HTTP; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; /** * Drupal authentication source for SimpleSAMLphp using Drupal's login page. @@ -169,7 +171,7 @@ private function getUser() * * @param array &$state Information about the current authentication. */ - public function authenticate(array &$state): void + public function authenticate(Request $request, array &$state): ?Response { assert(is_array($state)); @@ -182,7 +184,7 @@ public function authenticate(array &$state): void * to the authentication process. */ $state['Attributes'] = $attributes; - return; + return null; } /* @@ -236,14 +238,9 @@ public function authenticate(array &$state): void * the real name of the parameter for the login page. */ $http_utils = new HTTP(); - $http_utils->redirectTrustedURL($authPage, [ + return $http_utils->redirectTrustedURL($authPage, [ 'ReturnTo' => $returnTo, ]); - - /* - * The redirect function never returns, so we never get this far. - */ - assert(false); } /** @@ -328,7 +325,7 @@ public static function resume() * * @param array &$state The logout state array. */ - public function logout(array &$state): void + public function logout(array &$state): ?Response { assert(is_array($state)); @@ -349,6 +346,6 @@ public function logout(array &$state): void } $http_utils = new HTTP(); - $http_utils->redirectTrustedURL($logout_url, $parameters); + return $http_utils->redirectTrustedURL($logout_url, $parameters); } } From f87be32b9dffd6dbe154decc8076c27288f455b0 Mon Sep 17 00:00:00 2001 From: Brian Gilbert Date: Mon, 4 Sep 2023 10:23:52 +1000 Subject: [PATCH 10/13] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 415d354..5f65a2f 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ ], "require": { "php": "^5.6.0|^7.0|^8.0|^8.1", - "simplesamlphp/simplesamlphp": "^2.0.0", + "simplesamlphp/simplesamlphp": "dev-simplesamlphp-2.1", "simplesamlphp/composer-module-installer": "~1.0" }, "require-dev": { From ca8ea31ad485de458d3043455bbb6ec54204c455 Mon Sep 17 00:00:00 2001 From: Stuart Clark Date: Mon, 4 Sep 2023 13:07:52 +1000 Subject: [PATCH 11/13] chore: update module for 2.1 --- lib/Auth/Source/External.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/Auth/Source/External.php b/lib/Auth/Source/External.php index e06c60a..6900295 100755 --- a/lib/Auth/Source/External.php +++ b/lib/Auth/Source/External.php @@ -171,7 +171,7 @@ private function getUser() * * @param array &$state Information about the current authentication. */ - public function authenticate(Request $request, array &$state): ?Response + public function authenticate(array &$state): void { assert(is_array($state)); @@ -184,7 +184,7 @@ public function authenticate(Request $request, array &$state): ?Response * to the authentication process. */ $state['Attributes'] = $attributes; - return null; + return; } /* @@ -238,7 +238,7 @@ public function authenticate(Request $request, array &$state): ?Response * the real name of the parameter for the login page. */ $http_utils = new HTTP(); - return $http_utils->redirectTrustedURL($authPage, [ + $http_utils->redirectTrustedURL($authPage, [ 'ReturnTo' => $returnTo, ]); } @@ -325,7 +325,7 @@ public static function resume() * * @param array &$state The logout state array. */ - public function logout(array &$state): ?Response + public function logout(array &$state): void { assert(is_array($state)); @@ -346,6 +346,6 @@ public function logout(array &$state): ?Response } $http_utils = new HTTP(); - return $http_utils->redirectTrustedURL($logout_url, $parameters); + $http_utils->redirectTrustedURL($logout_url, $parameters); } } From 58111f343242cfbd7365e1681eb480cd1862c8b8 Mon Sep 17 00:00:00 2001 From: Brian Gilbert Date: Mon, 18 Sep 2023 10:21:25 +1000 Subject: [PATCH 12/13] update folder name to be compatible with simplesamle 2.x --- {www => public}/resume.php | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {www => public}/resume.php (100%) diff --git a/www/resume.php b/public/resume.php similarity index 100% rename from www/resume.php rename to public/resume.php From 85bfb0f8eb0840c24591b701ff2d3f96c33d0946 Mon Sep 17 00:00:00 2001 From: Aaron Bauman Date: Fri, 22 Sep 2023 17:08:00 -0400 Subject: [PATCH 13/13] Rename 'lib' directory to 'src' so that autodiscovery can find our classes --- {lib => src}/Auth/Source/External.php | 0 {lib => src}/Auth/Source/UserPass.php | 0 {lib => src}/ConfigHelper.php | 0 {lib => src}/DrupalHelper.php | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename {lib => src}/Auth/Source/External.php (100%) rename {lib => src}/Auth/Source/UserPass.php (100%) rename {lib => src}/ConfigHelper.php (100%) rename {lib => src}/DrupalHelper.php (100%) diff --git a/lib/Auth/Source/External.php b/src/Auth/Source/External.php similarity index 100% rename from lib/Auth/Source/External.php rename to src/Auth/Source/External.php diff --git a/lib/Auth/Source/UserPass.php b/src/Auth/Source/UserPass.php similarity index 100% rename from lib/Auth/Source/UserPass.php rename to src/Auth/Source/UserPass.php diff --git a/lib/ConfigHelper.php b/src/ConfigHelper.php similarity index 100% rename from lib/ConfigHelper.php rename to src/ConfigHelper.php diff --git a/lib/DrupalHelper.php b/src/DrupalHelper.php similarity index 100% rename from lib/DrupalHelper.php rename to src/DrupalHelper.php