solid-server 5.6.24 → 5.7.0

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.
package/README.md CHANGED
@@ -28,12 +28,15 @@ You can install and run the server either using Node.js directly or using
28
28
  first approach, for the second approach see the section [use Docker](#use-docker)
29
29
  Section below.
30
30
 
31
+ **Note**: If using Git for Windows, it is helpful to use the -verbose flag to see the progress of the install.
32
+
31
33
  To install, first install [Node](https://nodejs.org/en/) and then run the following
32
34
 
33
35
  ```bash
34
36
  $ npm install -g solid-server
35
37
  ```
36
38
 
39
+
37
40
  ### Run a single-user server (beginner)
38
41
 
39
42
  The easiest way to setup `solid-server` is by running the wizard. This will create a `config.json` in your current folder
@@ -0,0 +1,18 @@
1
+ {
2
+ "root": "/Users/imyshor/Projects/solid/solidos/workspaces/node-solid-server/bin/data",
3
+ "port": "8443",
4
+ "serverUri": "https://localhost:8443",
5
+ "webid": false,
6
+ "mount": "/",
7
+ "configPath": "./config",
8
+ "configFile": "./config.json",
9
+ "dbPath": "./.db",
10
+ "sslKey": "../",
11
+ "sslCert": "../",
12
+ "multiuser": false,
13
+ "server": {
14
+ "name": "localhost",
15
+ "description": "",
16
+ "logo": ""
17
+ }
18
+ }
@@ -4,13 +4,16 @@ function register() {
4
4
  alert(2); window.location.href = "/register";
5
5
  }
6
6
  document.addEventListener('DOMContentLoaded', async function() {
7
- if (!UI.authn.currentUser()) await UI.authn.checkUser();
8
- let user = UI.authn.currentUser();
7
+ const authn = UI.authn
8
+ const authSession = UI.authn.authSession
9
+
10
+ if (!authn.currentUser()) await authn.checkUser();
11
+ let user = authn.currentUser();
9
12
 
10
13
  // IF LOGGED IN: SET SolidServerRootRedirectLink. LOGOUT
11
14
  if( user ) {
12
15
  window.localStorage.setItem(keyname, user.uri);
13
- await UI.authn.authSession.logout();
16
+ await authSession.logout();
14
17
  }
15
18
  else {
16
19
  let webId = window.localStorage.getItem(keyname);
@@ -31,7 +34,7 @@ document.addEventListener('DOMContentLoaded', async function() {
31
34
  let span = document.createElement("span")
32
35
  span.innerHTML = html
33
36
  loginArea.appendChild(span);
34
- loginArea.appendChild(UI.authn.loginStatusBox(document, null, {}))
37
+ loginArea.appendChild(UI.login.loginStatusBox(document, null, {}))
35
38
  const logInButton = loginArea.querySelectorAll('input')[1];
36
39
  logInButton.value = "Log in to see your WebID";
37
40
  const signUpButton = loginArea.querySelectorAll('input')[2];
@@ -17,6 +17,7 @@
17
17
 
18
18
  solid:account </> ; # link to the account uri
19
19
  pim:storage </> ; # root storage
20
+ solid:oidcIssuer <{{idp}}> ; # identity provider
20
21
 
21
22
  ldp:inbox </inbox/> ;
22
23
 
package/lib/create-app.js CHANGED
@@ -32,7 +32,7 @@ const corsSettings = cors({
32
32
  methods: [
33
33
  'OPTIONS', 'HEAD', 'GET', 'PATCH', 'POST', 'PUT', 'DELETE'
34
34
  ],
35
- exposedHeaders: 'Authorization, User, Location, Link, Vary, Last-Modified, ETag, Accept-Patch, Accept-Post, Updates-Via, Allow, WAC-Allow, Content-Length, WWW-Authenticate, MS-Author-Via, X-Powered-By',
35
+ exposedHeaders: 'Authorization, User, Location, Link, Vary, Last-Modified, ETag, Accept-Patch, Accept-Post, Updates-Via, Allow, WAC-Allow, Content-Length, WWW-Authenticate, X-Powered-By',
36
36
  credentials: true,
37
37
  maxAge: 1728000,
38
38
  origin: true,
@@ -13,7 +13,7 @@ const validUrl = require('valid-url')
13
13
 
14
14
  const CORS_SETTINGS = {
15
15
  methods: 'GET',
16
- exposedHeaders: 'Authorization, User, Location, Link, Vary, Last-Modified, Content-Length, Content-Location, MS-Author-Via, X-Powered-By',
16
+ exposedHeaders: 'Authorization, User, Location, Link, Vary, Last-Modified, Content-Length, Content-Location, X-Powered-By',
17
17
  maxAge: 1728000,
18
18
  origin: true
19
19
  }
@@ -27,8 +27,6 @@ async function handler (req, res, next) {
27
27
  const requestedType = negotiator.mediaType()
28
28
  const possibleRDFType = negotiator.mediaType(RDFs)
29
29
 
30
- res.header('MS-Author-Via', 'SPARQL')
31
-
32
30
  // Set live updates
33
31
  if (ldp.live) {
34
32
  res.header('Updates-Via', ldp.resourceMapper.resolveUrl(req.hostname).replace(/^http/, 'ws'))
@@ -23,7 +23,6 @@ const DEFAULT_FOR_NEW_CONTENT_TYPE = 'text/turtle'
23
23
  // Handles a PATCH request
24
24
  async function patchHandler (req, res, next) {
25
25
  debug(`PATCH -- ${req.originalUrl}`)
26
- res.header('MS-Author-Via', 'SPARQL')
27
26
  try {
28
27
  // Obtain details of the target resource
29
28
  const ldp = req.app.locals.ldp
@@ -8,7 +8,6 @@ const { stringToStream } = require('../utils')
8
8
 
9
9
  async function handler (req, res, next) {
10
10
  debug(req.originalUrl)
11
- res.header('MS-Author-Via', 'SPARQL')
12
11
 
13
12
  const contentType = req.get('content-type')
14
13
  if (isAuxiliary(req)) {
package/lib/ldp.js CHANGED
@@ -286,6 +286,7 @@ class LDP {
286
286
  }
287
287
 
288
288
  // Directory created, now write the file
289
+ if (container) return
289
290
  return withLock(path, () => new Promise((resolve, reject) => {
290
291
  // HACK: the middleware in webid-oidc.js uses body-parser, thus ending the stream of data
291
292
  // for JSON bodies. So, the stream needs to be reset
@@ -334,9 +334,9 @@ class AccountManager {
334
334
  name: userData.name,
335
335
  externalWebId: userData.externalWebId,
336
336
  localAccountId: userData.localAccountId,
337
- webId: userData.webid || userData.webId || userData.externalWebId
337
+ webId: userData.webid || userData.webId || userData.externalWebId,
338
+ idp: this.host.serverUri
338
339
  }
339
-
340
340
  if (userConfig.username) {
341
341
  userConfig.username = userConfig.username.toLowerCase()
342
342
  }
@@ -360,6 +360,9 @@ class AccountManager {
360
360
  } else { // no username - derive it from web id
361
361
  if (userConfig.externalWebId) {
362
362
  userConfig.username = userConfig.externalWebId
363
+
364
+ // TODO find oidcIssuer from externalWebId
365
+ // removed from idp https://github.com/solid/node-solid-server/pull/1566
363
366
  } else {
364
367
  userConfig.username = this.usernameFromWebId(userConfig.webId)
365
368
  }
@@ -75,7 +75,8 @@ class AccountTemplate {
75
75
  const substitutions = {
76
76
  name: userAccount.displayName,
77
77
  webId: userAccount.webId,
78
- email: userAccount.email
78
+ email: userAccount.email,
79
+ idp: userAccount.idp
79
80
  }
80
81
 
81
82
  return substitutions
@@ -24,6 +24,7 @@ class UserAccount {
24
24
  this.email = options.email
25
25
  this.externalWebId = options.externalWebId
26
26
  this.localAccountId = options.localAccountId
27
+ this.idp = options.idp
27
28
  }
28
29
 
29
30
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "solid-server",
3
3
  "description": "Solid server on top of the file-system",
4
- "version": "5.6.24",
4
+ "version": "5.7.0",
5
5
  "author": {
6
6
  "name": "Tim Berners-Lee",
7
7
  "email": "timbl@w3.org"
@@ -61,8 +61,8 @@
61
61
  "dependencies": {
62
62
  "@fastify/busboy": "^1.0.0",
63
63
  "@solid/acl-check": "^0.4.5",
64
- "@solid/oidc-auth-manager": "^0.24.1",
65
- "@solid/oidc-op": "0.11.5",
64
+ "@solid/oidc-auth-manager": "^0.24.2",
65
+ "@solid/oidc-op": "^0.11.6",
66
66
  "async-lock": "^1.3.0",
67
67
  "body-parser": "^1.19.1",
68
68
  "bootstrap": "^3.4.1",
@@ -89,7 +89,7 @@
89
89
  "ip-range-check": "0.2.0",
90
90
  "is-ip": "^3.1.0",
91
91
  "li": "^1.3.0",
92
- "mashlib": "^1.7.21",
92
+ "mashlib": "^1.8.0",
93
93
  "mime-types": "^2.1.34",
94
94
  "negotiator": "^0.6.2",
95
95
  "node-fetch": "^2.6.7",
@@ -108,7 +108,7 @@
108
108
  "text-encoder-lite": "^2.0.0",
109
109
  "the-big-username-blacklist": "^1.5.2",
110
110
  "ulid": "^2.3.0",
111
- "urijs": "^1.19.7",
111
+ "urijs": "^1.19.10",
112
112
  "uuid": "^8.3.2",
113
113
  "valid-url": "^1.0.9",
114
114
  "validator": "^13.7.0",