solid-server 5.8.8-8d509db1 → 5.8.8-90b76b88

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.
Files changed (82) hide show
  1. package/common/js/auth-buttons.mjs +20 -20
  2. package/common/js/index-buttons.mjs +31 -30
  3. package/common/js/solid.mjs +11 -11
  4. package/config/defaults.mjs +1 -1
  5. package/config/templates/server/index.html +1 -1
  6. package/coverage/tmp/coverage-2252-1767784854167-0.json +1 -0
  7. package/coverage/tmp/{coverage-2255-1766613179053-0.json → coverage-2253-1767784832543-0.json} +1 -1
  8. package/default-templates/server/index.html +1 -1
  9. package/eslint.config.mjs +102 -0
  10. package/index.mjs +8 -8
  11. package/lib/acl-checker.mjs +1 -3
  12. package/lib/handlers/copy.mjs +0 -2
  13. package/lib/handlers/cors-proxy.mjs +2 -4
  14. package/lib/handlers/get.mjs +12 -8
  15. package/lib/handlers/index.mjs +0 -2
  16. package/lib/handlers/options.mjs +0 -2
  17. package/lib/ldp.mjs +0 -3
  18. package/lib/models/account-manager.mjs +2 -2
  19. package/lib/models/oidc-manager.mjs +0 -1
  20. package/lib/resource-mapper.mjs +1 -3
  21. package/lib/utils.mjs +0 -2
  22. package/lib/webid/lib/get.mjs +0 -1
  23. package/lib/webid/tls/index.mjs +0 -1
  24. package/package.json +39 -38
  25. package/solid-server-5.8.8.tgz +0 -0
  26. package/test/index.mjs +0 -1
  27. package/test/integration/account-manager-test.mjs +2 -3
  28. package/test/integration/account-template-test.mjs +0 -1
  29. package/test/integration/acl-oidc-test.mjs +0 -1
  30. package/test/integration/authentication-oidc-test.mjs +13 -8
  31. package/test/integration/authentication-oidc-with-strict-origins-turned-off-test.mjs +14 -9
  32. package/test/integration/capability-discovery-test.mjs +0 -1
  33. package/test/integration/oidc-manager-test.mjs +95 -2
  34. package/test/integration/params-test.mjs +5 -5
  35. package/test/integration/patch-test.mjs +29 -12
  36. package/test/integration/quota-test.mjs +0 -1
  37. package/test/integration/www-account-creation-oidc-test.mjs +0 -1
  38. package/test/resources/accounts/db/oidc/op/clients/{_key_30860bb5cf6ba07e80ed7b2e7178c7ad.json → _key_c1c49f6ff9e9631cf4c7018f962d2aae.json} +1 -1
  39. package/test/resources/accounts/db/oidc/op/provider.json +345 -1
  40. package/test/resources/accounts/db/oidc/rp/clients/_key_https%3A%2F%2Flocalhost%3A3457.json +1 -1
  41. package/test/resources/accounts-acl/db/oidc/op/provider.json +345 -1
  42. package/test/resources/accounts-scenario/alice/db/oidc/op/clients/{_key_e46bcfe080c59f5cbb53a559d6a272cb.json → _key_d6a7a43b910d2811992779cde33d0364.json} +1 -1
  43. package/test/resources/accounts-scenario/alice/db/oidc/op/provider.json +658 -89
  44. package/test/resources/accounts-scenario/alice/db/oidc/rp/clients/_key_https%3A%2F%2Flocalhost%3A7000.json +1 -1
  45. package/test/resources/accounts-scenario/bob/db/oidc/op/clients/{_key_e7fd102ec26a3dcd5916751e01a62315.json → _key_c8d992732b9a955b6ac77873670a7d9a.json} +1 -1
  46. package/test/resources/accounts-scenario/bob/db/oidc/op/provider.json +658 -89
  47. package/test/resources/accounts-scenario/bob/db/oidc/rp/clients/_key_https%3A%2F%2Flocalhost%3A7001.json +1 -1
  48. package/test/resources/accounts-scenario/charlie/db/oidc/op/clients/{_key_0eec962830f849876695b69df76a3137.json → _key_4ec13ac7015e279a4449ceafe4fa19c0.json} +1 -1
  49. package/test/resources/accounts-scenario/charlie/db/oidc/op/provider.json +345 -1
  50. package/test/resources/accounts-scenario/charlie/db/oidc/rp/clients/_key_https%3A%2F%2Flocalhost%3A5002.json +1 -1
  51. package/test/resources/accounts-strict-origin-off/alice/db/oidc/op/clients/{_key_7d536a1f8c6eb86f41261e171a8af79a.json → _key_26bcccb6d8af789f934ec3628e5c4b8b.json} +1 -1
  52. package/test/resources/accounts-strict-origin-off/alice/db/oidc/op/provider.json +345 -1
  53. package/test/resources/accounts-strict-origin-off/alice/db/oidc/rp/clients/_key_https%3A%2F%2Flocalhost%3A7010.json +1 -1
  54. package/test/resources/accounts-strict-origin-off/bob/db/oidc/op/clients/{_key_0ed30b9e076814c6f6445582302487c2.json → _key_bc54c25bdca9feab602988743c29af98.json} +1 -1
  55. package/test/resources/accounts-strict-origin-off/bob/db/oidc/op/provider.json +345 -1
  56. package/test/resources/accounts-strict-origin-off/bob/db/oidc/rp/clients/_key_https%3A%2F%2Flocalhost%3A7011.json +1 -1
  57. package/test/resources/config/templates/server/index.html +1 -1
  58. package/test/unit/account-manager-test.mjs +2 -2
  59. package/test/unit/account-template-test.mjs +0 -1
  60. package/test/unit/add-cert-request-test.mjs +0 -1
  61. package/test/unit/email-service-test.mjs +0 -1
  62. package/test/unit/email-welcome-test.mjs +1 -2
  63. package/test/unit/esm-imports.test.mjs +0 -1
  64. package/test/unit/oidc-manager-test.mjs +0 -1
  65. package/test/unit/solid-host-test.mjs +0 -1
  66. package/test/unit/user-account-test.mjs +0 -1
  67. package/test/unit/utils-test.mjs +1 -3
  68. package/test/utils/index.mjs +0 -1
  69. package/test/utils.mjs +3 -4
  70. package/test/validate-turtle.mjs +0 -1
  71. package/common/js/auth-buttons.js +0 -67
  72. package/common/js/index-buttons.js +0 -44
  73. package/config/defaults.js +0 -25
  74. package/config/templates/emails/delete-account.js +0 -49
  75. package/config/templates/emails/invalid-username.js +0 -30
  76. package/config/templates/emails/reset-password.js +0 -49
  77. package/config/templates/emails/welcome.js +0 -39
  78. package/coverage/tmp/coverage-2254-1766613200322-0.json +0 -1
  79. package/default-templates/emails/delete-account.js +0 -49
  80. package/default-templates/emails/invalid-username.js +0 -30
  81. package/default-templates/emails/reset-password.js +0 -49
  82. package/default-templates/emails/welcome.js +0 -39
