javascript-solid-server 0.0.12 → 0.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -25,7 +25,8 @@
25
25
  "Bash(timeout 5 node:*)",
26
26
  "Bash(npm view:*)",
27
27
  "Bash(npm ls:*)",
28
- "Bash(timeout 10 node:*)"
28
+ "Bash(timeout 10 node:*)",
29
+ "Bash(npm run test:cth:*)"
29
30
  ]
30
31
  }
31
32
  }
package/README.md CHANGED
@@ -54,7 +54,7 @@ npm run benchmark
54
54
 
55
55
  ## Features
56
56
 
57
- ### Implemented (v0.0.12)
57
+ ### Implemented (v0.0.13)
58
58
 
59
59
  - **LDP CRUD Operations** - GET, PUT, POST, DELETE, HEAD
60
60
  - **N3 Patch** - Solid's native patch format for RDF updates
@@ -306,6 +306,28 @@ Response:
306
306
 
307
307
  OIDC Discovery: `/.well-known/openid-configuration`
308
308
 
309
+ ### Programmatic Login (CTH Compatible)
310
+
311
+ For automated testing and scripts, use the credentials endpoint:
312
+
313
+ ```bash
314
+ curl -X POST http://localhost:3000/idp/credentials \
315
+ -H "Content-Type: application/json" \
316
+ -d '{"email": "alice@example.com", "password": "secret123"}'
317
+ ```
318
+
319
+ Response:
320
+ ```json
321
+ {
322
+ "access_token": "...",
323
+ "token_type": "Bearer",
324
+ "expires_in": 3600,
325
+ "webid": "http://localhost:3000/alice/#me"
326
+ }
327
+ ```
328
+
329
+ For DPoP-bound tokens (Solid-OIDC compliant), include a DPoP proof header.
330
+
309
331
  ### Solid-OIDC (External IdP)
310
332
 
311
333
  The server also accepts DPoP-bound access tokens from external Solid identity providers:
@@ -355,7 +377,7 @@ Server: pub http://localhost:3000/alice/public/data.json (on change)
355
377
  npm test
