From 19f9ef7882c21a9506a751ae5a2c0444cb78a917 Mon Sep 17 00:00:00 2001 From: Joachim Van Herwegen Date: Mon, 8 Jan 2024 11:03:57 +0100 Subject: [PATCH] chore: Update @inrupt/solid-client-authn to v2.0.0 --- .../markdown/usage/client-credentials.md | 3 +- package-lock.json | 164 ++++++++---------- package.json | 4 +- test/integration/Identity.test.ts | 2 +- 4 files changed, 73 insertions(+), 100 deletions(-) diff --git a/documentation/markdown/usage/client-credentials.md b/documentation/markdown/usage/client-credentials.md index e2b9f5537..fc76c64ce 100644 --- a/documentation/markdown/usage/client-credentials.md +++ b/documentation/markdown/usage/client-credentials.md @@ -100,11 +100,10 @@ Once you have an Access token, you can use it for authenticated requests until i ```ts import { buildAuthenticatedFetch } from '@inrupt/solid-client-authn-core'; -import fetch from 'node-fetch'; // The DPoP key needs to be the same key as the one used in the previous step. // The Access token is the one generated in the previous step. -const authFetch = await buildAuthenticatedFetch(fetch, accessToken, { dpopKey }); +const authFetch = await buildAuthenticatedFetch(accessToken, { dpopKey }); // authFetch can now be used as a standard fetch function that will authenticate as your WebID. // This request will do a simple GET for example. const response = await authFetch('http://localhost:3000/private'); diff --git a/package-lock.json b/package-lock.json index 88f548546..987f9a9ec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -85,8 +85,8 @@ "@antfu/eslint-config": "2.3.4", "@commitlint/cli": "^17.7.2", "@commitlint/config-conventional": "^17.7.0", - "@inrupt/solid-client-authn-core": "^1.17.3", - "@inrupt/solid-client-authn-node": "^1.17.3", + "@inrupt/solid-client-authn-core": "^2.0.0", + "@inrupt/solid-client-authn-node": "^2.0.0", "@tsconfig/node18": "^18.2.2", "@types/jest": "^29.5.5", "@types/set-cookie-parser": "^2.4.4", @@ -4209,15 +4209,6 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "node_modules/@fastify/busboy": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.0.0.tgz", - "integrity": "sha512-JUFJad5lv7jxj926GPgymrWQxxjPYuJNiNjNMzqT+HiuP6Vl3dk5xzG+8sTX96np0ZAluvaMzPsjhHZ5rNuNQQ==", - "dev": true, - "engines": { - "node": ">=14" - } - }, "node_modules/@humanwhocodes/config-array": { "version": "0.11.13", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.13.tgz", @@ -4264,44 +4255,50 @@ } }, "node_modules/@inrupt/solid-client-authn-core": { - "version": "1.17.3", - "resolved": "https://registry.npmjs.org/@inrupt/solid-client-authn-core/-/solid-client-authn-core-1.17.3.tgz", - "integrity": "sha512-UuHLFChd+0155EwYgdQJN6mP7fpnT4UFnWZT0+gDAbudUkUI0dKp6HKisWkJAK+KY1wDZ5HCQmCKBpjtiPXuyA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@inrupt/solid-client-authn-core/-/solid-client-authn-core-2.0.0.tgz", + "integrity": "sha512-qM+E9I5u2DFlsfyoXossx8w0vKv8p+rXH98K9RUauJImpygQ3I3Ra6hSB2bwA1PdPQd5ttNg236oKe1sTT6Hqw==", "dev": true, "dependencies": { - "@inrupt/universal-fetch": "^1.0.1", "events": "^3.3.0", - "jose": "^4.14.6", + "jose": "^5.1.3", "uuid": "^9.0.1" }, "engines": { - "node": "^16.0.0 || ^18.0.0 || ^20.0.0" + "node": "^18.0.0 || ^20.0.0" + } + }, + "node_modules/@inrupt/solid-client-authn-core/node_modules/jose": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/jose/-/jose-5.2.0.tgz", + "integrity": "sha512-oW3PCnvyrcm1HMvGTzqjxxfnEs9EoFOFWi2HsEGhlFVOXxTE3K9GKWVMFoFw06yPUqwpvEWic1BmtUZBI/tIjw==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/panva" } }, "node_modules/@inrupt/solid-client-authn-node": { - "version": "1.17.3", - "resolved": "https://registry.npmjs.org/@inrupt/solid-client-authn-node/-/solid-client-authn-node-1.17.3.tgz", - "integrity": "sha512-3lmSh7VNBUVFlBQZBQAtqyVz2B0bRTP8Zm4mkIxG519b2oJwLQtttP/cqQU1WutqADjLLB7Xx4zQTnf2E7yZkw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@inrupt/solid-client-authn-node/-/solid-client-authn-node-2.0.0.tgz", + "integrity": "sha512-S1vGRodX0MSAKR3B6tm4qUvMhGv0sMcFjYyhVil7isoRI/7ei5QTpm+081RTWe6/cv4WI6UiHER3YIG15uwhhg==", "dev": true, "dependencies": { - "@inrupt/solid-client-authn-core": "^1.17.3", - "@inrupt/universal-fetch": "^1.0.1", - "jose": "^4.14.6", - "openid-client": "~5.5.0", + "@inrupt/solid-client-authn-core": "^2.0.0", + "jose": "^5.1.3", + "openid-client": "~5.6.1", "uuid": "^9.0.1" }, "engines": { - "node": "^16.0.0 || ^18.0.0 || ^20.0.0" + "node": "^18.0.0 || ^20.0.0" } }, - "node_modules/@inrupt/universal-fetch": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@inrupt/universal-fetch/-/universal-fetch-1.0.1.tgz", - "integrity": "sha512-oqbG7jS1fa6hVkjSir+u5Ab3eSbyxFyOjsgjDICL27mAd5z8oImTSETnY2hYbkRaJQYKMBOXhtm7L5/+EbeVJg==", + "node_modules/@inrupt/solid-client-authn-node/node_modules/jose": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/jose/-/jose-5.2.0.tgz", + "integrity": "sha512-oW3PCnvyrcm1HMvGTzqjxxfnEs9EoFOFWi2HsEGhlFVOXxTE3K9GKWVMFoFw06yPUqwpvEWic1BmtUZBI/tIjw==", "dev": true, - "dependencies": { - "node-fetch": "^2.6.7", - "undici": "^5.19.1" + "funding": { + "url": "https://github.com/sponsors/panva" } }, "node_modules/@ioredis/commands": { @@ -11742,9 +11739,9 @@ } }, "node_modules/jose": { - "version": "4.15.2", - "resolved": "https://registry.npmjs.org/jose/-/jose-4.15.2.tgz", - "integrity": "sha512-IY73F228OXRl9ar3jJagh7Vnuhj/GzBunPiZP13K0lOl7Am9SoWW3kEzq3MCllJMTtZqHTiDXQvoRd4U95aU6A==", + "version": "4.15.4", + "resolved": "https://registry.npmjs.org/jose/-/jose-4.15.4.tgz", + "integrity": "sha512-W+oqK4H+r5sITxfxpSU+MMdr/YSWGvgZMQDIsNoBDGGy4i7GBPTtvFKibQzW06n3U3TqHjhvBJsirShsEJ6eeQ==", "funding": { "url": "https://github.com/sponsors/panva" } @@ -13278,12 +13275,12 @@ } }, "node_modules/openid-client": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/openid-client/-/openid-client-5.5.0.tgz", - "integrity": "sha512-Y7Xl8BgsrkzWLHkVDYuroM67hi96xITyEDSkmWaGUiNX6CkcXC3XyQGdv5aWZ6dukVKBFVQCADi9gCavOmU14w==", + "version": "5.6.4", + "resolved": "https://registry.npmjs.org/openid-client/-/openid-client-5.6.4.tgz", + "integrity": "sha512-T1h3B10BRPKfcObdBklX639tVz+xh34O7GjofqrqiAQdm7eHsQ00ih18x6wuJ/E6FxdtS2u3FmUGPDeEcMwzNA==", "dev": true, "dependencies": { - "jose": "^4.14.4", + "jose": "^4.15.4", "lru-cache": "^6.0.0", "object-hash": "^2.2.0", "oidc-token-hash": "^5.0.3" @@ -15444,18 +15441,6 @@ "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", "dev": true }, - "node_modules/undici": { - "version": "5.26.3", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.26.3.tgz", - "integrity": "sha512-H7n2zmKEWgOllKkIUkLvFmsJQj062lSm3uA4EYApG8gLuiOM0/go9bIoC3HVaSnfg4xunowDE2i9p8drkXuvDw==", - "dev": true, - "dependencies": { - "@fastify/busboy": "^2.0.0" - }, - "engines": { - "node": ">=14.0" - } - }, "node_modules/unist-util-stringify-position": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-2.0.3.tgz", @@ -19583,12 +19568,6 @@ "dev": true, "peer": true }, - "@fastify/busboy": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.0.0.tgz", - "integrity": "sha512-JUFJad5lv7jxj926GPgymrWQxxjPYuJNiNjNMzqT+HiuP6Vl3dk5xzG+8sTX96np0ZAluvaMzPsjhHZ5rNuNQQ==", - "dev": true - }, "@humanwhocodes/config-array": { "version": "0.11.13", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.13.tgz", @@ -19622,38 +19601,42 @@ "dev": true }, "@inrupt/solid-client-authn-core": { - "version": "1.17.3", - "resolved": "https://registry.npmjs.org/@inrupt/solid-client-authn-core/-/solid-client-authn-core-1.17.3.tgz", - "integrity": "sha512-UuHLFChd+0155EwYgdQJN6mP7fpnT4UFnWZT0+gDAbudUkUI0dKp6HKisWkJAK+KY1wDZ5HCQmCKBpjtiPXuyA==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@inrupt/solid-client-authn-core/-/solid-client-authn-core-2.0.0.tgz", + "integrity": "sha512-qM+E9I5u2DFlsfyoXossx8w0vKv8p+rXH98K9RUauJImpygQ3I3Ra6hSB2bwA1PdPQd5ttNg236oKe1sTT6Hqw==", "dev": true, "requires": { - "@inrupt/universal-fetch": "^1.0.1", "events": "^3.3.0", - "jose": "^4.14.6", + "jose": "^5.1.3", "uuid": "^9.0.1" + }, + "dependencies": { + "jose": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/jose/-/jose-5.2.0.tgz", + "integrity": "sha512-oW3PCnvyrcm1HMvGTzqjxxfnEs9EoFOFWi2HsEGhlFVOXxTE3K9GKWVMFoFw06yPUqwpvEWic1BmtUZBI/tIjw==", + "dev": true + } } }, "@inrupt/solid-client-authn-node": { - "version": "1.17.3", - "resolved": "https://registry.npmjs.org/@inrupt/solid-client-authn-node/-/solid-client-authn-node-1.17.3.tgz", - "integrity": "sha512-3lmSh7VNBUVFlBQZBQAtqyVz2B0bRTP8Zm4mkIxG519b2oJwLQtttP/cqQU1WutqADjLLB7Xx4zQTnf2E7yZkw==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@inrupt/solid-client-authn-node/-/solid-client-authn-node-2.0.0.tgz", + "integrity": "sha512-S1vGRodX0MSAKR3B6tm4qUvMhGv0sMcFjYyhVil7isoRI/7ei5QTpm+081RTWe6/cv4WI6UiHER3YIG15uwhhg==", "dev": true, "requires": { - "@inrupt/solid-client-authn-core": "^1.17.3", - "@inrupt/universal-fetch": "^1.0.1", - "jose": "^4.14.6", - "openid-client": "~5.5.0", + "@inrupt/solid-client-authn-core": "^2.0.0", + "jose": "^5.1.3", + "openid-client": "~5.6.1", "uuid": "^9.0.1" - } - }, - "@inrupt/universal-fetch": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@inrupt/universal-fetch/-/universal-fetch-1.0.1.tgz", - "integrity": "sha512-oqbG7jS1fa6hVkjSir+u5Ab3eSbyxFyOjsgjDICL27mAd5z8oImTSETnY2hYbkRaJQYKMBOXhtm7L5/+EbeVJg==", - "dev": true, - "requires": { - "node-fetch": "^2.6.7", - "undici": "^5.19.1" + }, + "dependencies": { + "jose": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/jose/-/jose-5.2.0.tgz", + "integrity": "sha512-oW3PCnvyrcm1HMvGTzqjxxfnEs9EoFOFWi2HsEGhlFVOXxTE3K9GKWVMFoFw06yPUqwpvEWic1BmtUZBI/tIjw==", + "dev": true + } } }, "@ioredis/commands": { @@ -25180,9 +25163,9 @@ } }, "jose": { - "version": "4.15.2", - "resolved": "https://registry.npmjs.org/jose/-/jose-4.15.2.tgz", - "integrity": "sha512-IY73F228OXRl9ar3jJagh7Vnuhj/GzBunPiZP13K0lOl7Am9SoWW3kEzq3MCllJMTtZqHTiDXQvoRd4U95aU6A==" + "version": "4.15.4", + "resolved": "https://registry.npmjs.org/jose/-/jose-4.15.4.tgz", + "integrity": "sha512-W+oqK4H+r5sITxfxpSU+MMdr/YSWGvgZMQDIsNoBDGGy4i7GBPTtvFKibQzW06n3U3TqHjhvBJsirShsEJ6eeQ==" }, "js-tokens": { "version": "4.0.0", @@ -26377,12 +26360,12 @@ "dev": true }, "openid-client": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/openid-client/-/openid-client-5.5.0.tgz", - "integrity": "sha512-Y7Xl8BgsrkzWLHkVDYuroM67hi96xITyEDSkmWaGUiNX6CkcXC3XyQGdv5aWZ6dukVKBFVQCADi9gCavOmU14w==", + "version": "5.6.4", + "resolved": "https://registry.npmjs.org/openid-client/-/openid-client-5.6.4.tgz", + "integrity": "sha512-T1h3B10BRPKfcObdBklX639tVz+xh34O7GjofqrqiAQdm7eHsQ00ih18x6wuJ/E6FxdtS2u3FmUGPDeEcMwzNA==", "dev": true, "requires": { - "jose": "^4.14.4", + "jose": "^4.15.4", "lru-cache": "^6.0.0", "object-hash": "^2.2.0", "oidc-token-hash": "^5.0.3" @@ -28047,15 +28030,6 @@ "integrity": "sha512-WxONCrssBM8TSPRqN5EmsjVrsv4A8X12J4ArBiiayv3DyyG3ZlIg6yysuuSYdZsVz3TKcTg2fd//Ujd4CHV1iA==", "dev": true }, - "undici": { - "version": "5.26.3", - "resolved": "https://registry.npmjs.org/undici/-/undici-5.26.3.tgz", - "integrity": "sha512-H7n2zmKEWgOllKkIUkLvFmsJQj062lSm3uA4EYApG8gLuiOM0/go9bIoC3HVaSnfg4xunowDE2i9p8drkXuvDw==", - "dev": true, - "requires": { - "@fastify/busboy": "^2.0.0" - } - }, "unist-util-stringify-position": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-2.0.3.tgz", diff --git a/package.json b/package.json index bf18ea976..dbd0fe120 100644 --- a/package.json +++ b/package.json @@ -146,8 +146,8 @@ "@antfu/eslint-config": "2.3.4", "@commitlint/cli": "^17.7.2", "@commitlint/config-conventional": "^17.7.0", - "@inrupt/solid-client-authn-core": "^1.17.3", - "@inrupt/solid-client-authn-node": "^1.17.3", + "@inrupt/solid-client-authn-core": "^2.0.0", + "@inrupt/solid-client-authn-node": "^2.0.0", "@tsconfig/node18": "^18.2.2", "@types/jest": "^29.5.5", "@types/set-cookie-parser": "^2.4.4", diff --git a/test/integration/Identity.test.ts b/test/integration/Identity.test.ts index b0f25a5f0..8fd6bbb99 100644 --- a/test/integration/Identity.test.ts +++ b/test/integration/Identity.test.ts @@ -392,7 +392,7 @@ describe.each(stores)('A Solid server with IDP using %s', (name, { config, teard }); it('can use the generated access token to do an authenticated call.', async(): Promise => { - const authFetch = await buildAuthenticatedFetch(fetch, accessToken!, { dpopKey }); + const authFetch = await buildAuthenticatedFetch(accessToken!, { dpopKey }); let res = await fetch(container); expect(res.status).toBe(401); res = await authFetch(container);