From a2abcb4e5b64f06e07bb78ed6fb2df3729f3df3d Mon Sep 17 00:00:00 2001 From: timea-solid <4144203+timea-solid@users.noreply.github.com> Date: Tue, 26 Aug 2025 15:52:30 +0200 Subject: [PATCH 1/2] updated inrupt authn lib to latest --- package-lock.json | 80 ++++++++++++++-------------------- package.json | 4 +- src/authSession/authSession.ts | 8 +--- src/authn/SolidAuthnLogic.ts | 5 ++- 4 files changed, 38 insertions(+), 59 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0b7bff5..d8c3d4f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,15 @@ { "name": "solid-logic", - "version": "3.0.8", + "version": "3.0.9", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "solid-logic", - "version": "3.0.8", + "version": "3.0.9", "license": "MIT", "dependencies": { - "@inrupt/solid-client-authn-browser": "1.17", + "@inrupt/solid-client-authn-browser": "^3.1.0", "lint-staged": "^15.4.3", "rdflib": "^2.2.37", "solid-namespace": "^0.5.4" @@ -2328,58 +2328,42 @@ } }, "node_modules/@inrupt/oidc-client-ext": { - "version": "1.17.5", - "resolved": "https://registry.npmjs.org/@inrupt/oidc-client-ext/-/oidc-client-ext-1.17.5.tgz", - "integrity": "sha512-vYnYbNW+EwDeAkzLzLF77PLXVeajhZ0IqocC5M2xM9aGc0JgRIy8lnrwxrV/VLf2AXRig9Aqlv/RmLY1VTz2eg==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@inrupt/oidc-client-ext/-/oidc-client-ext-3.1.0.tgz", + "integrity": "sha512-xilTPaPgRJSh+AOtjkbtk4KLTAjLfWy3owb1aOdfz9Vo3Dh5Z80rx/m/Y/Uur3AiVK9LYGrR6AM+HoCEH8MCMw==", "license": "MIT", "dependencies": { "@inrupt/oidc-client": "^1.11.6", - "@inrupt/solid-client-authn-core": "^1.17.5", - "@inrupt/universal-fetch": "^1.0.1", - "jose": "^4.15.4", - "uuid": "^9.0.1" + "@inrupt/solid-client-authn-core": "^3.1.0", + "jose": "^5.1.3", + "uuid": "^11.1.0" } }, "node_modules/@inrupt/solid-client-authn-browser": { - "version": "1.17.5", - "resolved": "https://registry.npmjs.org/@inrupt/solid-client-authn-browser/-/solid-client-authn-browser-1.17.5.tgz", - "integrity": "sha512-zjyXPmKACp7syNsctQfkFhYCwEQ5QoTStLMbBFhtqJAsoWpo+d/awI1nljTDKxlJtYnvEoYjl2pM2aZMJ7mtew==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@inrupt/solid-client-authn-browser/-/solid-client-authn-browser-3.1.0.tgz", + "integrity": "sha512-TK8LdCuqJxZ6jvxWIJfRqji9lM7h69tbzlM0hoE/orrkQzxBUF7OOZUCXOpkIKDrl39BIfaacIOYhuBA8hkFYw==", "license": "MIT", "dependencies": { - "@inrupt/oidc-client-ext": "^1.17.5", - "@inrupt/solid-client-authn-core": "^1.17.5", - "@inrupt/universal-fetch": "^1.0.2", + "@inrupt/oidc-client-ext": "^3.1.0", + "@inrupt/solid-client-authn-core": "^3.1.0", "events": "^3.3.0", - "jose": "^4.15.4", - "uuid": "^9.0.1" + "jose": "^5.1.3", + "uuid": "^11.1.0" } }, "node_modules/@inrupt/solid-client-authn-core": { - "version": "1.17.5", - "resolved": "https://registry.npmjs.org/@inrupt/solid-client-authn-core/-/solid-client-authn-core-1.17.5.tgz", - "integrity": "sha512-g3WShcPAqGuarPYlw12vUCo+et4elQLI+WYcHkCHGLuQQFF73r2iTicuKpkydQdIrZ5AZgxhwr315jmkx/vcFQ==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@inrupt/solid-client-authn-core/-/solid-client-authn-core-3.1.0.tgz", + "integrity": "sha512-aoG8RvPBmYXTSqy2uJogpoVGPKsydC4mXNdm63BWCEMZ2QyaSRBjx4R4N6n5N2uy/aoib678Y7U3UtDCLDoFsQ==", "license": "MIT", "dependencies": { - "@inrupt/universal-fetch": "^1.0.1", "events": "^3.3.0", - "jose": "^4.15.4", - "uuid": "^9.0.1" + "jose": "^5.1.3", + "uuid": "^11.1.0" }, "engines": { - "node": "^16.0.0 || ^18.0.0 || ^20.0.0" - } - }, - "node_modules/@inrupt/universal-fetch": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@inrupt/universal-fetch/-/universal-fetch-1.0.3.tgz", - "integrity": "sha512-AP/nMOuuKvR2YoQkdS77ntuuq5ZYDGStI8Uirp1MCsyPSoBLyNnRjMLjlGqIlaC+5Xp7TYZJ9z/Kl2uUEpXUFw==", - "license": "MIT", - "dependencies": { - "node-fetch": "^2.6.7", - "undici": "^5.19.1" - }, - "engines": { - "node": "^14.17.0 || ^16.0.0 || ^18.0.0 || ^20.0.0" + "node": "^20.0.0 || ^22.0.0" } }, "node_modules/@isaacs/cliui": { @@ -4418,9 +4402,9 @@ "license": "MIT" }, "node_modules/core-js": { - "version": "3.44.0", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.44.0.tgz", - "integrity": "sha512-aFCtd4l6GvAXwVEh3XbbVqJGHDJt0OZRa+5ePGx3LLwi12WfexqQxcsohb2wgsa/92xtl19Hd66G/L+TaAxDMw==", + "version": "3.45.1", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.45.1.tgz", + "integrity": "sha512-L4NPsJlCfZsPeXukyzHFlg/i7IIVwHSItR0wg0FLNqYClJ4MQYTYLbC7EkjKYRLZF2iof2MUgN0EGy7MdQFChg==", "hasInstallScript": true, "license": "MIT", "funding": { @@ -6367,9 +6351,9 @@ } }, "node_modules/jose": { - "version": "4.15.9", - "resolved": "https://registry.npmjs.org/jose/-/jose-4.15.9.tgz", - "integrity": "sha512-1vUQX+IdDMVPj4k8kOxgUqlcK518yluMuGZwqlr44FS1ppZB/5GWh4rZG89erpOBOJjU/OBsnCVFfapsRz6nEA==", + "version": "5.10.0", + "resolved": "https://registry.npmjs.org/jose/-/jose-5.10.0.tgz", + "integrity": "sha512-s+3Al/p9g32Iq+oqXxkW//7jk2Vig6FF1CFqzVXoTUXt2qz89YWbL+OwS17NFYEvxC35n0FKeGO2LGYSxeM2Gg==", "license": "MIT", "funding": { "url": "https://github.com/sponsors/panva" @@ -8744,16 +8728,16 @@ } }, "node_modules/uuid": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", - "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.1.0.tgz", + "integrity": "sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==", "funding": [ "https://github.com/sponsors/broofa", "https://github.com/sponsors/ctavan" ], "license": "MIT", "bin": { - "uuid": "dist/bin/uuid" + "uuid": "dist/esm/bin/uuid" } }, "node_modules/v8-to-istanbul": { diff --git a/package.json b/package.json index 375673f..b611358 100644 --- a/package.json +++ b/package.json @@ -25,9 +25,9 @@ }, "homepage": "https://github.com/solidos/solid-logic#readme", "devDependencies": { + "@babel/plugin-transform-async-to-generator": "^7.27.1", "@babel/plugin-transform-class-properties": "^7.27.1", "@babel/plugin-transform-optional-chaining": "^7.27.1", - "@babel/plugin-transform-async-to-generator": "^7.27.1", "@babel/plugin-transform-runtime": "^7.28.0", "@babel/preset-env": "^7.28.0", "@babel/preset-typescript": "^7.27.1", @@ -42,7 +42,7 @@ "typescript": "^5.7.3" }, "dependencies": { - "@inrupt/solid-client-authn-browser": "1.17", + "@inrupt/solid-client-authn-browser": "^3.1.0", "lint-staged": "^15.4.3", "rdflib": "^2.2.37", "solid-namespace": "^0.5.4" diff --git a/src/authSession/authSession.ts b/src/authSession/authSession.ts index 1859ed0..a125a97 100644 --- a/src/authSession/authSession.ts +++ b/src/authSession/authSession.ts @@ -1,13 +1,7 @@ import { Session, - getClientAuthenticationWithDependencies } from '@inrupt/solid-client-authn-browser' -export const authSession = new Session( - { - clientAuthentication: getClientAuthenticationWithDependencies({}) - }, - 'mySession' - ) +export const authSession = new Session() \ No newline at end of file diff --git a/src/authn/SolidAuthnLogic.ts b/src/authn/SolidAuthnLogic.ts index 0bba289..cdffdf8 100644 --- a/src/authn/SolidAuthnLogic.ts +++ b/src/authn/SolidAuthnLogic.ts @@ -1,7 +1,7 @@ import { namedNode, NamedNode, sym } from "rdflib"; import { appContext, offlineTestID } from "./authUtil"; import * as debug from '../util/debug' -import { Session } from "@inrupt/solid-client-authn-browser"; +import { EVENTS, Session } from "@inrupt/solid-client-authn-browser"; import { AuthenticationContext, AuthnLogic } from "../types"; export class SolidAuthnLogic implements AuthnLogic { @@ -40,7 +40,8 @@ export class SolidAuthnLogic implements AuthnLogic { if (preLoginRedirectHash) { window.localStorage.setItem('preLoginRedirectHash', preLoginRedirectHash) } - this.session.onSessionRestore((url) => { + this.session.events.on(EVENTS.SESSION_RESTORED, (url) => { + console.log(`Session restored to ${url}`) if (document.location.toString() !== url) history.replaceState(null, '', url) }) From c8d34ed5640f8bff8e0f9f59e1a59d3440e831e8 Mon Sep 17 00:00:00 2001 From: Timea <4144203+timea-solid@users.noreply.github.com> Date: Tue, 26 Aug 2025 16:05:16 +0200 Subject: [PATCH 2/2] Update src/authn/SolidAuthnLogic.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/authn/SolidAuthnLogic.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/authn/SolidAuthnLogic.ts b/src/authn/SolidAuthnLogic.ts index cdffdf8..efc712a 100644 --- a/src/authn/SolidAuthnLogic.ts +++ b/src/authn/SolidAuthnLogic.ts @@ -41,7 +41,7 @@ export class SolidAuthnLogic implements AuthnLogic { window.localStorage.setItem('preLoginRedirectHash', preLoginRedirectHash) } this.session.events.on(EVENTS.SESSION_RESTORED, (url) => { - console.log(`Session restored to ${url}`) + debug.log(`Session restored to ${url}`) if (document.location.toString() !== url) history.replaceState(null, '', url) })