356
378
  ```
357
379
 
358
- Currently passing: **174 tests** (including 27 conformance tests)
380
+ Currently passing: **182 tests** (including 27 conformance tests)
359
381
 
360
382
  ## Project Structure
361
383
 
@@ -0,0 +1,50 @@
1
+ {
2
+ "@context": {
3
+ "acl": "http://www.w3.org/ns/auth/acl#",
4
+ "foaf": "http://xmlns.com/foaf/0.1/"
5
+ },
6
+ "@graph": [
7
+ {
8
+ "@id": "#owner",
9
+ "@type": "acl:Authorization",
10
+ "acl:agent": {
11
+ "@id": "http://localhost:3457/alice/#me"
12
+ },
13
+ "acl:accessTo": {
14
+ "@id": "http://localhost:3457/alice/"
15
+ },
16
+ "acl:mode": [
17
+ {
18
+ "@id": "acl:Read"
19
+ },
20
+ {
21
+ "@id": "acl:Write"
22
+ },
23
+ {
24
+ "@id": "acl:Control"
25
+ }
26
+ ],
27
+ "acl:default": {
28
+ "@id": "http://localhost:3457/alice/"
29
+ }
30
+ },
31
+ {
32
+ "@id": "#public",
33
+ "@type": "acl:Authorization",
34
+ "acl:agentClass": {
35
+ "@id": "foaf:Agent"
36
+ },
37
+ "acl:accessTo": {
38
+ "@id": "http://localhost:3457/alice/"
39
+ },
40
+ "acl:mode": [
41
+ {
42
+ "@id": "acl:Read"
43
+ }
44
+ ],
45
+ "acl:default": {
46
+ "@id": "http://localhost:3457/alice/"
47
+ }
48
+ }
49
+ ]
50
+ }
@@ -0,0 +1,50 @@
1
+ {
2
+ "@context": {
3
+ "acl": "http://www.w3.org/ns/auth/acl#",
4
+ "foaf": "http://xmlns.com/foaf/0.1/"
5
+ },
6
+ "@graph": [
7
+ {
8
+ "@id": "#owner",
9
+ "@type": "acl:Authorization",
10
+ "acl:agent": {
11
+ "@id": "http://localhost:3457/alice/#me"
12
+ },
13
+ "acl:accessTo": {
14
+ "@id": "http://localhost:3457/alice/inbox/"
15
+ },
16
+ "acl:default": {
17
+ "@id": "http://localhost:3457/alice/inbox/"
18
+ },
19
+ "acl:mode": [
20
+ {
21
+ "@id": "acl:Read"
22
+ },
23
+ {
24
+ "@id": "acl:Write"
25
+ },
26
+ {
27
+ "@id": "acl:Control"
28
+ }
29
+ ]
30
+ },
31
+ {
32
+ "@id": "#public",
33
+ "@type": "acl:Authorization",
34
+ "acl:agentClass": {
35
+ "@id": "foaf:Agent"
36
+ },
37
+ "acl:accessTo": {
38
+ "@id": "http://localhost:3457/alice/inbox/"
39
+ },
40
+ "acl:default": {
41
+ "@id": "http://localhost:3457/alice/inbox/"
42
+ },
43
+ "acl:mode": [
44
+ {
45
+ "@id": "acl:Append"
46
+ }
47
+ ]
48
+ }
49
+ ]
50
+ }
@@ -0,0 +1,80 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>alice's Profile</title>
7
+ <script type="application/ld+json">
8
+ {
9
+ "@context": {
10
+ "foaf": "http://xmlns.com/foaf/0.1/",
11
+ "solid": "http://www.w3.org/ns/solid/terms#",
12
+ "schema": "http://schema.org/",
13
+ "pim": "http://www.w3.org/ns/pim/space#",
14
+ "ldp": "http://www.w3.org/ns/ldp#",
15
+ "inbox": {
16
+ "@id": "ldp:inbox",
17
+ "@type": "@id"
18
+ },
19
+ "storage": {
20
+ "@id": "pim:storage",
21
+ "@type": "@id"
22
+ },
23
+ "oidcIssuer": {
24
+ "@id": "solid:oidcIssuer",
25
+ "@type": "@id"
26
+ },
27
+ "preferencesFile": {
28
+ "@id": "pim:preferencesFile",
29
+ "@type": "@id"
30
+ }
31
+ },
32
+ "@graph": [
33
+ {
34
+ "@id": "http://localhost:3457/alice/",
35
+ "@type": "foaf:PersonalProfileDocument",
36
+ "foaf:maker": {
37
+ "@id": "http://localhost:3457/alice/#me"
38
+ },
39
+ "foaf:primaryTopic": {
40
+ "@id": "http://localhost:3457/alice/#me"
41
+ }
42
+ },
43
+ {
44
+ "@id": "http://localhost:3457/alice/#me",
45
+ "@type": [
46
+ "foaf:Person",
47
+ "schema:Person"
48
+ ],
49
+ "foaf:name": "alice",
50
+ "inbox": "http://localhost:3457/alice/inbox/",
51
+ "storage": "http://localhost:3457/alice/",
52
+ "oidcIssuer": "http://localhost:3457",
53
+ "preferencesFile": "http://localhost:3457/alice/settings/prefs"
54
+ }
55
+ ]
56
+ }
57
+ </script>
58
+ <style>
59
+ body { font-family: system-ui, sans-serif; max-width: 600px; margin: 2rem auto; padding: 0 1rem; }
60
+ h1 { color: #333; }
61
+ .card { background: #f5f5f5; padding: 1.5rem; border-radius: 8px; }
62
+ dt { font-weight: bold; margin-top: 1rem; }
63
+ dd { margin-left: 0; color: #666; }
64
+ a { color: #7c4dff; }
65
+ </style>
66
+ </head>
67
+ <body>
68
+ <div class="card">
69
+ <h1>alice</h1>
70
+ <dl>
71
+ <dt>WebID</dt>
72
+ <dd><a href="http://localhost:3457/alice/#me">http://localhost:3457/alice/#me</a></dd>
73
+ <dt>Storage</dt>
74
+ <dd><a href="http://localhost:3457/alice/">http://localhost:3457/alice/</a></dd>
75
+ <dt>Inbox</dt>
76
+ <dd><a href="http://localhost:3457/alice/inbox/">http://localhost:3457/alice/inbox/</a></dd>
77
+ </dl>
78
+ </div>
79
+ </body>
80
+ </html>
@@ -0,0 +1,32 @@
1
+ {
2
+ "@context": {
3
+ "acl": "http://www.w3.org/ns/auth/acl#",
4
+ "foaf": "http://xmlns.com/foaf/0.1/"
5
+ },
6
+ "@graph": [
7
+ {
8
+ "@id": "#owner",
9
+ "@type": "acl:Authorization",
10
+ "acl:agent": {
11
+ "@id": "http://localhost:3457/alice/#me"
12
+ },
13
+ "acl:accessTo": {
14
+ "@id": "http://localhost:3457/alice/private/"
15
+ },
16
+ "acl:mode": [
17
+ {
18
+ "@id": "acl:Read"
19
+ },
20
+ {
21
+ "@id": "acl:Write"
22
+ },
23
+ {
24
+ "@id": "acl:Control"
25
+ }
26
+ ],
27
+ "acl:default": {
28
+ "@id": "http://localhost:3457/alice/private/"
29
+ }
30
+ }
31
+ ]
32
+ }
@@ -0,0 +1 @@
1
+ {"@id":"#test","http://example.org/value":42}
@@ -0,0 +1,32 @@
1
+ {
2
+ "@context": {
3
+ "acl": "http://www.w3.org/ns/auth/acl#",
4
+ "foaf": "http://xmlns.com/foaf/0.1/"
5
+ },
6
+ "@graph": [
7
+ {
8
+ "@id": "#owner",
9
+ "@type": "acl:Authorization",
10
+ "acl:agent": {
11
+ "@id": "http://localhost:3457/alice/#me"
12
+ },
13
+ "acl:accessTo": {
14
+ "@id": "http://localhost:3457/alice/settings/"
15
+ },
16
+ "acl:mode": [
17
+ {
18
+ "@id": "acl:Read"
19
+ },
20
+ {
21
+ "@id": "acl:Write"
22
+ },
23
+ {
24
+ "@id": "acl:Control"
25
+ }
26
+ ],
27
+ "acl:default": {
28
+ "@id": "http://localhost:3457/alice/settings/"
29
+ }
30
+ }
31
+ ]
32
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "@context": {
3
+ "solid": "http://www.w3.org/ns/solid/terms#",
4
+ "pim": "http://www.w3.org/ns/pim/space#",
5
+ "publicTypeIndex": {
6
+ "@id": "solid:publicTypeIndex",
7
+ "@type": "@id"
8
+ },
9
+ "privateTypeIndex": {
10
+ "@id": "solid:privateTypeIndex",
11
+ "@type": "@id"
12
+ }
13
+ },
14
+ "@id": "http://localhost:3457/alice/settings/prefs",
15
+ "publicTypeIndex": "http://localhost:3457/alice/settings/publicTypeIndex",
16
+ "privateTypeIndex": "http://localhost:3457/alice/settings/privateTypeIndex"
17
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "@context": {
3
+ "solid": "http://www.w3.org/ns/solid/terms#"
4
+ },
5
+ "@id": "http://localhost:3457/alice/settings/privateTypeIndex",
6
+ "@type": "solid:TypeIndex"
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "@context": {
3
+ "solid": "http://www.w3.org/ns/solid/terms#"
4
+ },
5
+ "@id": "http://localhost:3457/alice/settings/publicTypeIndex",
6
+ "@type": "solid:TypeIndex"
7
+ }
package/data/bob/.acl ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "@context": {
3
+ "acl": "http://www.w3.org/ns/auth/acl#",
4
+ "foaf": "http://xmlns.com/foaf/0.1/"
5
+ },
6
+ "@graph": [
7
+ {
8
+ "@id": "#owner",
9
+ "@type": "acl:Authorization",
10
+ "acl:agent": {
11
+ "@id": "http://localhost:3457/bob/#me"
12
+ },
13
+ "acl:accessTo": {
14
+ "@id": "http://localhost:3457/bob/"
15
+ },
16
+ "acl:mode": [
17
+ {
18
+ "@id": "acl:Read"
19
+ },
20
+ {
21
+ "@id": "acl:Write"
22
+ },
23
+ {
24
+ "@id": "acl:Control"
25
+ }
26
+ ],
27
+ "acl:default": {
28
+ "@id": "http://localhost:3457/bob/"
29
+ }
30
+ },
31
+ {
32
+ "@id": "#public",
33
+ "@type": "acl:Authorization",
34
+ "acl:agentClass": {
35
+ "@id": "foaf:Agent"
36
+ },
37
+ "acl:accessTo": {
38
+ "@id": "http://localhost:3457/bob/"
39
+ },
40
+ "acl:mode": [
41
+ {
42
+ "@id": "acl:Read"
43
+ }
44
+ ],
45
+ "acl:default": {
46
+ "@id": "http://localhost:3457/bob/"
47
+ }
48
+ }
49
+ ]
50
+ }
@@ -0,0 +1,50 @@
1
+ {
2
+ "@context": {
3
+ "acl": "http://www.w3.org/ns/auth/acl#",
4
+ "foaf": "http://xmlns.com/foaf/0.1/"
5
+ },
6
+ "@graph": [
7
+ {
8
+ "@id": "#owner",
9
+ "@type": "acl:Authorization",
10
+ "acl:agent": {
11
+ "@id": "http://localhost:3457/bob/#me"
12
+ },
13
+ "acl:accessTo": {
14
+ "@id": "http://localhost:3457/bob/inbox/"
15
+ },
16
+ "acl:default": {
17
+ "@id": "http://localhost:3457/bob/inbox/"
18
+ },
19
+ "acl:mode": [
20
+ {
21
+ "@id": "acl:Read"
22
+ },
23
+ {
24
+ "@id": "acl:Write"
25
+ },
26
+ {
27
+ "@id": "acl:Control"
28
+ }
29
+ ]
30
+ },
31
+ {
32
+ "@id": "#public",
33
+ "@type": "acl:Authorization",
34
+ "acl:agentClass": {
35
+ "@id": "foaf:Agent"
36
+ },
37
+ "acl:accessTo": {
38
+ "@id": "http://localhost:3457/bob/inbox/"
39
+ },
40
+ "acl:default": {
41
+ "@id": "http://localhost:3457/bob/inbox/"
42
+ },
43
+ "acl:mode": [
44
+ {
45
+ "@id": "acl:Append"
46
+ }
47
+ ]
48
+ }
49
+ ]
50
+ }
@@ -0,0 +1,80 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <title>bob's Profile</title>
7
+ <script type="application/ld+json">
8
+ {
9
+ "@context": {
10
+ "foaf": "http://xmlns.com/foaf/0.1/",
11
+ "solid": "http://www.w3.org/ns/solid/terms#",
12
+ "schema": "http://schema.org/",
13
+ "pim": "http://www.w3.org/ns/pim/space#",
14
+ "ldp": "http://www.w3.org/ns/ldp#",
15
+ "inbox": {
16
+ "@id": "ldp:inbox",
17
+ "@type": "@id"
18
+ },
19
+ "storage": {
20
+ "@id": "pim:storage",
21
+ "@type": "@id"
22
+ },
23
+ "oidcIssuer": {
24
+ "@id": "solid:oidcIssuer",
25
+ "@type": "@id"
26
+ },
27
+ "preferencesFile": {
28
+ "@id": "pim:preferencesFile",
29
+ "@type": "@id"
30
+ }
31
+ },
32
+ "@graph": [
33
+ {
34
+ "@id": "http://localhost:3457/bob/",
35
+ "@type": "foaf:PersonalProfileDocument",
36
+ "foaf:maker": {
37
+ "@id": "http://localhost:3457/bob/#me"
38
+ },
39
+ "foaf:primaryTopic": {
40
+ "@id": "http://localhost:3457/bob/#me"
41
+ }
42
+ },
43
+ {
44
+ "@id": "http://localhost:3457/bob/#me",
45
+ "@type": [
46
+ "foaf:Person",
47
+ "schema:Person"
48
+ ],
49
+ "foaf:name": "bob",
50
+ "inbox": "http://localhost:3457/bob/inbox/",
51
+ "storage": "http://localhost:3457/bob/",
52
+ "oidcIssuer": "http://localhost:3457",
53
+ "preferencesFile": "http://localhost:3457/bob/settings/prefs"
54
+ }
55
+ ]
56
+ }
57
+ </script>
58
+ <style>
59
+ body { font-family: system-ui, sans-serif; max-width: 600px; margin: 2rem auto; padding: 0 1rem; }
60
+ h1 { color: #333; }
61
+ .card { background: #f5f5f5; padding: 1.5rem; border-radius: 8px; }
62
+ dt { font-weight: bold; margin-top: 1rem; }
63
+ dd { margin-left: 0; color: #666; }
64
+ a { color: #7c4dff; }
65
+ </style>
66
+ </head>
67
+ <body>
68
+ <div class="card">
69
+ <h1>bob</h1>
70
+ <dl>
71
+ <dt>WebID</dt>
72
+ <dd><a href="http://localhost:3457/bob/#me">http://localhost:3457/bob/#me</a></dd>
73
+ <dt>Storage</dt>
74
+ <dd><a href="http://localhost:3457/bob/">http://localhost:3457/bob/</a></dd>
75
+ <dt>Inbox</dt>
76
+ <dd><a href="http://localhost:3457/bob/inbox/">http://localhost:3457/bob/inbox/</a></dd>
77
+ </dl>
78
+ </div>
79
+ </body>
80
+ </html>
@@ -0,0 +1,32 @@
1
+ {
2
+ "@context": {
3
+ "acl": "http://www.w3.org/ns/auth/acl#",
4
+ "foaf": "http://xmlns.com/foaf/0.1/"
5
+ },
6
+ "@graph": [
7
+ {
8
+ "@id": "#owner",
9
+ "@type": "acl:Authorization",
10
+ "acl:agent": {
11
+ "@id": "http://localhost:3457/bob/#me"
12
+ },
13
+ "acl:accessTo": {
14
+ "@id": "http://localhost:3457/bob/private/"
15
+ },
16
+ "acl:mode": [
17
+ {
18
+ "@id": "acl:Read"
19
+ },
20
+ {
21
+ "@id": "acl:Write"
22
+ },
23
+ {
24
+ "@id": "acl:Control"
25
+ }
26
+ ],
27
+ "acl:default": {
28
+ "@id": "http://localhost:3457/bob/private/"
29
+ }
30
+ }
31
+ ]
32
+ }
@@ -0,0 +1,32 @@
1
+ {
2
+ "@context": {
3
+ "acl": "http://www.w3.org/ns/auth/acl#",
4
+ "foaf": "http://xmlns.com/foaf/0.1/"
5
+ },
6
+ "@graph": [
7
+ {
8
+ "@id": "#owner",
9
+ "@type": "acl:Authorization",
10
+ "acl:agent": {
11
+ "@id": "http://localhost:3457/bob/#me"
12
+ },
13
+ "acl:accessTo": {
14
+ "@id": "http://localhost:3457/bob/settings/"
15
+ },
16
+ "acl:mode": [
17
+ {
18
+ "@id": "acl:Read"
19
+ },
20
+ {
21
+ "@id": "acl:Write"
22
+ },
23
+ {
24
+ "@id": "acl:Control"
25
+ }
26
+ ],
27
+ "acl:default": {
28
+ "@id": "http://localhost:3457/bob/settings/"
29
+ }
30
+ }
31
+ ]
32
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "@context": {
3
+ "solid": "http://www.w3.org/ns/solid/terms#",
4
+ "pim": "http://www.w3.org/ns/pim/space#",
5
+ "publicTypeIndex": {
6
+ "@id": "solid:publicTypeIndex",
7
+ "@type": "@id"
8
+ },
9
+ "privateTypeIndex": {
10
+ "@id": "solid:privateTypeIndex",
11
+ "@type": "@id"
12
+ }
13
+ },
14
+ "@id": "http://localhost:3457/bob/settings/prefs",
15
+ "publicTypeIndex": "http://localhost:3457/bob/settings/publicTypeIndex",
16
+ "privateTypeIndex": "http://localhost:3457/bob/settings/privateTypeIndex"
17
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "@context": {
3
+ "solid": "http://www.w3.org/ns/solid/terms#"
4
+ },
5
+ "@id": "http://localhost:3457/bob/settings/privateTypeIndex",
6
+ "@type": "solid:TypeIndex"
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "@context": {
3
+ "solid": "http://www.w3.org/ns/solid/terms#"
4
+ },
5
+ "@id": "http://localhost:3457/bob/settings/publicTypeIndex",
6
+ "@type": "solid:TypeIndex"
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "javascript-solid-server",
3
- "version": "0.0.12",
3
+ "version": "0.0.13",
4
4
  "description": "A minimal, fast Solid server",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -19,6 +19,7 @@
19
19
  "start": "node bin/jss.js start",
20
20
  "dev": "node --watch bin/jss.js start",
21
21
  "test": "node --test --test-concurrency=1",
22
+ "test:cth": "node scripts/test-cth-compat.js",
22
23
  "benchmark": "node benchmark.js"
23
24
  },
24
25
  "dependencies": {