@@ -48,7 +48,7 @@
48
48
  </div> <!-- end container-->
49
49
 
50
50
  <script src="/mashlib.js"></script>
51
- <script src="/common/js/index-buttons.js"></script>
51
+ <script src="/common/js/index-buttons.mjs"></script>
52
52
 
53
53
  </body>
54
54
  </html>
@@ -0,0 +1,102 @@
1
+ import js from '@eslint/js'
2
+ import globals from 'globals'
3
+
4
+ export default [
5
+ js.configs.recommended,
6
+ {
7
+ languageOptions: {
8
+ ecmaVersion: 2022,
9
+ sourceType: 'module',
10
+ globals: {
11
+ ...globals.node,
12
+ ...globals.mocha,
13
+ fetch: 'readonly',
14
+ AbortController: 'readonly',
15
+ Headers: 'readonly',
16
+ Request: 'readonly',
17
+ Response: 'readonly',
18
+ URL: 'readonly',
19
+ URLSearchParams: 'readonly'
20
+ }
21
+ },
22
+ rules: {
23
+ // StandardJS-like rules
24
+ 'no-unused-vars': ['warn', {
25
+ args: 'none',
26
+ caughtErrors: 'none',
27
+ ignoreRestSiblings: true,
28
+ vars: 'all'
29
+ }],
30
+ 'no-empty': ['error', { allowEmptyCatch: true }],
31
+ 'no-var': 'error',
32
+ 'prefer-const': ['error', { destructuring: 'all' }],
33
+ 'quote-props': ['error', 'as-needed'],
34
+ semi: ['error', 'never'],
35
+ quotes: ['error', 'single', { avoidEscape: true, allowTemplateLiterals: true }],
36
+ 'comma-dangle': ['error', 'never'],
37
+ 'space-before-function-paren': ['error', 'always'],
38
+ indent: ['error', 2, {
39
+ SwitchCase: 1,
40
+ VariableDeclarator: 1,
41
+ outerIIFEBody: 1,
42
+ MemberExpression: 1,
43
+ FunctionDeclaration: { parameters: 1, body: 1 },
44
+ FunctionExpression: { parameters: 1, body: 1 },
45
+ CallExpression: { arguments: 1 },
46
+ ArrayExpression: 1,
47
+ ObjectExpression: 1,
48
+ ImportDeclaration: 1,
49
+ flatTernaryExpressions: false,
50
+ ignoreComments: false,
51
+ ignoredNodes: ['TemplateLiteral *', 'JSXElement', 'JSXElement > *', 'JSXAttribute', 'JSXIdentifier', 'JSXNamespacedName', 'JSXMemberExpression', 'JSXSpreadAttribute', 'JSXExpressionContainer', 'JSXOpeningElement', 'JSXClosingElement', 'JSXFragment', 'JSXOpeningFragment', 'JSXClosingFragment', 'JSXText', 'JSXEmptyExpression', 'JSXSpreadChild'],
52
+ offsetTernaryExpressions: true
53
+ }],
54
+ 'key-spacing': ['error', { beforeColon: false, afterColon: true }],
55
+ 'keyword-spacing': ['error', { before: true, after: true }],
56
+ 'object-curly-spacing': ['error', 'always'],
57
+ 'array-bracket-spacing': ['error', 'never'],
58
+ 'space-in-parens': ['error', 'never'],
59
+ 'space-before-blocks': ['error', 'always'],
60
+ 'space-infix-ops': 'error',
61
+ 'eol-last': 'error',
62
+ 'no-multiple-empty-lines': ['error', { max: 1, maxBOF: 0, maxEOF: 0 }],
63
+ 'no-trailing-spaces': 'error',
64
+ 'comma-spacing': ['error', { before: false, after: true }],
65
+ 'no-multi-spaces': 'error',
66
+ 'no-mixed-operators': ['error', {
67
+ groups: [
68
+ ['==', '!=', '===', '!==', '>', '>=', '<', '<='],
69
+ ['&&', '||'],
70
+ ['in', 'instanceof']
71
+ ],
72
+ allowSamePrecedence: true
73
+ }],
74
+ 'operator-linebreak': ['error', 'after', { overrides: { '?': 'before', ':': 'before', '|>': 'before' } }],
75
+ 'brace-style': ['error', '1tbs', { allowSingleLine: true }],
76
+ 'arrow-spacing': ['error', { before: true, after: true }],
77
+ 'padded-blocks': ['error', { blocks: 'never', switches: 'never', classes: 'never' }],
78
+ 'no-use-before-define': ['error', { functions: false, classes: false, variables: false }]
79
+ }
80
+ },
81
+ {
82
+ // Browser files (client-side code)
83
+ files: ['common/**/*.mjs'],
84
+ languageOptions: {
85
+ globals: {
86
+ ...globals.browser,
87
+ solid: 'readonly',
88
+ UI: 'readonly',
89
+ owaspPasswordStrengthTest: 'readonly'
90
+ }
91
+ }
92
+ },
93
+ {
94
+ ignores: [
95
+ 'node_modules/**',
96
+ 'coverage/**',
97
+ '.db/**',
98
+ 'data/**',
99
+ 'resources/**'
100
+ ]
101
+ }
102
+ ]
package/index.mjs CHANGED
@@ -8,15 +8,15 @@ import startCli from './bin/lib/cli.mjs'
8
8
  let exported
