|
1 |
| -# monetization-tests |
2 |
| -Tests around https://github.com/solid/webmonetization |
| 1 | +# WAC Tests |
| 2 | +Surface tests for CRUD and Websockets-pubsub functionality of a pod server |
| 3 | + |
| 4 | +## Usage |
| 5 | +### In development |
| 6 | +Start your server with a self-signed cert on port 443 of localhost (for node-solid-server, make sure to set `ACL_CACHE_TIME=5`) and run `sh ./example.sh`. |
| 7 | + |
| 8 | +### Against CSS |
| 9 | +In one terminal window: |
| 10 | +* check out the https://github.com/solid/community-server repo locally, and run `npm ci; npm run build` |
| 11 | +* find the function `isRSAPublicJWK(x)` in node_modules/@solid/dist/identity-token-verifier/dist/guards/DPoPJWKGuard.js and add `x.alg = 'RS256'` at the top of that function, to work around a bug in NSS v5.6.4, caused by https://github.com/solid/oidc-op/issues/29. |
| 12 | +* ./bin/server.js -l debug |
| 13 | + |
| 14 | +In another terminal window: |
| 15 | +* check out this repo from https://github.com/solid/web-access-control-tests and run `npm ci` |
| 16 | +* check out the `run-against-css` branch |
| 17 | +* simple test (sets a root ACL doc from node and reads it back): |
| 18 | +- run `node ./setup.js http://localhost:3000/.acl` to create a root ACL at http://localhost:3000/.acl which gives https://solidtestsuite.solidcommunity.net/profile/card#me full read/write/control access. |
| 19 | +- run `node ./fetch.js http://localhost:3000/.acl` to check that Alice ('solidtestsuite') can access it. |
| 20 | +- run `node ./fetch-bob.js http://localhost:3000/.acl` to check that Bob ('solid-crud-tests-example-2') can *not* access it. |
| 21 | +* advanced test (uses the same root ACL doc, but from bash): `bash ./run-against-css.sh` |
| 22 | + |
| 23 | +You can also cut-and-paste the lines from run-against-css.sh into your bash shell, then you can more easily run tests interactively. |
| 24 | + |
| 25 | +### Against CSS with local NSS instance as the IDP |
| 26 | +If you want to use your NSS on localhost instead of on solidcommunity.net, then: |
| 27 | +* Run NSS on localhost, in multi-user mode so you can support both Alice and Bob |
| 28 | +* You may need to set up alice.localhost in your /etc/hosts, but on Mac that is automatic. |
| 29 | +* Browse to https://localhost:8443/ with Firefox and say you accept the self-signed cert (with Chrome the use of self-signed certs has become harder and harder recently) |
| 30 | +* Set up a user, alice / 123, and edit ./fetch.js so that `oidcIssuer = 'https://localhost:8443';`, `nssUsername = 'alice'`, and `nssPassword = '123';`. |
| 31 | +* Run CSS with `NODE_TLS_REJECT_UNAUTHORIZED=0 ./bin/server.js -l debug`. |
| 32 | +* Run the fetch script with `NODE_TLS_REJECT_UNAUTHORIZED=0` as well, for instance: |
| 33 | +```sh |
| 34 | +NODE_TLS_REJECT_UNAUTHORIZED=0 node fetch.js http://localhost:3000/404.txt |
| 35 | +``` |
0 commit comments