Skip to content

Commit db83408

Browse files
committed
Merge branch 'main' into fix/refreshToken
2 parents a48d395 + 603316c commit db83408

File tree

8 files changed

+834
-50
lines changed

8 files changed

+834
-50
lines changed

.github/workflows/solid-tests-suites.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ name: Solid Test Suites
44
env:
55
# Docker Hub digest (i.e. hash) of the used Docker Images that do not have a version tag.
66
PUBSUB_TAG: latest@sha256:b73a2a5c98d2005bb667dfc69d1c859d704366024298b9caa24ea2e182c456c2
7-
COOKIE_TAG: latest@sha256:c71a3947f97d96ce09823743182582e0d919738be0d4ef5c8c55a9c22c615b91
7+
COOKIE_TAG: latest@sha256:b2815496a1291a8f0f8bf2524c42d6000a4a1d6a202b319fe01e1afacf1cec7d
88

99
on:
1010
push:

run-solid-test-suite.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
set -e
44

5+
: "${COOKIE_TAG:=latest@sha256:b2815496a1291a8f0f8bf2524c42d6000a4a1d6a202b319fe01e1afacf1cec7d}"
6+
57
# Note that .github/workflows/solid-tests-suites.yml does not use this, this function is just for manual runs of this script.
68
# You can pick different values for the NEXTCLOUD_VERSION build arg, as required:
79
function setup {
@@ -10,7 +12,7 @@ function setup {
1012

1113
docker network create testnet
1214

13-
docker pull michielbdejong/nextcloud-cookie
15+
docker pull "michielbdejong/nextcloud-cookie:${COOKIE_TAG}"
1416
docker pull solidtestsuite/solid-crud-tests:v7.0.5
1517
docker pull solidtestsuite/web-access-control-tests:v7.1.0
1618
docker pull solidtestsuite/webid-provider-tests:v2.1.1
@@ -46,7 +48,12 @@ function startSolidNextcloud {
4648
docker exec -u www-data -i -e SERVER_ROOT="https://$1" "$1" sh /init.sh
4749
docker exec -u root -i "$1" service apache2 reload
4850
echo Getting cookie for "$1"...
49-
export COOKIE_$1="$(docker run --cap-add=SYS_ADMIN --network=testnet --env-file "./env-vars-$1.list" michielbdejong/nextcloud-cookie)"
51+
export COOKIE_$1="$(docker run \
52+
--cap-add=SYS_ADMIN \
53+
--network=testnet \
54+
--env-file "./env-vars-$1.list" \
55+
"michielbdejong/nextcloud-cookie:${COOKIE_TAG}"
56+
)"
5057
}
5158

5259
function runTests {

solid/js/vendor/simplyedit/simply.everything.js

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -556,38 +556,6 @@ properties for a given parent, keep seperate index for this?
556556
}
557557
}
558558

559-
var linkHandler = function(evt) {
560-
if (evt.ctrlKey) {
561-
return;
562-
}
563-
if (evt.which != 1) {
564-
return; // not a 'left' mouse click
565-
}
566-
var link = evt.target;
567-
while (link && link.tagName!='A') {
568-
link = link.parentElement;
569-
}
570-
if (link
571-
&& link.pathname
572-
&& link.hostname==global.location.hostname
573-
&& !link.link
574-
&& !link.dataset.simplyCommand
575-
) {
576-
let path = getPath(link.pathname+link.hash);
577-
if ( !route.has(path) ) {
578-
path = getPath(link.pathname);
579-
}
580-
if ( route.has(path) ) {
581-
let params = runListeners('goto', { path: path});
582-
if (params.path) {
583-
route.goto(params.path);
584-
}
585-
evt.preventDefault();
586-
return false;
587-
}
588-
}
589-
};
590-
591559
var options = {
592560
root: '/'
593561
};
@@ -642,7 +610,6 @@ properties for a given parent, keep seperate index for this?
642610
route.match(getPath(document.location.pathname));
643611
}
644612
});
645-
global.document.addEventListener('click', linkHandler);
646613
},
647614
load: function(routes) {
648615
parseRoutes(routes);

solid/lib/BaseServerConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ public function setUserSubDomainsEnabled($enabled) {
202202

203203
////////////////////////////// UTILITY METHODS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\
204204

205-
private function castToBool(string $mixedValue): bool
205+
private function castToBool(?string $mixedValue): bool
206206
{
207207
$type = gettype($mixedValue);
208208

solid/lib/Controller/ServerController.php

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ class ServerController extends Controller
2323
{
2424
use DpopFactoryTrait;
2525

26+
public const ERROR_UNREGISTERED_URI = 'Provided redirect URI "%s" does not match any registered URIs';
2627
private $userId;
2728

2829
/* @var IUserManager */
@@ -227,10 +228,28 @@ public function authorize() {
227228
return $result; // ->addHeader('Access-Control-Allow-Origin', '*');
228229
}
229230

230-
$parsedOrigin = parse_url($clientRegistration['redirect_uris'][0]);
231+
if (isset($getVars['redirect_uri'])) {
232+
$redirectUri = $getVars['redirect_uri'];
233+
if (! isset($clientRegistration['redirect_uris']) || ! is_array($clientRegistration['redirect_uris'])) {
234+
return new JSONResponse('Invalid client registration, no redirect URIs found', Http::STATUS_BAD_REQUEST);
235+
}
236+
237+
$redirectUris = $clientRegistration['redirect_uris'];
238+
239+
$validRedirectUris = array_filter($redirectUris, function ($uri) use ($redirectUri) {
240+
return $uri === $redirectUri;
241+
});
242+
243+
if (count($validRedirectUris) === 0) {
244+
$message = vsprintf(self::ERROR_UNREGISTERED_URI, [$redirectUri]);
245+
return new JSONResponse($message, Http::STATUS_BAD_REQUEST);
246+
}
247+
}
248+
249+
$parsedOrigin = parse_url($redirectUri);
231250
if (
232-
$parsedOrigin['scheme'] != "https" &&
233-
$parsedOrigin['scheme'] != "http" &&
251+
$parsedOrigin['scheme'] !== "https" &&
252+
$parsedOrigin['scheme'] !== "http" &&
234253
!isset($_GET['customscheme'])
235254
) {
236255
$result = new JSONResponse('Custom schema');
@@ -372,8 +391,8 @@ public function logout() {
372391
public function register() {
373392
$clientData = file_get_contents('php://input');
374393
$clientData = json_decode($clientData, true);
375-
if (!$clientData['redirect_uris']) {
376-
return new JSONResponse("Missing redirect URIs");
394+
if (! isset($clientData['redirect_uris'])) {
395+
return new JSONResponse("Missing redirect URIs", Http::STATUS_BAD_REQUEST);
377396
}
378397
$clientData['client_id_issued_at'] = time();
379398
$parsedOrigin = parse_url($clientData['redirect_uris'][0]);

0 commit comments

Comments
 (0)