9
9
  const canAttach = (ldnode && (typeof ldnode === 'object' || typeof ldnode === 'function'))
10
10
  if (canAttach) {
11
- try {
12
- if (!ldnode.createServer) ldnode.createServer = createServer
13
- if (!ldnode.startCli) ldnode.startCli = startCli
14
- exported = ldnode
15
- } catch (e) {
16
- exported = { default: ldnode, createServer, startCli }
17
- }
11
+ try {
12
+ if (!ldnode.createServer) ldnode.createServer = createServer
13
+ if (!ldnode.startCli) ldnode.startCli = startCli
14
+ exported = ldnode
15
+ } catch (e) {
16
+ exported = { default: ldnode, createServer, startCli }
17
+ }
18
18
  } else {
19
- exported = { default: ldnode, createServer, startCli }
19
+ exported = { default: ldnode, createServer, startCli }
20
20
  }
21
21
 
22
22
  export default exported
@@ -1,5 +1,4 @@
1
1
  'use strict'
2
- /* eslint-disable node/no-deprecated-api */
3
2
 
4
3
  import { dirname } from 'path'
5
4
  import rdf from 'rdflib'
@@ -10,7 +9,6 @@ import aclCheck from '@solid/acl-check'
10
9
  import Url, { URL } from 'url'
