pdsinterop / php-solid-server

Standalone Solid Server written in PHP by PDS Interop
https://pdsinterop.org/php-solid-server/
MIT License
46 stars 7 forks source link

Update dependencies on pdsinterop modules #64

Closed michielbdejong closed 1 year ago

michielbdejong commented 1 year ago

Hm, PATCH tests still fail https://github.com/pdsinterop/php-solid-server/actions/runs/3126255113/jobs/5071537614#step:3:2307 Apparently it's not using the latest version of php-solid-crud then? Investigating.

michielbdejong commented 1 year ago

Actually that composer update commit just updated composer.log for the main branch ^

Now did it properly on this branch and found:

root@mesh:~/michiel-dev/php-solid-server# docker run -it -v /hevel:/hevel standalone-solid-server /bin/bash
root@fa35d7a046aa:/app# composer update
Loading composer repositories with package information
Info from https://repo.packagist.org: #StandWithUkraine
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires pdsinterop/flysystem-rdf ^0.5 -> satisfiable by pdsinterop/flysystem-rdf[v0.5.0].
    - pdsinterop/flysystem-rdf v0.5.0 requires php ^8.0 -> your php version (7.3.33) does not satisfy that requirement.
  Problem 2
    - Root composer.json requires pdsinterop/solid-auth ^0.7 -> satisfiable by pdsinterop/solid-auth[v0.7.0].
    - pdsinterop/solid-auth v0.7.0 requires php ^8.0 -> your php version (7.3.33) does not satisfy that requirement.
  Problem 3
    - Root composer.json requires pdsinterop/solid-crud ^0.6 -> satisfiable by pdsinterop/solid-crud[v0.6.0].
    - pdsinterop/solid-crud v0.6.0 requires php ^8.0 -> your php version (7.3.33) does not satisfy that requirement.

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
michielbdejong commented 1 year ago

Updating to PHP 8

michielbdejong commented 1 year ago
root@ec4de407b53e:/app# curl -k https://server/.well-known/openid-configuration
<br />
<b>Warning</b>:  Undefined array key "client_id" in <b>/app/src/Controller/ServerController.php</b> on line <b>62</b><br />
<br />
<b>Fatal error</b>:  Uncaught Laminas\HttpHandlerRunner\Exception\EmitterException: Unable to emit response; headers already sent in /app/vendor/laminas/laminas-httphandlerrunner/src/Exception/EmitterException.php:19
Stack trace:
#0 /app/vendor/laminas/laminas-httphandlerrunner/src/Emitter/SapiEmitterTrait.php(36): Laminas\HttpHandlerRunner\Exception\EmitterException::forHeadersSent()
#1 /app/vendor/laminas/laminas-httphandlerrunner/src/Emitter/SapiEmitter.php(27): Laminas\HttpHandlerRunner\Emitter\SapiEmitter-&gt;assertNoPreviousOutput()
#2 /app/web/index.php(253): Laminas\HttpHandlerRunner\Emitter\SapiEmitter-&gt;emit(Object(Laminas\Diactoros\Response))
#3 {main}
  thrown in <b>/app/vendor/laminas/laminas-httphandlerrunner/src/Exception/EmitterException.php</b> on line <b>19</b><br />
michielbdejong commented 1 year ago

Running outside Docker for faster development:

michielbdejong commented 1 year ago

Seeing two errors on my laptop host (PHP v8.1.4) that I'm not seeing in Docker, ignoring them for now:

michielbdejong commented 1 year ago
curl -k https://server/profile/card
<h1>Oh-no! The developers messed up!</h1><p>Class "EasyRdf_Graph" not found (Error)</p>
michielbdejong commented 1 year ago

172.26.0.5 - - [26/Sep/2022:09:58:39 +0000] "GET /authorize?response_type=id_token%20code&redirect_uri=https%3A%2F%2Ftester&scope=openid%20profile%20offline_access&client_id=f5d1278e8109edd94e1e4197e04873b9&code_challenge_method=S256&code_challenge=eLYLOio8lBX9Fu3SmEW3twnhvfF2dDvIyGEODpfLahg&state=global HTTP/1.1" 500 1253 "-" "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)

curl --cookie "PHPSESSID=ef19ba32fd288e8fe60aecb1940fbcd0; path=/" -ik "https://server/authorize?response_type=id_token%20code&redirect_uri=https%3A%2F%2Ftester&scope=openid%20profile%20offline_access&client_id=f5d1278e8109edd94e1e4197e04873b9&code_challenge_method=S256&code_challenge=eLYLOio8lBX9Fu3SmEW3twnhvfF2dDvIyGEODpfLahg&state=global"

michielbdejong commented 1 year ago

That was fixed, now it's failing to correctly sign the token apparently (or maybe the public keys aren't listed correctly in the openid-configuration?) debugging with:

docker ps # got server, pubsub and thirdparty running
export COOKIE="`docker run --rm --cap-add=SYS_ADMIN --network=testnet -e SERVER_TYPE=php-solid-server --env-file ./env-vars-for-test-image.list cookie`"
docker run -it --rm --network=testnet --env COOKIE="$COOKIE" --env-file ./env-vars-for-test-image.list webid-provider-tests /bin/bash
root@492d9062c7b9:/app# vim test/surface/token.test.ts 
root@492d9062c7b9:/app# DEBUG=* ./node_modules/.bin/jest ./test/surface/token.test.ts 
michielbdejong commented 1 year ago

no 7dd0db8842135f3e4736d9640f862bec invalid nbf value

michielbdejong commented 1 year ago

Continued in #67