From 7d20dd7e76d3b74deca373b189f44df8dc80be0f Mon Sep 17 00:00:00 2001 From: Yvo Brevoort Date: Thu, 24 Sep 2026 13:50:55 +0200 Subject: [PATCH 1/4] update php to 8.3 and laminas to 3^ --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 34a57d9..b2cba32 100644 --- a/composer.json +++ b/composer.json @@ -20,11 +20,11 @@ "license": "MIT", "name": "pdsinterop/solid-auth", "require": { - "php": "^8.0", + "php": "^8.3", "ext-json": "*", "ext-mbstring": "*", "ext-openssl": "*", - "laminas/laminas-diactoros": "^2.8", + "laminas/laminas-diactoros": "^3", "lcobucci/jwt": "^4.1", "league/oauth2-server": "^8.5.5", "web-token/jwt-core": "^2.2" From e0a8be23f22db2cff5b6d89d9c213bd2539f5408 Mon Sep 17 00:00:00 2001 From: Yvo Brevoort Date: Thu, 24 Sep 2026 15:10:34 +0200 Subject: [PATCH 2/4] easyrdf fix --- src/WAC.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/WAC.php b/src/WAC.php index 07da935..3dd3146 100644 --- a/src/WAC.php +++ b/src/WAC.php @@ -155,6 +155,7 @@ private function getPublicGrants($resourceUri) { } $acl = $this->filesystem->read($aclPath); + $acl .= "\n"; // Fix for sweetrdf not handling files that do not end with a newline $graph = new \EasyRdf\Graph(); @@ -193,6 +194,7 @@ private function getUserGrants($resourceUri, $webId) { return array(); } $acl = $this->filesystem->read($aclPath); + $acl .= "\n"; // Fix for sweetrdf not handling files that do not end with a newline $graph = new \EasyRdf\Graph(); $graph->parse($acl, Format::TURTLE, $this->getAclBase($aclPath)); @@ -257,6 +259,7 @@ private function getOriginGrants($resourceUri, $origin) { return array(); } $acl = $this->filesystem->read($aclPath); + $acl .= "\n"; // Fix for sweetrdf not handling files that do not end with a newline $graph = new \EasyRdf\Graph(); $graph->parse($acl, Format::TURTLE, $this->getAclBase($aclPath)); From e84b9973f9ccd8652bf62a6afad003b835ef7221 Mon Sep 17 00:00:00 2001 From: Yvo Brevoort Date: Wed, 30 Sep 2026 17:46:09 +0200 Subject: [PATCH 3/4] update filesystem methods to flysystem-3, pass adapter directly --- src/WAC.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/WAC.php b/src/WAC.php index 3dd3146..7462508 100644 --- a/src/WAC.php +++ b/src/WAC.php @@ -6,11 +6,13 @@ class WAC { private $filesystem; + private $adapter; private $baseUrl; private $basePath; - public function __construct($filesystem) { + public function __construct($filesystem, $adapter) { $this->filesystem = $filesystem; + $this->adapter = $adapter; $this->baseUrl = ''; $this->basePath = ''; } @@ -22,8 +24,8 @@ public function setBaseUrl($url) { } public function addWACHeaders($request, $response, $webId) { - $currentFormat = $this->filesystem->getAdapter()->getFormat(); // keep the format so we can put it back later. prevents the acl file from being converted; - $this->filesystem->getAdapter()->setFormat(''); + $currentFormat = $this->adapter()->getFormat(); // keep the format so we can put it back later. prevents the acl file from being converted; + $this->adapter()->setFormat(''); $uri = $request->getUri(); $userGrants = $this->getWACGrants($this->getUserGrants($uri, $webId), $uri); $publicGrants = $this->getWACGrants($this->getPublicGrants($uri), $uri); @@ -38,7 +40,7 @@ public function addWACHeaders($request, $response, $webId) { $response = $response->withAddedHeader("Link", '<.acl>; rel="acl"'); $response = $response->withHeader("WAC-Allow", implode(",", $wacHeaders)); - $this->filesystem->getAdapter()->setFormat($currentFormat); + $this->adapter()->setFormat($currentFormat); return $response; } @@ -310,7 +312,7 @@ private function getAclPath($path) { foreach ($aclOptions as $aclPath) { if ( - $this->filesystem->has($aclPath) && $this->filesystem->read($aclPath) !== false + $this->filesystem->fileExists($aclPath) && $this->filesystem->read($aclPath) !== false ) { return $aclPath; } @@ -326,7 +328,7 @@ private function normalizePath($path) { } private function getParentAcl($path) { // error_log("GET PARENT ACL $path"); - if ($this->filesystem->has($this->normalizePath($path.'/.acl'))) { + if ($this->filesystem->fileExists($this->normalizePath($path.'/.acl'))) { // error_log("CHECKING ACL FILE ON $path/.acl"); return $this->normalizePath($path . "/.acl"); } @@ -404,7 +406,7 @@ public function getRequestedGrants($request) { ); break; case "PUT": - if ($this->filesystem->has($path)) { + if ($this->filesystem->fileExists($path)) { return array( array( "type" => "resource", @@ -441,7 +443,7 @@ public function getRequestedGrants($request) { break; case "PATCH"; $grants = array(); - if (!$this->filesystem->has($path)) { + if (!$this->filesystem->fileExists($path)) { $grants[] = array( "type" => "parent", "grants" => array( @@ -468,7 +470,7 @@ public function getRequestedGrants($request) { ); } if (strstr($body, "inserts")) { - if ($this->filesystem->has($path)) { + if ($this->filesystem->fileExists($path)) { $grants[] = array( "type" => "resource", "grants" => array( @@ -510,7 +512,7 @@ private function getParentUri($uri) { $localPath = str_replace($this->basePath, '', $parentPath); if ($localPath == "/") { return $uri->withPath($parentPath); - } elseif ($this->filesystem->has($localPath)) { + } elseif ($this->filesystem->fileExists($localPath)) { return $uri->withPath($parentPath); } else { return $this->getParentUri($uri->withPath($parentPath)); From 688584a66c43d1529d84644de2b275b061dc310b Mon Sep 17 00:00:00 2001 From: Yvo Brevoort Date: Wed, 30 Sep 2026 18:04:25 +0200 Subject: [PATCH 4/4] remove () --- src/WAC.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/WAC.php b/src/WAC.php index 7462508..ea46600 100644 --- a/src/WAC.php +++ b/src/WAC.php @@ -24,8 +24,8 @@ public function setBaseUrl($url) { } public function addWACHeaders($request, $response, $webId) { - $currentFormat = $this->adapter()->getFormat(); // keep the format so we can put it back later. prevents the acl file from being converted; - $this->adapter()->setFormat(''); + $currentFormat = $this->adapter->getFormat(); // keep the format so we can put it back later. prevents the acl file from being converted; + $this->adapter->setFormat(''); $uri = $request->getUri(); $userGrants = $this->getWACGrants($this->getUserGrants($uri, $webId), $uri); $publicGrants = $this->getWACGrants($this->getPublicGrants($uri), $uri); @@ -40,7 +40,7 @@ public function addWACHeaders($request, $response, $webId) { $response = $response->withAddedHeader("Link", '<.acl>; rel="acl"'); $response = $response->withHeader("WAC-Allow", implode(",", $wacHeaders)); - $this->adapter()->setFormat($currentFormat); + $this->adapter->setFormat($currentFormat); return $response; }