11
10
  import { promisify } from 'util'
12
11
  import fs from 'fs'
13
- import httpFetch from 'node-fetch'
14
12
 
15
13
  export const DEFAULT_ACL_SUFFIX = '.acl'
16
14
  const ACL = rdf.Namespace('http://www.w3.org/ns/auth/acl#')
@@ -309,7 +307,7 @@ function fetchLocalOrRemote (mapper, serverUri) {
309
307
  body = await promisify(fs.readFile)(path, { encoding: 'utf8' })
310
308
  } else {
311
309
  // Fetch the acl from the internet
312
- const response = await httpFetch(url)
310
+ const response = await fetch(url)
313
311
  body = await response.text()
314
312
  contentType = response.headers.get('content-type')
315
313
  }
@@ -1,5 +1,3 @@
1
- /* eslint-disable node/no-deprecated-api */
2
-
3
1
  import debug from '../debug.mjs'
4
2
  import HTTPError from '../http-error.mjs'
5
3
  import ldpCopy from '../ldp-copy.mjs'
@@ -1,11 +1,9 @@
1
- /* eslint-disable node/no-deprecated-api */
2
-
3
1
  import { createProxyMiddleware } from 'http-proxy-middleware'
4
2
  import cors from 'cors'
5
3
  import debug from '../debug.mjs'
6
4
  import url from 'url'
7
5
  import dns from 'dns'
8
- import isIp from 'is-ip'
6
+ import { isIP } from 'is-ip'
9
7
  import ipRange from 'ip-range-check'
10
8
  import validUrl from 'valid-url'
11
9
 
@@ -75,7 +73,7 @@ function extractProxyConfig (req, res, next) {
75
73
 
76
74
  // Parse the URL and retrieve its host's IP address
77
75
  const { protocol, host, hostname, path } = url.parse(uri)
78
- if (isIp(hostname)) {
76
+ if (isIP(hostname)) {
79
77
  addProxyConfig(null, hostname)
80
78
  } else {
81
79
  dns.lookup(hostname, addProxyConfig)
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { createRequire } from 'module'
4
4
  import fs from 'fs'
5
- import glob from 'glob'
5
+ import { glob, hasMagic } from 'glob'
6
6
  import _path from 'path'
7
7
  import $rdf from 'rdflib'
8
8
  import Negotiator from 'negotiator'
@@ -37,7 +37,7 @@ export default async function handler (req, res, next) {
37
37
 
38
38
  res.header('Accept-Patch', 'text/n3, application/sparql-update, application/sparql-update-single-match')
39
39
  res.header('Accept-Post', '*/*')
40
- if (!path.endsWith('/') && !glob.hasMagic(path)) res.header('Accept-Put', '*/*')
40
+ if (!path.endsWith('/') && !hasMagic(path)) res.header('Accept-Put', '*/*')
41
41
 
42
42
  // Set live updates
43
43
  if (ldp.live) {
@@ -62,7 +62,7 @@ export default async function handler (req, res, next) {
62
62
  // set Accept-Put if container do not exist
63
63
  if (err.status === 404 && path.endsWith('/')) res.header('Accept-Put', 'text/turtle')
64
64
  // use globHandler if magic is detected
65
- if (err.status === 404 && glob.hasMagic(path)) {
65
+ if (err.status === 404 && hasMagic(path)) {
66
66
  debug('forwarding to glob request')
67
67
  return globHandler(req, res, next)
68
68
  } else {
@@ -188,8 +188,9 @@ async function globHandler (req, res, next) {
188
188
  nodir: true
189
189
  }
190
190
 
191
- glob(`${folderPath}*`, globOptions, async (err, matches) => {
192
- if (err || matches.length === 0) {
191
+ try {
192
+ const matches = await glob(`${folderPath}*`, globOptions)
193
+ if (matches.length === 0) {
193
194
  debugGlob('No files matching the pattern')
194
195
  return next(HTTPError(404, 'No files matching glob pattern'))
195
196
  }
@@ -230,7 +231,10 @@ async function globHandler (req, res, next) {
230
231
 
231
232
  res.send(data)
232
233
  next()
233
- })
234
+ } catch (err) {
235
+ debugGlob('Error during glob: ' + err)
236
+ return next(HTTPError(500, 'Error processing glob pattern'))
237
+ }
234
238
  }
235
239
 
236
240
  // TODO: get rid of this ugly hack that uses the Allow handler to check read permissions
@@ -240,7 +244,7 @@ function hasReadPermissions (file, req, res, callback) {
240
244
  if (!ldp.webid) {
241
245
  // FIXME: what is the rule that causes
242
246
  // "Unexpected literal in error position of callback" in `npm run standard`?
243
- // eslint-disable-next-line
247
+
244
248
  return callback(true)
245
249
  }
246
250
 
@@ -249,6 +253,6 @@ function hasReadPermissions (file, req, res, callback) {
249
253
  res.locals.path = relativePath
250
254
  // FIXME: what is the rule that causes
251
255
  // "Unexpected literal in error position of callback" in `npm run standard`?
252
- // eslint-disable-next-line
256
+
253
257
  allow('Read')(req, res, err => callback(!err))
254
258
  }
@@ -1,5 +1,3 @@
1
- /* eslint-disable node/no-deprecated-api */
2
-
3
1
  import path from 'path'
4
2
  import debugModule from 'debug'
5
3
  import Negotiator from 'negotiator'
@@ -1,5 +1,3 @@
1
- /* eslint-disable node/no-deprecated-api */
2
-
3
1
  import { addLink } from '../header.mjs'
4
2
  import url from 'url'
5
3
 
package/lib/ldp.mjs CHANGED
@@ -1,5 +1,3 @@
1
- /* eslint-disable node/no-deprecated-api */
2
-
3
1
  import utilPath, { join, dirname } from 'path'
4
2
  import intoStream from 'into-stream'
5
3
  import urlModule from 'url'
@@ -14,7 +12,6 @@ import extend from 'extend'
14
12
  import rimraf from 'rimraf'
15
13
  import { exec } from 'child_process'
16
14
  import * as ldpContainer from './ldp-container.mjs'
17
- import fetch from 'node-fetch'
18
15
  import { promisify } from 'util'
19
16
  import withLock from './lock.mjs'
20
17
  import { clearAclCache } from './acl-checker.mjs'
@@ -275,7 +275,7 @@ class AccountManager {
275
275
  webId: userAccount.webId,
276
276
  resetUrl
277
277
  }
278
- return this.emailService.sendWithTemplate('reset-password', emailData)
278
+ return this.emailService.sendWithTemplate('reset-password.mjs', emailData)
279
279
  })
280
280
  }
281
281
 
@@ -289,7 +289,7 @@ class AccountManager {
289
289
  webid: newUser.webId,
290
290
  name: newUser.displayName
291
291
  }
292
- return emailService.sendWithTemplate('welcome', emailData)
292
+ return emailService.sendWithTemplate('welcome.mjs', emailData)
293
293
  }
294
294
  }
295
295
 
@@ -1,4 +1,3 @@
1
- /* eslint-disable no-unused-expressions */
2
1
  import { URL } from 'url'
3
2
  import path from 'path'
4
3
  import debug from '../debug.mjs'
@@ -1,5 +1,3 @@
1
- /* eslint-disable node/no-deprecated-api, no-mixed-operators */
2
-
3
1
  import fs from 'fs'
4
2
  import URL from 'url'
5
3
  import { promisify } from 'util'
@@ -196,7 +194,7 @@ class ResourceMapper {
196
194
  _getContentTypeFromExtension (path) {
197
195
  const defaultContentType = (path === '' || path.endsWith('/')) ? this._defaultContainerContentType : this._defaultContentType
198
196
  const extension = /\.([^/.]+)$/.exec(path)
199
- return extension && this._types[extension[1].toLowerCase()] || defaultContentType
197
+ return (extension && this._types[extension[1].toLowerCase()]) || defaultContentType
200
198
  }
201
199
 
202
200
  // Appends an extension for the specific content type, if needed
package/lib/utils.mjs CHANGED
@@ -1,5 +1,3 @@
1
- /* eslint-disable node/no-deprecated-api */
2
-
3
1
  import fs from 'fs'
4
2
  import path from 'path'
5
3
  import util from 'util'
@@ -1,4 +1,3 @@
1
- import fetch from 'node-fetch'
2
1
  import { URL } from 'url'
3
2
 
4
3
  export default function get (webid, callback) {
@@ -1,4 +1,3 @@
1
-
2
1
  import * as verifyModule from '../lib/verify.mjs'
3
2
  import * as generateModule from './generate.mjs'
4
3
 
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.8.8-8d509db1",
4
+ "version": "5.8.8-90b76b88",
5
5
  "author": {
6
6
  "name": "Tim Berners-Lee",
7
7
  "email": "timbl@w3.org"
@@ -59,51 +59,52 @@
59
59
  "homepage": "https://github.com/solid/node-solid-server",
60
60
  "bugs": "https://github.com/solid/node-solid-server/issues",
61
61
  "dependencies": {
62
- "@fastify/busboy": "^1.2.1",
62
+ "@fastify/busboy": "^3.2.0",
63
63
  "@fastify/pre-commit": "^2.2.1",
64
64
  "@solid/acl-check": "^0.4.5",
65
- "@solid/oidc-auth-manager": "^0.24.5",
66
- "@solid/oidc-op": "^0.11.7",
67
- "@solid/oidc-rp": "^0.11.8",
65
+ "@solid/oidc-auth-manager": "^0.25.2",
66
+ "@solid/oidc-op": "^0.12.1",
67
+ "@solid/oidc-rp": "^0.12.1",
68
+ "@solid/solid-multi-rp-client": "^0.7.2",
68
69
  "async-lock": "^1.4.1",
69
- "body-parser": "^1.20.3",
70
+ "body-parser": "^1.20.4",
70
71
  "bootstrap": "^3.4.1",
71
72
  "cached-path-relative": "^1.1.0",
72
73
  "camelize": "^1.0.1",
73
- "cheerio": "^1.0.0",
74
+ "cheerio": "^1.1.2",
74
75
  "colorette": "^2.0.20",
75
- "commander": "^8.3.0",
76
+ "commander": "^14.0.2",
76
77
  "cors": "^2.8.5",
77
78
  "debug": "^4.4.3",
78
- "express": "^4.21.2",
79
+ "eslint": "^9.39.2",
80
+ "express": "^4.22.1",
79
81
  "express-accept-events": "^0.3.0",
80
82
  "express-handlebars": "^5.3.5",
81
83
  "express-negotiate-events": "^0.3.0",
82
84
  "express-prep": "^0.6.4",
83
- "express-session": "^1.18.1",
85
+ "express-session": "^1.18.2",
84
86
  "extend": "^3.0.2",
85
87
  "from2": "^2.3.0",
86
- "fs-extra": "^10.1.0",
88
+ "fs-extra": "^11.3.3",
87
89
  "get-folder-size": "^2.0.1",
88
- "glob": "^7.2.3",
90
+ "glob": "^13.0.0",
89
91
  "global-tunnel-ng": "^2.7.1",
90
92
  "handlebars": "^4.7.8",
91
- "http-proxy-middleware": "^2.0.7",
92
- "inquirer": "^8.2.6",
93
- "into-stream": "^5.1.1",
93
+ "http-proxy-middleware": "^2.0.9",
94
+ "inquirer": "^8.2.7",
95
+ "into-stream": "^9.0.0",
94
96
  "ip-range-check": "0.2.0",
95
- "is-ip": "^2.0.0",
97
+ "is-ip": "^5.0.1",
96
98
  "li": "^1.3.0",
97
- "mashlib": "^1.11.1",
98
- "mime-types": "^2.1.35",
99
- "negotiator": "^0.6.4",
100
- "node-fetch": "^2.7.0",
101
- "node-forge": "^1.3.2",
99
+ "mashlib": "^2.0.0-de1f6b8e",
100
+ "mime-types": "^3.0.2",
101
+ "negotiator": "^1.0.0",
102
+ "node-forge": "^1.3.3",
102
103
  "node-mailer": "^0.1.1",
103
- "nodemailer": "^7.0.10",
104
+ "nodemailer": "^7.0.12",
104
105
  "oidc-op-express": "^0.0.3",
105
106
  "owasp-password-strength-test": "^1.3.0",
106
- "rdflib": "^2.3.0",
107
+ "rdflib": "^2.3.3",
107
108
  "recursive-readdir": "^2.2.3",
108
109
  "rimraf": "^3.0.2",
109
110
  "solid-auth-client": "^2.5.6",
@@ -111,38 +112,38 @@
111
112
  "solid-ws": "^0.4.3",
112
113
  "text-encoder-lite": "^2.0.0",
113
114
  "the-big-username-blacklist": "^1.5.2",
114
- "ulid": "^2.3.0",
115
+ "ulid": "^3.0.2",
115
116
  "urijs": "^1.19.11",
116
117
  "uuid": "^13.0.0",
117
118
  "valid-url": "^1.0.9",
118
- "validator": "^13.12.0",
119
+ "validator": "^13.15.26",
119
120
  "vhost": "^3.0.2"
120
121
  },
121
122
  "devDependencies": {
122
123
  "@cxres/structured-headers": "^2.0.0-nesting.0",
123
- "@solid/solid-auth-oidc": "^0.5.7",
124
+ "@eslint/js": "^9.39.2",
125
+ "@solid/solid-auth-oidc": "^0.6.1",
124
126
  "c8": "^10.1.3",
125
127
  "chai": "^4.5.0",
126
128
  "chai-as-promised": "7.1.2",
127
- "cross-env": "7.0.3",
129
+ "cross-env": "^10.1.0",
128
130
  "dirty-chai": "2.0.1",
129
- "eslint": "^7.32.0",
131
+ "globals": "^17.0.0",
130
132
  "localstorage-memory": "1.0.3",
131
- "mocha": "^10.8.2",
133
+ "mocha": "^11.7.5",
132
134
  "nock": "^13.5.6",
133
- "node-mocks-http": "^1.16.2",
135
+ "node-mocks-http": "^1.17.2",
134
136
  "prep-fetch": "^0.1.0",
135
137
  "randombytes": "2.1.0",
136
138
  "sinon": "12.0.1",
137
139
  "sinon-chai": "3.7.0",
138
- "snyk": "^1.1295.3",
139
- "standard": "16.0.4",
140
- "supertest": "^6.3.4",
140
+ "snyk": "^1.1301.2",
141
+ "supertest": "^7.1.4",
141
142
  "turtle-validator": "1.1.1",
142
- "whatwg-url": "11.0.0"
143
+ "whatwg-url": "^15.1.0"
143
144
  },
144
145
  "pre-commit": [
145
- "standard"
146
+ "lint"
146
147
  ],
147
148
  "main": "index.mjs",
148
149
  "exports": {
@@ -154,8 +155,8 @@
154
155
  "scripts": {
155
156
  "build": "echo nothing to build",
156
157
  "solid": "node ./bin/solid",
157
- "standard": "standard \"{bin,examples,lib,test}/**/*.mjs\"",
158
- "standard-fix": "standard --fix \"{bin,examples,lib,test}/**/*.mjs\"",
158
+ "lint": "eslint \"**/*.mjs\"",
159
+ "lint-fix": "eslint --fix \"**/*.mjs\"",
159
160
  "validate": "node ./test/validate-turtle.mjs",
160
161
  "c8": "cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 c8 --reporter=text-summary mocha --recursive test/unit/ test/integration/",
161
162
  "mocha": "cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 mocha --recursive test/unit/ test/integration/",
@@ -169,7 +170,7 @@
169
170
  "mocha-ldp": "cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 mocha --recursive test/integration/ldp-test.mjs",
170
171
  "ignore:prepublishOnly": "npm test",
171
172
  "ignore:postpublish": "git push --follow-tags",
172
- "test": "npm run standard && npm run validate && npm run c8",
173
+ "test": "npm run lint && npm run validate && npm run c8",
173
174
  "test-unit": "cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 mocha test/unit/**/*.mjs --timeout 10000",
174
175
  "test-integration": "cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 mocha test/integration/**/*.mjs --timeout 15000",
175
176
  "test-performance": "cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 mocha test/performance/**/*.mjs --timeout 10000",
Binary file
package/test/index.mjs CHANGED
@@ -7,7 +7,6 @@ import dns from 'dns'
7
7
  import ldnode from '../../index.mjs'
8
8
  // import ldnode from '../index.mjs'
9
9
  import supertest from 'supertest'
10
- import fetch from 'node-fetch'
11
10
  import https from 'https'
12
11
 
13
12
  const __filename = fileURLToPath(import.meta.url)
@@ -1,4 +1,3 @@
1
- /* eslint-disable no-unused-expressions */
2
1
  import path from 'path'
3
2
  import { fileURLToPath } from 'url'
4
3
  import fs from 'fs-extra'
@@ -52,7 +51,7 @@ describe('AccountManager', () => {
52
51
  // Note: test/resources/accounts/tim.localhost/ exists in this repo
53
52
  return accountManager.accountExists('tim')
54
53
  .then(exists => {
55
- console.log('DEBUG tim exists:', exists, typeof exists)
54
+ // console.log('DEBUG tim exists:', exists, typeof exists)
56
55
  expect(exists).to.not.be.false
57
56
  })
58
57
  })
@@ -61,7 +60,7 @@ describe('AccountManager', () => {
61
60
  // Note: test/resources/accounts/alice.localhost/ does NOT exist
62
61
  return accountManager.accountExists('alice')
63
62
  .then(exists => {
64
- console.log('DEBUG alice exists:', exists, typeof exists)
63
+ // console.log('DEBUG alice exists:', exists, typeof exists)
65
64
  expect(exists).to.not.be.false
66
65
  })
67
66
  })
@@ -1,4 +1,3 @@
1
- /* eslint-disable no-unused-expressions */
2
1
  import { fileURLToPath } from 'url'
3
2
  import path from 'path'
4
3
  import fs from 'fs-extra'
@@ -1,6 +1,5 @@
1
1
  import { assert } from 'chai'
2
2
  import fs from 'fs-extra'
3
- import fetch from 'node-fetch'
4
3
  import path from 'path'
5
4
  import { fileURLToPath } from 'url'
6
5
  import { loadProvider, rm, checkDnsSettings, cleanDir } from '../utils.mjs'
@@ -6,7 +6,6 @@ import { UserStore } from '@solid/oidc-auth-manager'
6
6
  import UserAccount from '../../lib/models/user-account.mjs'
7
7
  import SolidAuthOIDC from '@solid/solid-auth-oidc'
8
8
 
9
- import fetch from 'node-fetch'
10
9
  import localStorage from 'localstorage-memory'
11
10
  import { URL, URLSearchParams } from 'whatwg-url'
12
11
  import { cleanDir, cp } from '../utils.mjs'
@@ -26,7 +25,7 @@ const __dirname = path.dirname(__filename)
26
25
 
27
26
  // FIXME #1502
28
27
  describe('Authentication API (OIDC)', () => {
29
- let alice, bob // eslint-disable-line no-unused-vars
28
+ let alice, bob
30
29
 
31
30
  const aliceServerUri = 'https://localhost:7000'
32
31
  const aliceWebId = 'https://localhost:7000/profile/card#me'
@@ -642,7 +641,7 @@ describe('Authentication API (OIDC)', () => {
642
641
  // Since user is not logged in, /authorize redirects to /login
643
642
  expect(res.status).to.equal(302)
644
643
 
645
- loginUri = new URL(res.headers.get('location'))
644
+ loginUri = new URL(res.headers.get('location'), aliceServerUri)
646
645
  expect(loginUri.toString().startsWith(aliceServerUri + '/login'))
647
646
  .to.be.true()
648
647
 
@@ -686,9 +685,11 @@ describe('Authentication API (OIDC)', () => {
686
685
  })
687
686
  .then(res => {
688
687
  expect(res.status).to.equal(302)
689
- postLoginUri = res.headers.get('location')
690
- cookie = res.headers.get('set-cookie')
691
-
688
+ const location = res.headers.get('location')
689
+ postLoginUri = new URL(location, aliceServerUri).toString()
690
+ // Native fetch: get first set-cookie header
691
+ const setCookieHeaders = res.headers.getSetCookie ? res.headers.getSetCookie() : [res.headers.get('set-cookie')]
692
+ cookie = setCookieHeaders[0]
692
693
  // Successful login gets redirected back to /authorize and then
693
694
  // back to app
694
695
  expect(postLoginUri.startsWith(aliceServerUri + '/sharing'))
@@ -712,7 +713,9 @@ describe('Authentication API (OIDC)', () => {
712
713
  })
713
714
  .then(res => {
714
715
  expect(res.status).to.equal(302)
715
- postSharingUri = res.headers.get('location')
716
+ const location = res.headers.get('location')
717
+ postSharingUri = new URL(location, aliceServerUri).toString()
718
+
716
719
  // cookie = res.headers.get('set-cookie')
717
720
 
718
721
  // Successful login gets redirected back to /authorize and then
@@ -724,7 +727,9 @@ describe('Authentication API (OIDC)', () => {
724
727
  .then(res => {
725
728
  // User gets redirected back to original app
726
729
  expect(res.status).to.equal(302)
727
- callbackUri = res.headers.get('location')
730
+ const location = res.headers.get('location')
731
+ callbackUri = location.startsWith('http') ? location : new URL(location, aliceServerUri).toString()
732
+
728
733
  expect(callbackUri.startsWith('https://app.example.com#'))
729
734
  })
730
735
  })