Skip to content

Commit 40da84a

Browse files
committed
add missing test files
1 parent 3544e9b commit 40da84a

File tree

106 files changed

+2012
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+2012
-0
lines changed

test/.meta

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Root Meta resource for the user account
2+
# Used to discover the account's WebID URI, given the account URI
3+
<https://tim.localhost:7777/profile/card#me>
4+
<http://www.w3.org/ns/solid/terms#account>
5+
</>.

test/mocha.opts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
--recursive
2+
--timeout 10000

test/scenarios.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
- Full tests (Solid)
2+
- with registered user, user is logged out
3+
- (1) User tries to get a resource
4+
- GET BOB/foo
5+
- sends 401 with redirect in HTML header
6+
- redirect GET BOB/api/accounts/signin
7+
- (2) User enters the webId so that the authorization endpoint is discovered
8+
- POST BOB/signin with WebID
9+
- response is a 302 to oidc.ALICE/authorize?callback=BOB/api/oidc/rp
10+
- (3) User is prompted password? and consent
11+
- (user enters password)?
12+
- user presses conset
13+
- form submit to oidc.ALICE/authorize?callback=BOB/api/oidc/rp
14+
- response is a 302 to BOB/api/oidc/rp
15+
- BOB/api/oidc/rp redirects to BOB/foo
16+
17+
18+
- needing registration
19+
- (0) User registers an account
20+
- POST ALICE/api/accounts/new
21+
- gives User
22+
- set the cookie
23+
- send an email (for verfication)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
app/node_modules
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM node
2+
ADD app /app
3+
WORKDIR /app
4+
RUN npm install
5+
ENV NODE_TLS_REJECT_UNAUTHORIZED 0
6+
CMD node index.js
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
const fetch = require('node-fetch')
2+
3+
const SERVER_ROOT = process.env.SERVER_ROOT || 'https://server'
4+
const LOGIN_URL = `${SERVER_ROOT}/login/password`
5+
const USERNAME = process.env.USERNAME || 'alice'
6+
const PASSWORD = process.env.PASSWORD || '123'
7+
8+
async function getCookie () {
9+
const result = await fetch(LOGIN_URL, {
10+
body: [
11+
`username=${USERNAME}`,
12+
`password=${PASSWORD}`
13+
].join('&'),
14+
headers: {
15+
'Content-Type': 'application/x-www-form-urlencoded'
16+
},
17+
method: 'POST',
18+
redirect: 'manual'
19+
})
20+
return result.headers.get('set-cookie')
21+
}
22+
23+
async function run () {
24+
const cookie = await getCookie()
25+
console.log(cookie)
26+
}
27+
28+
// ...
29+
run()

test/surface/docker/cookie/app/package-lock.json

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "get-nss-cookie",
3+
"version": "1.0.0",
4+
"description": "Get a cookie from a node-solid-server instance",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"author": "",
10+
"license": "ISC",
11+
"dependencies": {
12+
"node-fetch": "^2.6.1"
13+
}
14+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"redirect_uris":["https://server/api/oidc/rp/https%3A%2F%2Fserver"],"client_id":"7e5c0fede7682892e36b2ef3ecda05a6","client_secret":"d634791ff779ce90d378d714282e1374","response_types":["code","id_token token","code id_token token"],"grant_types":["authorization_code","implicit","refresh_token","client_credentials"],"application_type":"web","client_name":"Solid OIDC RP for https://server","id_token_signed_response_alg":"RS256","token_endpoint_auth_method":"client_secret_basic","default_max_age":86400,"post_logout_redirect_uris":["https://server/goodbye"]}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"redirect_uris":["http://localhost:3001/redirect"],"client_id":"coolApp1","client_secret":"9ae94c0a2f86a02a5dfa8d0a522f8176","response_types":["code"],"grant_types":["authorization_code"],"application_type":"web","id_token_signed_response_alg":"RS256","token_endpoint_auth_method":"client_secret_basic"}

0 commit comments

Comments
 (0)