Skip to content

Commit

Permalink
Run latest version of solid-crud-tests (#103)
Browse files Browse the repository at this point in the history
* Use DpopFactoryTrait

* Use solid-crud-tests v7.0.5
  • Loading branch information
michielbdejong authored Oct 4, 2022
1 parent 59e9dda commit 7162a2c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
5 changes: 3 additions & 2 deletions run-solid-test-suite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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" \
Expand Down
21 changes: 18 additions & 3 deletions solid/lib/Controller/SolidWebhookController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
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;
use OCP\IRequest;
use OCP\IUserManager;
use OCP\IURLGenerator;
use OCP\ISession;
use OCP\IDBConnection;
use OCP\IConfig;
use OCP\Files\IRootFolder;
use OCP\Files\IHomeStorage;
Expand All @@ -29,6 +31,8 @@
use Pdsinterop\Solid\Auth\WAC as WAC;

class SolidWebhookController extends Controller {
use DpopFactoryTrait;

/* @var IURLGenerator */
private $urlGenerator;

Expand All @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 7162a2c

Please sign in to comment.