From 7162a2c30be90aeb9c1d636eae19f60bcfc751d7 Mon Sep 17 00:00:00 2001 From: Michiel de Jong Date: Tue, 4 Oct 2022 16:02:36 +0200 Subject: [PATCH] Run latest version of solid-crud-tests (#103) * Use DpopFactoryTrait * Use solid-crud-tests v7.0.5 --- run-solid-test-suite.sh | 5 +++-- .../lib/Controller/SolidWebhookController.php | 21 ++++++++++++++++--- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/run-solid-test-suite.sh b/run-solid-test-suite.sh index 73e11872..25f4048e 100755 --- a/run-solid-test-suite.sh +++ b/run-solid-test-suite.sh @@ -8,8 +8,8 @@ function setup { docker pull michielbdejong/nextcloud-cookie docker pull solidtestsuite/webid-provider-tests:v2.1.0 docker tag solidtestsuite/webid-provider-tests:v2.1.0 webid-provider-tests - docker pull solidtestsuite/solid-crud-tests:v6.0.0 - docker tag solidtestsuite/solid-crud-tests:v6.0.0 solid-crud-tests + docker pull solidtestsuite/solid-crud-tests:v7.0.5 + docker tag solidtestsuite/solid-crud-tests:v7.0.5 solid-crud-tests docker pull solidtestsuite/web-access-control-tests:v7.1.0 docker tag solidtestsuite/web-access-control-tests:v7.1.0 web-access-control-tests } @@ -44,6 +44,7 @@ function startSolidNextcloud { function runTests { echo "Running $1 tests against server with cookie $COOKIE_server" docker run --rm --network=testnet \ + --name tester \ --env COOKIE="$COOKIE_server" \ --env COOKIE_ALICE="$COOKIE_server" \ --env COOKIE_BOB="$COOKIE_thirdparty" \ diff --git a/solid/lib/Controller/SolidWebhookController.php b/solid/lib/Controller/SolidWebhookController.php index 977bf0fc..6a88a81e 100644 --- a/solid/lib/Controller/SolidWebhookController.php +++ b/solid/lib/Controller/SolidWebhookController.php @@ -8,6 +8,7 @@ use OCA\Solid\ServerConfig; use OCA\Solid\PlainResponse; use OCA\Solid\Notifications\SolidNotifications; +use OCA\Solid\DpopFactoryTrait; use OCP\AppFramework\Controller; use OCP\AppFramework\Http\DataResponse; @@ -15,6 +16,7 @@ use OCP\IUserManager; use OCP\IURLGenerator; use OCP\ISession; +use OCP\IDBConnection; use OCP\IConfig; use OCP\Files\IRootFolder; use OCP\Files\IHomeStorage; @@ -29,6 +31,8 @@ use Pdsinterop\Solid\Auth\WAC as WAC; class SolidWebhookController extends Controller { + use DpopFactoryTrait; + /* @var IURLGenerator */ private $urlGenerator; @@ -38,8 +42,18 @@ class SolidWebhookController extends Controller { /** @var SolidWebhookService */ private $webhookService; - public function __construct($AppName, IRootFolder $rootFolder, IRequest $request, ISession $session, IUserManager $userManager, IURLGenerator $urlGenerator, $userId, IConfig $config, SolidWebhookService $webhookService) - { + public function __construct( + $AppName, + IRootFolder $rootFolder, + IRequest $request, + ISession $session, + IUserManager $userManager, + IURLGenerator $urlGenerator, + $userId, + IConfig $config, + SolidWebhookService $webhookService, + IDBConnection $connection, + ) { parent::__construct($AppName, $request); require_once(__DIR__.'/../../vendor/autoload.php'); $this->config = new \OCA\Solid\ServerConfig($config, $urlGenerator, $userManager); @@ -49,7 +63,8 @@ public function __construct($AppName, IRootFolder $rootFolder, IRequest $request $this->session = $session; $this->webhookService = $webhookService; - $this->DPop = new DPop(); + $this->setJtiStorage($connection); + $this->DPop = $this->getDpop(); try { $this->rawRequest = \Laminas\Diactoros\ServerRequestFactory::fromGlobals($_SERVER, $_GET, $_POST, $_COOKIE, $_FILES); $this->webId = $this->DPop->getWebId($this->rawRequest);