diff --git a/.github/workflows/solid-tests-suites.yml b/.github/workflows/solid-tests-suites.yml index 4ae2e5f3..da00f1e2 100644 --- a/.github/workflows/solid-tests-suites.yml +++ b/.github/workflows/solid-tests-suites.yml @@ -3,7 +3,7 @@ name: Solid Test Suites env: # Docker Hub digest (i.e. hash) of the used Docker Images that do not have a version tag. - PUBSUB_TAG: latest@sha256:35166933e3d30bde801fd156bd2f21ebba9cdeca464ebd574c6be4cdb14d35cd + PUBSUB_TAG: latest@sha256:b73a2a5c98d2005bb667dfc69d1c859d704366024298b9caa24ea2e182c456c2 COOKIE_TAG: latest@sha256:c71a3947f97d96ce09823743182582e0d919738be0d4ef5c8c55a9c22c615b91 on: @@ -153,6 +153,10 @@ jobs: --env-file ./env-vars-testers.list \ ${{ matrix.test }} +# - name: Setup tmate session - ${{ matrix.test }} +# if: failure() +# uses: mxschmitt/action-tmate@v3 + - name: Show nextcloud logs - ${{ matrix.test }} if: always() run: | diff --git a/env-vars-server.list b/env-vars-server.list index 1f38d6fe..75b5fae7 100644 --- a/env-vars-server.list +++ b/env-vars-server.list @@ -4,4 +4,4 @@ ALICE_WEBID=https://server/apps/solid/~alice/profile/card#me COOKIE_TYPE=nextcloud-compatible USERNAME=alice PASSWORD=alice123 -PUBSUB_URL=http://pubsub:8080 +PUBSUB_URL=https://pubsub:8080 diff --git a/solid/composer.json b/solid/composer.json index 924bce73..5ec83de0 100644 --- a/solid/composer.json +++ b/solid/composer.json @@ -31,8 +31,9 @@ "lcobucci/jwt": "^4.1", "pdsinterop/flysystem-nextcloud": "^0.2", "pdsinterop/flysystem-rdf": "^0.6", - "pdsinterop/solid-auth": "^0.12.2", + "pdsinterop/solid-auth": "^0.13", "pdsinterop/solid-crud": "^0.8", + "phrity/websocket": "^3.5", "psr/log": "^1.1" }, "require-dev": { diff --git a/solid/composer.lock b/solid/composer.lock index e1053ebb..40beba96 100644 --- a/solid/composer.lock +++ b/solid/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "0dfcf10433b54d08c6bf8c7ed8115e1f", + "content-hash": "d71bcfd1c20fc01d5d37b45d79fdc793", "packages": [ { "name": "arc/base", @@ -1496,16 +1496,16 @@ }, { "name": "pdsinterop/solid-auth", - "version": "v0.12.2", + "version": "v0.13.0", "source": { "type": "git", "url": "https://github.com/pdsinterop/php-solid-auth.git", - "reference": "1d1160ee0f7ca71d3e34151aea94232e1cfa49ff" + "reference": "f5fa8941c4178c18d5e278fb814351033a5f2a03" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pdsinterop/php-solid-auth/zipball/1d1160ee0f7ca71d3e34151aea94232e1cfa49ff", - "reference": "1d1160ee0f7ca71d3e34151aea94232e1cfa49ff", + "url": "https://api.github.com/repos/pdsinterop/php-solid-auth/zipball/f5fa8941c4178c18d5e278fb814351033a5f2a03", + "reference": "f5fa8941c4178c18d5e278fb814351033a5f2a03", "shasum": "" }, "require": { @@ -1539,22 +1539,22 @@ "description": "OAuth2, OpenID and OIDC for Solid Server implementations.", "support": { "issues": "https://github.com/pdsinterop/php-solid-auth/issues", - "source": "https://github.com/pdsinterop/php-solid-auth/tree/v0.12.2" + "source": "https://github.com/pdsinterop/php-solid-auth/tree/v0.13.0" }, - "time": "2025-05-28T14:53:41+00:00" + "time": "2025-06-06T09:08:14+00:00" }, { "name": "pdsinterop/solid-crud", - "version": "v0.8.0", + "version": "v0.8.1", "source": { "type": "git", "url": "https://github.com/pdsinterop/php-solid-crud.git", - "reference": "ca1421770b17c69cc5989ce6864e86405030a50c" + "reference": "4b973948cca24bd38fd843dd3d356cb4f7c5de04" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pdsinterop/php-solid-crud/zipball/ca1421770b17c69cc5989ce6864e86405030a50c", - "reference": "ca1421770b17c69cc5989ce6864e86405030a50c", + "url": "https://api.github.com/repos/pdsinterop/php-solid-crud/zipball/4b973948cca24bd38fd843dd3d356cb4f7c5de04", + "reference": "4b973948cca24bd38fd843dd3d356cb4f7c5de04", "shasum": "" }, "require": { @@ -1566,8 +1566,7 @@ "php": "^8.0", "pietercolpaert/hardf": "^0.3", "psr/http-factory": "^1.0", - "psr/http-message": "^1.0", - "textalk/websocket": "^1.5" + "psr/http-message": "^1.0" }, "require-dev": { "phpunit/phpunit": "^9" @@ -1586,33 +1585,157 @@ "description": "Solid HTTPS REST API specification compliant implementation for handling Resource CRUD", "support": { "issues": "https://github.com/pdsinterop/php-solid-crud/issues", - "source": "https://github.com/pdsinterop/php-solid-crud/tree/v0.8.0" + "source": "https://github.com/pdsinterop/php-solid-crud/tree/v0.8.1" }, - "time": "2025-05-16T09:04:57+00:00" + "time": "2025-06-06T12:20:43+00:00" + }, + { + "name": "phrity/comparison", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/sirn-se/phrity-comparison.git", + "reference": "aedd44d59db08de7d6c31812d1490c22aab35c92" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sirn-se/phrity-comparison/zipball/aedd44d59db08de7d6c31812d1490c22aab35c92", + "reference": "aedd44d59db08de7d6c31812d1490c22aab35c92", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.0", + "phpstan/phpstan": "^2.0", + "phpunit/phpunit": "^10.0 | ^11.0 | ^12.0", + "squizlabs/php_codesniffer": "^3.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Phrity\\Comparison\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Sören Jensen", + "email": "sirn@sirn.se", + "homepage": "https://phrity.sirn.se" + } + ], + "description": "Interfaces and helper trait for comparing objects. Comparator for sort and filter applications.", + "homepage": "https://phrity.sirn.se/comparison", + "keywords": [ + "comparable", + "comparator", + "comparison", + "equalable", + "filter", + "sort" + ], + "support": { + "issues": "https://github.com/sirn-se/phrity-comparison/issues", + "source": "https://github.com/sirn-se/phrity-comparison/tree/1.4.0" + }, + "time": "2025-05-26T20:12:39+00:00" + }, + { + "name": "phrity/net-stream", + "version": "2.3.0", + "source": { + "type": "git", + "url": "https://github.com/sirn-se/phrity-net-stream.git", + "reference": "0ecc50a8ee7a708033d391ed60878b0bd5397bf8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sirn-se/phrity-net-stream/zipball/0ecc50a8ee7a708033d391ed60878b0bd5397bf8", + "reference": "0ecc50a8ee7a708033d391ed60878b0bd5397bf8", + "shasum": "" + }, + "require": { + "php": "^8.1", + "phrity/util-errorhandler": "^1.1", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.1 | ^2.0" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.0", + "phpstan/phpstan": "^2.0", + "phpunit/phpunit": "^10.0 | ^11.0 | ^12.0", + "phrity/net-uri": "^2.0", + "squizlabs/php_codesniffer": "^3.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Phrity\\Net\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Sören Jensen", + "email": "sirn@sirn.se", + "homepage": "https://phrity.sirn.se" + } + ], + "description": "Socket stream classes implementing PSR-7 Stream and PSR-17 StreamFactory", + "homepage": "https://phrity.sirn.se/net-stream", + "keywords": [ + "Socket", + "client", + "psr-17", + "psr-7", + "server", + "stream", + "stream factory" + ], + "support": { + "issues": "https://github.com/sirn-se/phrity-net-stream/issues", + "source": "https://github.com/sirn-se/phrity-net-stream/tree/2.3.0" + }, + "time": "2025-05-22T08:28:09+00:00" }, { "name": "phrity/net-uri", - "version": "1.3.0", + "version": "2.2.0", "source": { "type": "git", "url": "https://github.com/sirn-se/phrity-net-uri.git", - "reference": "3f458e0c4d1ddc0e218d7a5b9420127c63925f43" + "reference": "08de4cf07e439c4708f572249659f09198ac99f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sirn-se/phrity-net-uri/zipball/3f458e0c4d1ddc0e218d7a5b9420127c63925f43", - "reference": "3f458e0c4d1ddc0e218d7a5b9420127c63925f43", + "url": "https://api.github.com/repos/sirn-se/phrity-net-uri/zipball/08de4cf07e439c4708f572249659f09198ac99f0", + "reference": "08de4cf07e439c4708f572249659f09198ac99f0", "shasum": "" }, "require": { - "php": "^7.4 | ^8.0", + "ext-mbstring": "*", + "php": "^8.1", + "phrity/comparison": "^1.0", "psr/http-factory": "^1.0", - "psr/http-message": "^1.0 | ^2.0" + "psr/http-message": "^1.1 | ^2.0" }, "require-dev": { "php-coveralls/php-coveralls": "^2.0", - "phpunit/phpunit": "^9.0 | ^10.0", - "squizlabs/php_codesniffer": "^3.0" + "phpstan/phpstan": "^2.0", + "phpunit/phpunit": "^10.0 | ^11.0 | ^12.0", + "phrity/util-errorhandler": "^1.1", + "squizlabs/php_codesniffer": "^3.5" + }, + "suggest": { + "ext-intl": "Enables IDN conversion for non-ASCII domains" }, "type": "library", "autoload": { @@ -1641,9 +1764,9 @@ ], "support": { "issues": "https://github.com/sirn-se/phrity-net-uri/issues", - "source": "https://github.com/sirn-se/phrity-net-uri/tree/1.3.0" + "source": "https://github.com/sirn-se/phrity-net-uri/tree/2.2.0" }, - "time": "2023-08-21T10:33:06+00:00" + "time": "2025-05-25T13:05:13+00:00" }, { "name": "phrity/util-errorhandler", @@ -1697,6 +1820,68 @@ }, "time": "2025-05-26T18:26:51+00:00" }, + { + "name": "phrity/websocket", + "version": "3.5.0", + "source": { + "type": "git", + "url": "https://github.com/sirn-se/websocket-php.git", + "reference": "df3b4dbe3a8741159ae5cb5735476ebc4813d909" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sirn-se/websocket-php/zipball/df3b4dbe3a8741159ae5cb5735476ebc4813d909", + "reference": "df3b4dbe3a8741159ae5cb5735476ebc4813d909", + "shasum": "" + }, + "require": { + "php": "^8.1", + "phrity/net-stream": "^2.3", + "phrity/net-uri": "^2.1", + "psr/http-message": "^1.1 | ^2.0", + "psr/log": "^1.0 | ^2.0 | ^3.0" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.0", + "phpstan/phpstan": "^2.0", + "phpunit/phpunit": "^10.0 | ^11.0 | ^12.0", + "phrity/net-mock": "^2.3", + "phrity/util-errorhandler": "^1.1", + "squizlabs/php_codesniffer": "^3.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "WebSocket\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "ISC" + ], + "authors": [ + { + "name": "Fredrik Liljegren" + }, + { + "name": "Sören Jensen", + "email": "sirn@sirn.se", + "homepage": "https://phrity.sirn.se" + } + ], + "description": "WebSocket client and server", + "homepage": "https://phrity.sirn.se/websocket", + "keywords": [ + "client", + "server", + "websocket" + ], + "support": { + "issues": "https://github.com/sirn-se/websocket-php/issues", + "source": "https://github.com/sirn-se/websocket-php/tree/3.5.0" + }, + "time": "2025-05-23T13:13:41+00:00" + }, { "name": "pietercolpaert/hardf", "version": "0.3.1", @@ -2205,57 +2390,6 @@ }, "time": "2022-09-19T07:53:57+00:00" }, - { - "name": "textalk/websocket", - "version": "1.6.3", - "source": { - "type": "git", - "url": "https://github.com/Textalk/websocket-php.git", - "reference": "67de79745b1a357caf812bfc44e0abf481cee012" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Textalk/websocket-php/zipball/67de79745b1a357caf812bfc44e0abf481cee012", - "reference": "67de79745b1a357caf812bfc44e0abf481cee012", - "shasum": "" - }, - "require": { - "php": "^7.4 | ^8.0", - "phrity/net-uri": "^1.0", - "phrity/util-errorhandler": "^1.0", - "psr/http-message": "^1.0", - "psr/log": "^1.0 | ^2.0 | ^3.0" - }, - "require-dev": { - "php-coveralls/php-coveralls": "^2.0", - "phpunit/phpunit": "^9.0", - "squizlabs/php_codesniffer": "^3.5" - }, - "type": "library", - "autoload": { - "psr-4": { - "WebSocket\\": "lib" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "ISC" - ], - "authors": [ - { - "name": "Fredrik Liljegren" - }, - { - "name": "Sören Jensen" - } - ], - "description": "WebSocket client and server", - "support": { - "issues": "https://github.com/Textalk/websocket-php/issues", - "source": "https://github.com/Textalk/websocket-php/tree/1.6.3" - }, - "time": "2022-11-07T18:59:33+00:00" - }, { "name": "web-token/jwt-core", "version": "v2.2.11", diff --git a/solid/lib/Notifications/SolidPubSub.php b/solid/lib/Notifications/SolidPubSub.php index e0acaf4c..8d96a0ca 100644 --- a/solid/lib/Notifications/SolidPubSub.php +++ b/solid/lib/Notifications/SolidPubSub.php @@ -12,18 +12,19 @@ public function __construct($pubsubUrl) { } public function send($path, $type) { - $pubsub = str_replace(["https://", "http://"], "ws://", $this->pubsub); - - $client = new Client($pubsub, array( - 'headers' => array( - 'Sec-WebSocket-Protocol' => 'solid-0.1' - ) - )); + $pubsub = str_replace(["https://", "http://"], "wss://", $this->pubsub); + $client = new Client($pubsub); + $client->setContext(['ssl' => [ + 'verify_peer' => false, // if false, accept SSL handshake without client certificate + 'verify_peer_name' => false, + 'allow_self_signed' => true, + ]]); + $client->addHeader("Sec-WebSocket-Protocol", "solid-0.1"); try { - $client->send("pub $path\n"); + $client->text("pub $path\n"); } catch (\WebSocket\Exception $exception) { - throw new Exception('Could not write to pubsub server', 502, $exception); + throw new \Exception('Could not write to pubsub server', 502, $exception); } } }