From b5274fa0f72bb004562967b0389fe4a0e2d78694 Mon Sep 17 00:00:00 2001 From: Yvo Brevoort Date: Mon, 23 Jun 2025 16:18:14 +0200 Subject: [PATCH 01/24] handle token request cases for authorization_code and refresh_token differently --- solid/lib/Controller/ServerController.php | 41 ++++++++++++++++------- 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/solid/lib/Controller/ServerController.php b/solid/lib/Controller/ServerController.php index 06f18c9f..460bec39 100644 --- a/solid/lib/Controller/ServerController.php +++ b/solid/lib/Controller/ServerController.php @@ -297,7 +297,25 @@ public function session() { */ public function token() { $request = \Laminas\Diactoros\ServerRequestFactory::fromGlobals($_SERVER, $_GET, $_POST, $_COOKIE, $_FILES); - $code = $request->getParsedBody()['code']; + $grantType = $request->getParsedBody()['grant_type']; + switch ($grantType) { + case "authorization_code": + $code = $request->getParsedBody()['code']; + // FIXME: not sure if decoding this here is the way to go. + // FIXME: because this is a public page, the nonce from the session is not available here. + $codeInfo = $this->tokenGenerator->getCodeInfo($code); + $userId = $codeInfo['user_id']; + break; + case "refresh_token": + $refreshToken = $request->getParsedBody()['refresh_token']; + $tokenInfo = $this->tokenGenerator->getRefreshTokenInfo($refreshToken); + $userId = $tokenInfo['user_id']; + break; + default: + $userId = false; + break; + } + $clientId = $request->getParsedBody()['client_id']; $httpDpop = $request->getServerParams()['HTTP_DPOP']; @@ -306,17 +324,16 @@ public function token() { $server = new \Pdsinterop\Solid\Auth\Server($this->authServerFactory, $this->authServerConfig, $response); $response = $server->respondToAccessTokenRequest($request); - // FIXME: not sure if decoding this here is the way to go. - // FIXME: because this is a public page, the nonce from the session is not available here. - $codeInfo = $this->tokenGenerator->getCodeInfo($code); - $response = $this->tokenGenerator->addIdTokenToResponse( - $response, - $clientId, - $codeInfo['user_id'], - ($_SESSION['nonce'] ?? ''), - $this->config->getPrivateKey(), - $httpDpop - ); + if ($userId) { + $response = $this->tokenGenerator->addIdTokenToResponse( + $response, + $clientId, + $userId, + ($_SESSION['nonce'] ?? ''), + $this->config->getPrivateKey(), + $httpDpop + ); + } return $this->respond($response); // ->addHeader('Access-Control-Allow-Origin', '*'); } From f8fb8fa70640eee26306e993bf300127b567b30b Mon Sep 17 00:00:00 2001 From: Yvo Brevoort Date: Wed, 25 Jun 2025 22:43:47 +0200 Subject: [PATCH 02/24] Get client_id from either GET or POST --- solid/lib/Controller/ServerController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/solid/lib/Controller/ServerController.php b/solid/lib/Controller/ServerController.php index 460bec39..6a23de00 100644 --- a/solid/lib/Controller/ServerController.php +++ b/solid/lib/Controller/ServerController.php @@ -104,7 +104,8 @@ private function getKeys() { } private function createAuthServerConfig() { - $clientId = isset($_GET['client_id']) ? $_GET['client_id'] : null; + $request = \Laminas\Diactoros\ServerRequestFactory::fromGlobals($_SERVER, $_GET, $_POST, $_COOKIE, $_FILES); + $clientId = $request->getParsedBody()['client_id']; $client = $this->getClient($clientId); $keys = $this->getKeys(); try { From 9dbf4570f3b9d71208c4da1acac488988bed1c85 Mon Sep 17 00:00:00 2001 From: Ben Peachey Date: Thu, 26 Jun 2025 10:29:13 +0200 Subject: [PATCH 03/24] Change PHP Codesniffer style so `break` and `case` need to be indented the same. --- .config/phpcs.xml.dist | 5 +++++ solid/lib/Controller/ServerController.php | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.config/phpcs.xml.dist b/.config/phpcs.xml.dist index a6147742..10a3ed77 100644 --- a/.config/phpcs.xml.dist +++ b/.config/phpcs.xml.dist @@ -20,6 +20,11 @@ + + + + + diff --git a/solid/lib/Controller/ServerController.php b/solid/lib/Controller/ServerController.php index 6a23de00..44b98e2a 100644 --- a/solid/lib/Controller/ServerController.php +++ b/solid/lib/Controller/ServerController.php @@ -272,10 +272,10 @@ private function getResponseType() { foreach ($responseTypes as $responseType) { switch ($responseType) { case "token": - return "token"; + return "token"; break; case "code": - return "code"; + return "code"; break; } } From e6906c669ca953d7eac88c6a773954e18ae1cd6b Mon Sep 17 00:00:00 2001 From: Yvo Brevoort Date: Thu, 26 Jun 2025 17:58:32 +0200 Subject: [PATCH 04/24] rename decrypt call --- solid/lib/Controller/ServerController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/solid/lib/Controller/ServerController.php b/solid/lib/Controller/ServerController.php index 44b98e2a..ff3363e9 100644 --- a/solid/lib/Controller/ServerController.php +++ b/solid/lib/Controller/ServerController.php @@ -309,7 +309,7 @@ public function token() { break; case "refresh_token": $refreshToken = $request->getParsedBody()['refresh_token']; - $tokenInfo = $this->tokenGenerator->getRefreshTokenInfo($refreshToken); + $tokenInfo = $this->tokenGenerator->getCodeInfo($refreshToken); // FIXME: getCodeInfo should be named 'decrypt' or 'getInfo'? $userId = $tokenInfo['user_id']; break; default: @@ -385,7 +385,7 @@ public function register() { // ($request->getRawPathInfo() !== '/apps/oauth2/api/v1/token') && // ($request->getRawPathInfo() !== '/apps/solid/token') */ - // 'client_secret' => $clientData['client_secret'], // FIXME: Returning this means we need to patch Nextcloud to accept tokens on calls to + 'client_secret' => $clientData['client_secret'], // FIXME: Returning this means we need to patch Nextcloud to accept tokens on calls to 'registration_client_uri' => $this->urlGenerator->getAbsoluteURL($this->urlGenerator->linkToRoute("solid.server.registeredClient", array("clientId" => $clientData['client_id']))), 'client_id_issued_at' => $clientData['client_id_issued_at'], From e93cac62b2c7dbc490c87928569cf487e1b9b109 Mon Sep 17 00:00:00 2001 From: Yvo Brevoort Date: Thu, 26 Jun 2025 18:06:26 +0200 Subject: [PATCH 05/24] remove client_secret --- solid/lib/Controller/ServerController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solid/lib/Controller/ServerController.php b/solid/lib/Controller/ServerController.php index ff3363e9..553f6bfa 100644 --- a/solid/lib/Controller/ServerController.php +++ b/solid/lib/Controller/ServerController.php @@ -385,7 +385,7 @@ public function register() { // ($request->getRawPathInfo() !== '/apps/oauth2/api/v1/token') && // ($request->getRawPathInfo() !== '/apps/solid/token') */ - 'client_secret' => $clientData['client_secret'], // FIXME: Returning this means we need to patch Nextcloud to accept tokens on calls to + // 'client_secret' => $clientData['client_secret'], // FIXME: Returning this means we need to patch Nextcloud to accept tokens on calls to 'registration_client_uri' => $this->urlGenerator->getAbsoluteURL($this->urlGenerator->linkToRoute("solid.server.registeredClient", array("clientId" => $clientData['client_id']))), 'client_id_issued_at' => $clientData['client_id_issued_at'], From 80ee0f920b1464a0058b94a215568a8c9445abb8 Mon Sep 17 00:00:00 2001 From: Yvo Brevoort Date: Thu, 26 Jun 2025 20:11:15 +0200 Subject: [PATCH 06/24] straight from GET or POST --- solid/lib/Controller/ServerController.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/solid/lib/Controller/ServerController.php b/solid/lib/Controller/ServerController.php index 553f6bfa..1b098acd 100644 --- a/solid/lib/Controller/ServerController.php +++ b/solid/lib/Controller/ServerController.php @@ -104,8 +104,12 @@ private function getKeys() { } private function createAuthServerConfig() { - $request = \Laminas\Diactoros\ServerRequestFactory::fromGlobals($_SERVER, $_GET, $_POST, $_COOKIE, $_FILES); - $clientId = $request->getParsedBody()['client_id']; + $clientId = null; + if (isset($_GET['client_id'])) { + $clientId = $_GET['client_id']; + } else if (isset($_POST['client_id'])) { + $clientId = $_POST['client_id']; + } $client = $this->getClient($clientId); $keys = $this->getKeys(); try { From 487936ccf082212f02591dae486d16a22f644416 Mon Sep 17 00:00:00 2001 From: Yvo Brevoort Date: Thu, 26 Jun 2025 20:20:37 +0200 Subject: [PATCH 07/24] remove elseif nag --- .config/phpcs.xml.dist | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/phpcs.xml.dist b/.config/phpcs.xml.dist index 10a3ed77..202fd632 100644 --- a/.config/phpcs.xml.dist +++ b/.config/phpcs.xml.dist @@ -23,6 +23,7 @@ + From 490efe9706c6d454d2fce9265b2dae82b35d49d9 Mon Sep 17 00:00:00 2001 From: Yvo Brevoort Date: Thu, 26 Jun 2025 20:24:06 +0200 Subject: [PATCH 08/24] fix indentation --- solid/lib/Controller/ServerController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/solid/lib/Controller/ServerController.php b/solid/lib/Controller/ServerController.php index 1b098acd..f1ad3770 100644 --- a/solid/lib/Controller/ServerController.php +++ b/solid/lib/Controller/ServerController.php @@ -276,10 +276,10 @@ private function getResponseType() { foreach ($responseTypes as $responseType) { switch ($responseType) { case "token": - return "token"; + return "token"; break; case "code": - return "code"; + return "code"; break; } } From ae6bd9302c66a41c47fc5d3bad3ca02ceb53db16 Mon Sep 17 00:00:00 2001 From: Yvo Brevoort Date: Thu, 26 Jun 2025 20:24:49 +0200 Subject: [PATCH 09/24] remove switch case property that is not working as intended --- .config/phpcs.xml.dist | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/phpcs.xml.dist b/.config/phpcs.xml.dist index 202fd632..3887aeb6 100644 --- a/.config/phpcs.xml.dist +++ b/.config/phpcs.xml.dist @@ -21,8 +21,8 @@ - - + + From 28384b541b82df6a4db83020bde6d170f40276a0 Mon Sep 17 00:00:00 2001 From: Yvo Brevoort Date: Thu, 26 Jun 2025 20:28:33 +0200 Subject: [PATCH 10/24] exclude PSR2.ControlStructures.ControlStructureSpacing.SpacingAfterOpenBrace --- .config/phpcs.xml.dist | 1 + solid/tests/Integration/AppTest.php | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/phpcs.xml.dist b/.config/phpcs.xml.dist index 3887aeb6..c63bc0a9 100644 --- a/.config/phpcs.xml.dist +++ b/.config/phpcs.xml.dist @@ -24,6 +24,7 @@ + diff --git a/solid/tests/Integration/AppTest.php b/solid/tests/Integration/AppTest.php index 6347f963..f12c4b5e 100644 --- a/solid/tests/Integration/AppTest.php +++ b/solid/tests/Integration/AppTest.php @@ -5,7 +5,6 @@ use OCP\AppFramework\App; use Test\TestCase; - /** * This test shows how to make a small Integration Test. Query your class * directly from the container, only pass in mocks if needed and run your tests From 3ad37fa4e5285d346486dfd8787f7768a9529271 Mon Sep 17 00:00:00 2001 From: Yvo Brevoort Date: Thu, 26 Jun 2025 21:30:45 +0200 Subject: [PATCH 11/24] attempt to get the test suites to pass again --- solid/lib/Controller/ServerController.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/solid/lib/Controller/ServerController.php b/solid/lib/Controller/ServerController.php index f1ad3770..dbd51037 100644 --- a/solid/lib/Controller/ServerController.php +++ b/solid/lib/Controller/ServerController.php @@ -104,12 +104,14 @@ private function getKeys() { } private function createAuthServerConfig() { - $clientId = null; - if (isset($_GET['client_id'])) { - $clientId = $_GET['client_id']; - } else if (isset($_POST['client_id'])) { - $clientId = $_POST['client_id']; - } + $clientId = null; + if (isset($_GET['client_id'])) { + $clientId = $_GET['client_id']; + } else if (isset($_POST['client_id'])) { + if (isset($_POST['refresh_token'])) { // FIXME: Why does the test suite break without this? + $clientId = $_POST['client_id']; + } + } $client = $this->getClient($clientId); $keys = $this->getKeys(); try { From 80882205b20762b3f1d766667e5a0ab165aa8b81 Mon Sep 17 00:00:00 2001 From: Yvo Brevoort Date: Fri, 27 Jun 2025 13:50:29 +0200 Subject: [PATCH 12/24] first bits, try to register a user backend --- solid/appinfo/info.xml | 3 +++ solid/lib/AppInfo/Application.php | 2 ++ solid/lib/ClientAuth.php | 20 ++++++++++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 solid/lib/ClientAuth.php diff --git a/solid/appinfo/info.xml b/solid/appinfo/info.xml index ae64a0ff..5948943f 100644 --- a/solid/appinfo/info.xml +++ b/solid/appinfo/info.xml @@ -16,6 +16,9 @@ When you do this, the Solid App can store data in your Nextcloud account through Auke van Slooten Solid integration + + + https://github.com/pdsinterop/solid-nextcloud/issues diff --git a/solid/lib/AppInfo/Application.php b/solid/lib/AppInfo/Application.php index cb507bc0..55f18e77 100644 --- a/solid/lib/AppInfo/Application.php +++ b/solid/lib/AppInfo/Application.php @@ -10,6 +10,7 @@ use OCA\Solid\Service\SolidWebhookService; use OCA\Solid\Db\SolidWebhookMapper; use OCA\Solid\Middleware\SolidCorsMiddleware; +use OCA\Solid\ClientAuth; use OCP\AppFramework\App; use OCP\AppFramework\Bootstrap\IBootContext; @@ -67,6 +68,7 @@ public function register(IRegistrationContext $context): void { } public function boot(IBootContext $context): void { + \OC::$server->getUserManager()->registerBackend(new \OCA\Solid\ClientAuth()); self::$userSubDomainsEnabled = OC::$server->get(AppConfig::class)->getValueBool(self::APP_ID, 'userSubDomainsEnabled'); require_once(__DIR__.'/../../vendor/autoload.php'); } diff --git a/solid/lib/ClientAuth.php b/solid/lib/ClientAuth.php new file mode 100644 index 00000000..9437b59f --- /dev/null +++ b/solid/lib/ClientAuth.php @@ -0,0 +1,20 @@ +config = $config; + } + + public function checkPassword(string $username, string $password) { + return true; + } + } From becb43744e531d604ae940625efe3e8792cdebd5 Mon Sep 17 00:00:00 2001 From: Yvo Brevoort Date: Fri, 27 Jun 2025 14:39:40 +0200 Subject: [PATCH 13/24] move register step to constructor, it needs to be called before boot --- solid/lib/AppInfo/Application.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/solid/lib/AppInfo/Application.php b/solid/lib/AppInfo/Application.php index 55f18e77..64f561da 100644 --- a/solid/lib/AppInfo/Application.php +++ b/solid/lib/AppInfo/Application.php @@ -26,6 +26,9 @@ class Application extends App implements IBootstrap { * @param array $urlParams */ public function __construct(array $urlParams = []) { + $backend = new \OCA\Solid\ClientAuth(); + \OC::$server->getUserManager()->registerBackend($backend); + parent::__construct(self::APP_ID, $urlParams); } @@ -68,7 +71,6 @@ public function register(IRegistrationContext $context): void { } public function boot(IBootContext $context): void { - \OC::$server->getUserManager()->registerBackend(new \OCA\Solid\ClientAuth()); self::$userSubDomainsEnabled = OC::$server->get(AppConfig::class)->getValueBool(self::APP_ID, 'userSubDomainsEnabled'); require_once(__DIR__.'/../../vendor/autoload.php'); } From a9fdac7655ee3e8411e1d6e3558bf2546ca608a4 Mon Sep 17 00:00:00 2001 From: Yvo Brevoort Date: Fri, 27 Jun 2025 14:40:05 +0200 Subject: [PATCH 14/24] implement all functions to get something to run --- solid/lib/ClientAuth.php | 42 +++++++++++++++++++++++++++++++++------- 1 file changed, 35 insertions(+), 7 deletions(-) diff --git a/solid/lib/ClientAuth.php b/solid/lib/ClientAuth.php index 9437b59f..2e7224cb 100644 --- a/solid/lib/ClientAuth.php +++ b/solid/lib/ClientAuth.php @@ -8,13 +8,41 @@ * @package OCA\Solid */ class ClientAuth extends ABackend implements ICheckPasswordBackend { - private $config; + public function __construct() { + error_log("SO Constructed solid client auth backend"); + } - public function __construct(IConfig $config) { - $this->config = $config; + public function checkPassword(string $username, string $password) { + error_log("SO checking password for $username"); + return true; } - public function checkPassword(string $username, string $password) { - return true; - } - } + public function getBackendName() { + error_log("SO getBackendName"); + return "Solid"; + } + public function deleteUser($uid) { + error_log("SO deleteUser"); + return false; + } + public function getUsers($search = "", $limit = null, $offset = null, $callback = null) { + error_log("SO getUsers"); + return []; + } + public function userExists($uid) { + error_log("SO User exists"); + return true; + } + public function getDisplayName($uid) { + error_log("SO getDisplayName"); + return "Solid client"; + } + public function getDisplayNames($search = "", $limit = null, $offset = null) { + error_log("SO getDisplayNames"); + return []; + } + public function hasUserListings() { + error_log("SO hasUserListings"); + return false; + } + } From e6568ff1de7dcb8387f5c31125ade724bee8e09b Mon Sep 17 00:00:00 2001 From: Yvo Brevoort Date: Fri, 27 Jun 2025 14:49:18 +0200 Subject: [PATCH 15/24] only register for the token endpoint --- solid/lib/AppInfo/Application.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/solid/lib/AppInfo/Application.php b/solid/lib/AppInfo/Application.php index 64f561da..6affae4f 100644 --- a/solid/lib/AppInfo/Application.php +++ b/solid/lib/AppInfo/Application.php @@ -17,18 +17,25 @@ use OCP\AppFramework\Bootstrap\IBootstrap; use OCP\AppFramework\Bootstrap\IRegistrationContext; use OCP\IDBConnection; +use OCP\IRequest; +use OCP\Server; class Application extends App implements IBootstrap { public const APP_ID = 'solid'; - public static $userSubDomainsEnabled; + public static $userSubDomainsEnabled; /** * @param array $urlParams */ public function __construct(array $urlParams = []) { - $backend = new \OCA\Solid\ClientAuth(); - \OC::$server->getUserManager()->registerBackend($backend); + $request = \OCP\Server::get(\OCP\IRequest::class); + $rawPathInfo = $request->getRawPathInfo(); + error_log($rawPathInfo); + if ($rawPathInfo == '/apps/solid/token') { + $backend = new \OCA\Solid\ClientAuth(); + \OC::$server->getUserManager()->registerBackend($backend); + } parent::__construct(self::APP_ID, $urlParams); } From c045b4dd6db6768fbc3c668853615ef40f429679 Mon Sep 17 00:00:00 2001 From: Yvo Brevoort Date: Fri, 27 Jun 2025 14:50:14 +0200 Subject: [PATCH 16/24] token endpoint now uses the clientauth thing, so we can safely return client_secret --- solid/lib/Controller/ServerController.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/solid/lib/Controller/ServerController.php b/solid/lib/Controller/ServerController.php index dbd51037..0bedffed 100644 --- a/solid/lib/Controller/ServerController.php +++ b/solid/lib/Controller/ServerController.php @@ -385,14 +385,7 @@ public function register() { $clientData = $this->config->saveClientRegistration($origin, $clientData); $registration = array( 'client_id' => $clientData['client_id'], - /* - FIXME: returning client_secret will trigger calls with basic auth to us. To get this to work, we need this patch: - // File /var/www/vhosts/solid-nextcloud/site/www/lib/base.php not changed so no update needed - // ($request->getRawPathInfo() !== '/apps/oauth2/api/v1/token') && - // ($request->getRawPathInfo() !== '/apps/solid/token') - */ - // 'client_secret' => $clientData['client_secret'], // FIXME: Returning this means we need to patch Nextcloud to accept tokens on calls to - + 'client_secret' => $clientData['client_secret'], 'registration_client_uri' => $this->urlGenerator->getAbsoluteURL($this->urlGenerator->linkToRoute("solid.server.registeredClient", array("clientId" => $clientData['client_id']))), 'client_id_issued_at' => $clientData['client_id_issued_at'], 'redirect_uris' => $clientData['redirect_uris'], From e93980ad8bf9e49088805de4bb7f794c4877d45a Mon Sep 17 00:00:00 2001 From: Yvo Brevoort Date: Fri, 27 Jun 2025 15:07:14 +0200 Subject: [PATCH 17/24] remove error_log and add HUGE warning sign --- solid/lib/ClientAuth.php | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/solid/lib/ClientAuth.php b/solid/lib/ClientAuth.php index 2e7224cb..775828cd 100644 --- a/solid/lib/ClientAuth.php +++ b/solid/lib/ClientAuth.php @@ -1,4 +1,24 @@ Date: Fri, 27 Jun 2025 15:07:57 +0200 Subject: [PATCH 18/24] add warning --- solid/lib/ClientAuth.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/solid/lib/ClientAuth.php b/solid/lib/ClientAuth.php index 775828cd..894c37fe 100644 --- a/solid/lib/ClientAuth.php +++ b/solid/lib/ClientAuth.php @@ -10,8 +10,11 @@ where the actual authorization happens. The security for this user backend lies in the fact that it - is only activated for the token endpoint in the Solid app. - + is only activated for the token endpoint in the Solid app. + + In /lib/AppInfo/Application.php there is a check for the + token endpoint before this thing activates. + It is completely unsuitable as an actual user backend in the normal sense of the word. From 4d96b15a32ce95d6b28c1ebef52dc9cd9b8250e8 Mon Sep 17 00:00:00 2001 From: Yvo Brevoort Date: Fri, 27 Jun 2025 15:11:53 +0200 Subject: [PATCH 19/24] remove error_log --- solid/lib/AppInfo/Application.php | 1 - 1 file changed, 1 deletion(-) diff --git a/solid/lib/AppInfo/Application.php b/solid/lib/AppInfo/Application.php index 6affae4f..ab6d2014 100644 --- a/solid/lib/AppInfo/Application.php +++ b/solid/lib/AppInfo/Application.php @@ -30,7 +30,6 @@ class Application extends App implements IBootstrap { public function __construct(array $urlParams = []) { $request = \OCP\Server::get(\OCP\IRequest::class); $rawPathInfo = $request->getRawPathInfo(); - error_log($rawPathInfo); if ($rawPathInfo == '/apps/solid/token') { $backend = new \OCA\Solid\ClientAuth(); From 16f804883a575aa896c95c14d38bed3df27153fc Mon Sep 17 00:00:00 2001 From: Yvo Brevoort Date: Fri, 27 Jun 2025 15:12:54 +0200 Subject: [PATCH 20/24] whitespace --- solid/lib/ClientAuth.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solid/lib/ClientAuth.php b/solid/lib/ClientAuth.php index 894c37fe..9eb9f0ee 100644 --- a/solid/lib/ClientAuth.php +++ b/solid/lib/ClientAuth.php @@ -59,4 +59,4 @@ public function getDisplayNames($search = "", $limit = null, $offset = null) { public function hasUserListings() { return false; } - } + } From 0c3c148405308ee7de374f5dc0208140e05cc524 Mon Sep 17 00:00:00 2001 From: Yvo Brevoort Date: Fri, 27 Jun 2025 15:25:37 +0200 Subject: [PATCH 21/24] whitespace --- solid/tests/Unit/Controller/ServerControllerTest.php | 1 - 1 file changed, 1 deletion(-) diff --git a/solid/tests/Unit/Controller/ServerControllerTest.php b/solid/tests/Unit/Controller/ServerControllerTest.php index b1104cbd..2920b0dd 100644 --- a/solid/tests/Unit/Controller/ServerControllerTest.php +++ b/solid/tests/Unit/Controller/ServerControllerTest.php @@ -16,7 +16,6 @@ use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; - function file_get_contents($filename) { if ($filename === 'php://input') { From bd6e4081479c000f9d4c7c613859458f553dc6be Mon Sep 17 00:00:00 2001 From: Yvo Brevoort Date: Fri, 27 Jun 2025 15:31:08 +0200 Subject: [PATCH 22/24] remove refresh-token check that is no longer needed --- solid/lib/Controller/ServerController.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/solid/lib/Controller/ServerController.php b/solid/lib/Controller/ServerController.php index b4dc255b..55687119 100644 --- a/solid/lib/Controller/ServerController.php +++ b/solid/lib/Controller/ServerController.php @@ -109,9 +109,7 @@ private function createAuthServerConfig() { if (isset($_GET['client_id'])) { $clientId = $_GET['client_id']; } else if (isset($_POST['client_id'])) { - if (isset($_POST['refresh_token'])) { // FIXME: Why does the test suite break without this? - $clientId = $_POST['client_id']; - } + $clientId = $_POST['client_id']; } $client = $this->getClient($clientId); $keys = $this->getKeys(); From 8c7278ee6dd59daa8dd746431a941b5a0c92411a Mon Sep 17 00:00:00 2001 From: Yvo Brevoort Date: Fri, 27 Jun 2025 16:24:05 +0200 Subject: [PATCH 23/24] create trash directory on init --- init.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/init.sh b/init.sh index 4612a96b..e066c923 100644 --- a/init.sh +++ b/init.sh @@ -9,3 +9,4 @@ php console.php config:system:set trusted_domains 3 --value=thirdparty # set 'tester' and 'https://tester' as allowed clients for the test suite to run php console.php user:setting alice solid allowedClients '["f5d1278e8109edd94e1e4197e04873b9", "2e5cddcf0f663544e98982931e6cc5a6"]' echo configured +mkdir -p /var/www/html/data/files_trashbin/versions \ No newline at end of file From 4c64f33f6f8dfb9aff289b7c32407ff5616e7209 Mon Sep 17 00:00:00 2001 From: Yvo Brevoort Date: Fri, 27 Jun 2025 16:54:35 +0200 Subject: [PATCH 24/24] Revert "remove refresh-token check that is no longer needed" This reverts commit bd6e4081479c000f9d4c7c613859458f553dc6be. --- solid/lib/Controller/ServerController.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/solid/lib/Controller/ServerController.php b/solid/lib/Controller/ServerController.php index 55687119..b4dc255b 100644 --- a/solid/lib/Controller/ServerController.php +++ b/solid/lib/Controller/ServerController.php @@ -109,7 +109,9 @@ private function createAuthServerConfig() { if (isset($_GET['client_id'])) { $clientId = $_GET['client_id']; } else if (isset($_POST['client_id'])) { - $clientId = $_POST['client_id']; + if (isset($_POST['refresh_token'])) { // FIXME: Why does the test suite break without this? + $clientId = $_POST['client_id']; + } } $client = $this->getClient($clientId); $keys = $this->getKeys();