pdsinterop / test-suites

Test suites for protocols a Personal Data Store may support
https://pdsinterop.org/test-suites/
MIT License
2 stars 11 forks source link

400 responses when running webid-provider tests against nextcloud-server #26

Closed michielbdejong closed 3 years ago

michielbdejong commented 3 years ago
root@7674055aaf7d:/app# curl -ki -H 'Accept: text/html' https://host.docker.internal/apps/solid/openid
HTTP/1.1 400 Bad Request
michielbdejong commented 3 years ago

That's when running from inside the tester docker container.

But when running it all on the host machine, it works fine:

loopy:webid-provider-tests michiel$ NODE_TLS_REJECT_UNAUTHORIZED=0 SERVER_ROOT=https://localhost ./node_modules/.bin/jest test/surface/fetch-openid-config.test.ts 
(node:8545) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
 PASS  test/surface/fetch-openid-config.test.ts

Test Suites: 1 passed, 1 total
Tests:       4 skipped, 13 passed, 17 total
Snapshots:   0 total
Time:        1.266 s, estimated 4 s
Ran all test suites matching /test\/surface\/fetch-openid-config.test.ts/i.
michielbdejong commented 3 years ago

This issue must be caused by the docker.host.internal approach (which is necessary to harvest the cookie as described in https://github.com/pdsinterop/test-suites#running-with-manually-harvested-cookie), because if you just run the test normally, it does not get any 400 errors:

loopy:test-suites michiel$ ./runTesterAgainstServer.sh webid-provider nextcloud-server
[...]
root@0596129692a8:/app# ./node_modules/.bin/jest test/surface/fetch-openid-config.test.ts 
(node:32) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
(Use `node --trace-warnings ...` to show where the warning was created)
 PASS  test/surface/fetch-openid-config.test.ts

Test Suites: 1 passed, 1 total
Tests:       4 skipped, 13 passed, 17 total
Snapshots:   0 total
Time:        1.536 s
Ran all test suites matching /test\/surface\/fetch-openid-config.test.ts/i.
root@0596129692a8:/app# exit 
exit
Tester exited, stopping server ...
server