diff --git a/package.json b/package.json index b4abab0891..1df34a634a 100644 --- a/package.json +++ b/package.json @@ -97,7 +97,7 @@ }, "patchedDependencies": { "bull@4.12.1": "patches/bull@4.12.1.patch", - "pkce-challenge@3.0.0": "patches/pkce-challenge@3.0.0.patch", + "pkce-challenge@5.0.0": "patches/pkce-challenge@5.0.0.patch", "pyodide@0.23.4": "patches/pyodide@0.23.4.patch", "@types/express-serve-static-core@5.0.6": "patches/@types__express-serve-static-core@5.0.6.patch", "@types/ws@8.5.4": "patches/@types__ws@8.5.4.patch", diff --git a/packages/cli/package.json b/packages/cli/package.json index d2ad2443d9..60d08f5f3f 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -150,7 +150,7 @@ "p-lazy": "3.1.0", "pg": "8.12.0", "picocolors": "catalog:", - "pkce-challenge": "3.0.0", + "pkce-challenge": "5.0.0", "posthog-node": "3.2.1", "prom-client": "15.1.3", "psl": "1.9.0", diff --git a/packages/cli/src/controllers/oauth/oauth2-credential.controller.ts b/packages/cli/src/controllers/oauth/oauth2-credential.controller.ts index 16dc939b14..1a4fa1254c 100644 --- a/packages/cli/src/controllers/oauth/oauth2-credential.controller.ts +++ b/packages/cli/src/controllers/oauth/oauth2-credential.controller.ts @@ -62,7 +62,7 @@ export class OAuth2CredentialController extends AbstractOAuthController { const toUpdate: ICredentialDataDecryptedObject = { csrfSecret }; if (oauthCredentials.grantType === 'pkce') { - const { code_verifier, code_challenge } = pkceChallenge(); + const { code_verifier, code_challenge } = await pkceChallenge(); oAuthOptions.query = { ...oAuthOptions.query, code_challenge, diff --git a/patches/pkce-challenge@3.0.0.patch b/patches/pkce-challenge@3.0.0.patch deleted file mode 100644 index f3d9159ee9..0000000000 --- a/patches/pkce-challenge@3.0.0.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/dist/main.js b/dist/main.js -index 86be84f44210b26583e0a7f1732acd8b98a5e701..a2b05be6a45355704fedf43b51a34793580eaf6c 100644 ---- a/dist/main.js -+++ b/dist/main.js -@@ -42,7 +42,7 @@ $parcel$export(module.exports, "verifyChallenge", () => $f5bfd4ce37214f4f$export - * @param size The desired length of the string - * @returns The random string - */ function $f5bfd4ce37214f4f$var$random(size) { -- const mask = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~"; -+ const mask = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._"; - let result = ""; - const randomUints = $f5bfd4ce37214f4f$var$getRandomValues(size); - for(let i = 0; i < size; i++){ \ No newline at end of file diff --git a/patches/pkce-challenge@5.0.0.patch b/patches/pkce-challenge@5.0.0.patch new file mode 100644 index 0000000000..e4d4c1631e --- /dev/null +++ b/patches/pkce-challenge@5.0.0.patch @@ -0,0 +1,25 @@ +diff --git a/dist/index.node.js b/dist/index.node.js +index 9a56dcef7f312d2061975dc496281b1673a229c4..8b86b4a7f07656d6711e54cb699d0dc79b08a8d3 100644 +--- a/dist/index.node.js ++++ b/dist/index.node.js +@@ -16,7 +16,7 @@ async function getRandomValues(size) { + * @returns The random string + */ + async function random(size) { +- const mask = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~"; ++ const mask = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._"; + let result = ""; + const randomUints = await getRandomValues(size); + for (let i = 0; i < size; i++) { +diff --git a/package.json b/package.json +index a51ede0564b61a237e35e8c5e718251c666ccaa5..9a015872b2f8f45dc5306843599304ef9a3a83c1 100644 +--- a/package.json ++++ b/package.json +@@ -4,6 +4,7 @@ + "description": "Generate or verify a Proof Key for Code Exchange (PKCE) challenge pair", + "browser": "dist/index.browser.js", + "type": "module", ++ "types": "./dist/index.node.d.ts", + "exports": { + ".": { + "types": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0aa0047727..a5ff1a8880 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -170,9 +170,9 @@ patchedDependencies: eslint-plugin-n8n-local-rules: hash: e0fd59254ab02473c6940fa25fcc8102ebc7d371c015ec53333a43f48af33cc2 path: patches/eslint-plugin-n8n-local-rules.patch - pkce-challenge@3.0.0: - hash: 4fa087c659ab74f146b6e9ff6ecee9f497d1d8a57d5a2bbb9c0c7a0356b3c33b - path: patches/pkce-challenge@3.0.0.patch + pkce-challenge@5.0.0: + hash: 651e785d0b7bbf5be9210e1e895c39a16dc3ce8a5a3843b4819565fb6e175b90 + path: patches/pkce-challenge@5.0.0.patch pyodide@0.23.4: hash: c1002dacf7f6d0827d23aaf6cf2845e1b0c351339306c4ad660b8cd72077976c path: patches/pyodide@0.23.4.patch @@ -1080,8 +1080,8 @@ importers: specifier: 'catalog:' version: 1.0.1 pkce-challenge: - specifier: 3.0.0 - version: 3.0.0(patch_hash=4fa087c659ab74f146b6e9ff6ecee9f497d1d8a57d5a2bbb9c0c7a0356b3c33b) + specifier: 5.0.0 + version: 5.0.0(patch_hash=651e785d0b7bbf5be9210e1e895c39a16dc3ce8a5a3843b4819565fb6e175b90) posthog-node: specifier: 3.2.1 version: 3.2.1 @@ -11422,8 +11422,9 @@ packages: resolution: {integrity: sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==} engines: {node: '>= 6'} - pkce-challenge@3.0.0: - resolution: {integrity: sha512-sQ8sJJJuLhA5pFnoxayMCrFnBMNj7DDpa+TWxOXl4B24oXHlVSADi/3Bowm66QuzWkBuF6DhmaelCdlC2JKwsg==} + pkce-challenge@5.0.0: + resolution: {integrity: sha512-ueGLflrrnvwB3xuo/uGob5pd5FN7l0MsLf0Z87o/UQmRtwjvfylfc9MurIxRAWywCYTgrvpXBcqjV4OfCYGCIQ==} + engines: {node: '>=16.20.0'} pkg-dir@4.2.0: resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} @@ -25493,9 +25494,7 @@ snapshots: pirates@4.0.6: {} - pkce-challenge@3.0.0(patch_hash=4fa087c659ab74f146b6e9ff6ecee9f497d1d8a57d5a2bbb9c0c7a0356b3c33b): - dependencies: - crypto-js: 4.2.0 + pkce-challenge@5.0.0(patch_hash=651e785d0b7bbf5be9210e1e895c39a16dc3ce8a5a3843b4819565fb6e175b90): {} pkg-dir@4.2.0: dependencies: