solid-server 5.8.8-22f4cfec → 5.8.8-5fdbfa12

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 (62) hide show
  1. package/common/js/auth-buttons.mjs +20 -20
  2. package/common/js/index-buttons.mjs +28 -33
  3. package/common/js/solid.mjs +11 -11
  4. package/config/defaults.mjs +1 -1
  5. package/coverage/tmp/coverage-2275-1766876301000-0.json +1 -0
  6. package/coverage/tmp/{coverage-2261-1766832635310-0.json → coverage-2276-1766876279735-0.json} +1 -1
  7. package/eslint.config.mjs +102 -0
  8. package/index.mjs +8 -8
  9. package/lib/acl-checker.mjs +1 -3
  10. package/lib/create-server.mjs +2 -2
  11. package/lib/handlers/auth-proxy.mjs +4 -3
  12. package/lib/handlers/copy.mjs +0 -2
  13. package/lib/handlers/cors-proxy.mjs +3 -6
  14. package/lib/handlers/get.mjs +15 -11
  15. package/lib/handlers/index.mjs +0 -2
  16. package/lib/handlers/options.mjs +0 -2
  17. package/lib/ldp.mjs +2 -5
  18. package/lib/models/account-manager.mjs +1 -1
  19. package/lib/models/oidc-manager.mjs +0 -1
  20. package/lib/resource-mapper.mjs +1 -3
  21. package/lib/utils.mjs +1 -3
  22. package/lib/webid/lib/get.mjs +0 -1
  23. package/lib/webid/tls/index.mjs +0 -1
  24. package/package.json +26 -38
  25. package/solid-server-5.8.8.tgz +0 -0
  26. package/test/index.mjs +2 -3
  27. package/test/integration/account-manager-test.mjs +0 -1
  28. package/test/integration/account-template-test.mjs +0 -1
  29. package/test/integration/acl-oidc-test.mjs +1 -2
  30. package/test/integration/authentication-oidc-test.mjs +11 -7
  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/http-copy-test.mjs +2 -2
  34. package/test/integration/oidc-manager-test.mjs +0 -1
  35. package/test/integration/quota-test.mjs +0 -1
  36. package/test/integration/www-account-creation-oidc-test.mjs +0 -1
  37. package/test/resources/accounts/db/oidc/op/clients/{_key_5319f8e8e4ea3214c2e92b252520d355.json → _key_abbf27de893abf7d05279547c22d9366.json} +1 -1
  38. package/test/resources/accounts/db/oidc/rp/clients/_key_https%3A%2F%2Flocalhost%3A3457.json +1 -1
  39. package/test/resources/accounts-scenario/alice/db/oidc/op/clients/{_key_9c0fd8442675a1afbe5115b9ae300c65.json → _key_931f2a0c999a8f0695573844341dde0e.json} +1 -1
  40. package/test/resources/accounts-scenario/alice/db/oidc/rp/clients/_key_https%3A%2F%2Flocalhost%3A7000.json +1 -1
  41. package/test/resources/accounts-scenario/bob/db/oidc/op/clients/{_key_f15f340b6dc71b68d20eca0d7e87a972.json → _key_8bdd350afbe0452a42fe6b3b3705d25f.json} +1 -1
  42. package/test/resources/accounts-scenario/bob/db/oidc/rp/clients/_key_https%3A%2F%2Flocalhost%3A7001.json +1 -1
  43. package/test/resources/accounts-scenario/charlie/db/oidc/op/clients/{_key_7c634dfe325475cc8750e19c72acf6d9.json → _key_e4ed74eed3926d2f8d4d1d9661be7aea.json} +1 -1
  44. package/test/resources/accounts-scenario/charlie/db/oidc/rp/clients/_key_https%3A%2F%2Flocalhost%3A5002.json +1 -1
  45. package/test/resources/accounts-strict-origin-off/alice/db/oidc/op/clients/{_key_3f1cecaefd21253767f6e047bd9b572f.json → _key_9d6b49e3a595c4942e1105545518362d.json} +1 -1
  46. package/test/resources/accounts-strict-origin-off/alice/db/oidc/rp/clients/_key_https%3A%2F%2Flocalhost%3A7010.json +1 -1
  47. package/test/resources/accounts-strict-origin-off/bob/db/oidc/op/clients/{_key_a17f603b5907c97a5fac61a2eea7ecb2.json → _key_5f68117de7511ed2b2290d81c83a2d98.json} +1 -1
  48. package/test/resources/accounts-strict-origin-off/bob/db/oidc/rp/clients/_key_https%3A%2F%2Flocalhost%3A7011.json +1 -1
  49. package/test/unit/account-template-test.mjs +0 -1
  50. package/test/unit/add-cert-request-test.mjs +0 -1
  51. package/test/unit/create-account-request-test.mjs +1 -1
  52. package/test/unit/email-service-test.mjs +0 -1
  53. package/test/unit/email-welcome-test.mjs +0 -1
  54. package/test/unit/esm-imports.test.mjs +0 -1
  55. package/test/unit/oidc-manager-test.mjs +0 -1
  56. package/test/unit/solid-host-test.mjs +0 -1
  57. package/test/unit/user-account-test.mjs +0 -1
  58. package/test/unit/utils-test.mjs +1 -3
  59. package/test/utils/index.mjs +2 -3
  60. package/test/utils.mjs +2 -3
  61. package/test/validate-turtle.mjs +0 -1
  62. package/coverage/tmp/coverage-2260-1766832656715-0.json +0 -1
@@ -17,41 +17,41 @@
17
17
  'account-settings',
18
18
  'loggedIn',
19
19
  'profileLink'
20
- ].map(id => document.getElementById(id) || document.createElement('a'));
21
- loginButton.addEventListener('click', login);
22
- logoutButton.addEventListener('click', logout);
23
- registerButton.addEventListener('click', register);
20
+ ].map(id => document.getElementById(id) || document.createElement('a'))
21
+ loginButton.addEventListener('click', login)
22
+ logoutButton.addEventListener('click', logout)
23
+ registerButton.addEventListener('click', register)
24
24
 
25
25
  // Track authentication status and update UI
26
26
  auth.trackSession(session => {
27
- const loggedIn = !!session;
28
- const isOwner = loggedIn && new URL(session.webId).origin === location.origin;
29
- loginButton.classList.toggle('hidden', loggedIn);
30
- logoutButton.classList.toggle('hidden', !loggedIn);
31
- registerButton.classList.toggle('hidden', loggedIn);
32
- accountSettings.classList.toggle('hidden', !isOwner);
33
- loggedInContainer.classList.toggle('hidden', !loggedIn);
27
+ const loggedIn = !!session
28
+ const isOwner = loggedIn && new URL(session.webId).origin === location.origin
29
+ loginButton.classList.toggle('hidden', loggedIn)
30
+ logoutButton.classList.toggle('hidden', !loggedIn)
31
+ registerButton.classList.toggle('hidden', loggedIn)
32
+ accountSettings.classList.toggle('hidden', !isOwner)
33
+ loggedInContainer.classList.toggle('hidden', !loggedIn)
34
34
  if (session) {
35
- profileLink.href = session.webId;
36
- profileLink.innerText = session.webId;
35
+ profileLink.href = session.webId
36
+ profileLink.innerText = session.webId
37
37
  }
38
- });
38
+ })
39
39
 
40
40
  // Log the user in on the client and the server
41
41
  async function login () {
42
- alert(`login from this page is no more possible.\n\nYou must ask the pod owner to modify this page or remove it.`);
42
+ alert(`login from this page is no more possible.\n\nYou must ask the pod owner to modify this page or remove it.`)
43
43
  // Deprecated code omitted
44
44
  }
45
45
 
46
46
  // Log the user out from the client and the server
47
47
  async function logout () {
48
- await auth.logout();
49
- location.reload();
48
+ await auth.logout()
49
+ location.reload()
50
50
  }
51
51
 
52
52
  // Redirect to the registration page
53
53
  function register () {
54
- const registration = new URL('/register', location);
55
- location.href = registration;
54
+ const registration = new URL('/register', location)
55
+ location.href = registration
56
56
  }
57
- })(solid);
57
+ })(solid)
@@ -1,43 +1,38 @@
1
1
  // ESM version of index-buttons.js
2
- 'use strict';
3
- const keyname = 'SolidServerRootRedirectLink';
4
- function register() {
5
- alert(2);
6
- window.location.href = "/register";
7
- }
8
- document.addEventListener('DOMContentLoaded', async function() {
9
- const authn = UI.authn;
10
- const authSession = UI.authn.authSession;
2
+ 'use strict'
3
+ const keyname = 'SolidServerRootRedirectLink'
4
+ document.addEventListener('DOMContentLoaded', async function () {
5
+ const authn = UI.authn
6
+ const authSession = UI.authn.authSession
11
7
 
12
- if (!authn.currentUser()) await authn.checkUser();
13
- let user = authn.currentUser();
8
+ if (!authn.currentUser()) await authn.checkUser()
9
+ const user = authn.currentUser()
14
10
 
15
11
  // IF LOGGED IN: SET SolidServerRootRedirectLink. LOGOUT
16
12
  if (user) {
17
- window.localStorage.setItem(keyname, user.uri);
18
- await authSession.logout();
13
+ window.localStorage.setItem(keyname, user.uri)
14
+ await authSession.logout()
19
15
  } else {
20
- let webId = window.localStorage.getItem(keyname);
16
+ const webId = window.localStorage.getItem(keyname)
21
17
  // IF NOT LOGGED IN AND COOKIE EXISTS: REMOVE COOKIE, HIDE WELCOME, SHOW LINK TO PROFILE
22
18
  if (webId) {
23
- window.localStorage.removeItem(keyname);
24
- document.getElementById('loggedIn').style.display = "block";
25
- document.getElementById('loggedIn').innerHTML = `<p>Your WebID is : <a href="${webId}">${webId}</a>.</p> <p>Visit your profile to log into your Pod.</p>`;
26
- }
27
- // IF NOT LOGGED IN AND COOKIE DOES NOT EXIST
28
- // SHOW WELCOME, SHOW LOGIN BUTTON
29
- // HIDE LOGIN BUTTON, ADD REGISTER BUTTON
30
- else {
31
- let loginArea = document.getElementById('loginStatusArea');
32
- let html = `<input type="button" onclick="window.location.href='/register'" value="Register to get a Pod" class="register-button" style="padding: 1em; border-radius:0.2em; font-size: 100%;margin: 0.75em 0 0.75em 0.5em !important; padding: 0.5em !important;background-color: #efe;">`;
33
- let span = document.createElement("span");
34
- span.innerHTML = html;
35
- loginArea.appendChild(span);
36
- loginArea.appendChild(UI.login.loginStatusBox(document, null, {}));
37
- const logInButton = loginArea.querySelectorAll('input')[1];
38
- logInButton.value = "Log in to see your WebID";
39
- const signUpButton = loginArea.querySelectorAll('input')[2];
40
- signUpButton.style.display = "none";
19
+ window.localStorage.removeItem(keyname)
20
+ document.getElementById('loggedIn').style.display = 'block'
21
+ document.getElementById('loggedIn').innerHTML = `<p>Your WebID is : <a href="${webId}">${webId}</a>.</p> <p>Visit your profile to log into your Pod.</p>`
22
+ // IF NOT LOGGED IN AND COOKIE DOES NOT EXIST
23
+ // SHOW WELCOME, SHOW LOGIN BUTTON
24
+ // HIDE LOGIN BUTTON, ADD REGISTER BUTTON
25
+ } else {
26
+ const loginArea = document.getElementById('loginStatusArea')
27
+ const html = `<input type="button" onclick="window.location.href='/register'" value="Register to get a Pod" class="register-button" style="padding: 1em; border-radius:0.2em; font-size: 100%;margin: 0.75em 0 0.75em 0.5em !important; padding: 0.5em !important;background-color: #efe;">`
28
+ const span = document.createElement('span')
29
+ span.innerHTML = html
30
+ loginArea.appendChild(span)
31
+ loginArea.appendChild(UI.login.loginStatusBox(document, null, {}))
32
+ const logInButton = loginArea.querySelectorAll('input')[1]
33
+ logInButton.value = 'Log in to see your WebID'
34
+ const signUpButton = loginArea.querySelectorAll('input')[2]
35
+ signUpButton.style.display = 'none'
41
36
  }
42
37
  }
43
- });
38
+ })
@@ -2,25 +2,25 @@
2
2
  // global: owaspPasswordStrengthTest, TextEncoder, crypto, fetch
3
3
 
4
4
  (function () {
5
- 'use strict';
5
+ 'use strict'
6
6
 
7
7
  const PasswordValidator = function (passwordField, repeatedPasswordField) {
8
8
  if (
9
9
  passwordField === null || passwordField === undefined ||
10
10
  repeatedPasswordField === null || repeatedPasswordField === undefined
11
11
  ) {
12
- return;
12
+ return
13
13
  }
14
14
 
15
- this.passwordField = passwordField;
16
- this.repeatedPasswordField = repeatedPasswordField;
15
+ this.passwordField = passwordField
16
+ this.repeatedPasswordField = repeatedPasswordField
17
17
 
18
- this.fetchDomNodes();
19
- this.bindEvents();
18
+ this.fetchDomNodes()
19
+ this.bindEvents()
20
20
 
21
- this.currentStrengthLevel = 0;
22
- this.errors = [];
23
- };
21
+ this.currentStrengthLevel = 0
22
+ this.errors = []
23
+ }
24
24
 
25
25
  const FEEDBACK_SUCCESS = 'success'
26
26
  const FEEDBACK_WARNING = 'warning'
@@ -452,5 +452,5 @@
452
452
  new PasswordValidator(
453
453
  document.getElementById('password'),
454
454
  document.getElementById('repeat_password')
455
- );
456
- })();
455
+ )
456
+ })()
@@ -19,4 +19,4 @@ export default {
19
19
  // "host": "proxy.example.com",
20
20
  // "port": 12345
21
21
  // }
22
- };
22
+ }