From 38b26e2a816fde9758c322c63630565c504cc883 Mon Sep 17 00:00:00 2001 From: Amit Singh Date: Mon, 4 May 2026 12:02:35 +0530 Subject: [PATCH] fix: update uuid dependency to version 14.0.0 and refactor import in client authentication --- package.json | 2 +- src/auth/client-authentication.ts | 2 +- .../tests/unit/management-client-custom-domain.test.ts | 4 ---- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 912154fdf6..a8cfb1fa8b 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "validate": "yarn lint:check && yarn format --check && yarn build && yarn test && yarn lint:package" }, "dependencies": { - "uuid": "^11.1.0", + "uuid": "^14.0.0", "jose": "^4.13.2", "auth0-legacy": "npm:auth0@^4.27.0" }, diff --git a/src/auth/client-authentication.ts b/src/auth/client-authentication.ts index b4b753d694..62fcfb0431 100644 --- a/src/auth/client-authentication.ts +++ b/src/auth/client-authentication.ts @@ -1,5 +1,4 @@ import * as jose from "jose"; -import { v4 as uuid } from "uuid"; export interface AddClientAuthenticationPayload { client_id?: string; @@ -41,6 +40,7 @@ export const addClientAuthentication = async ({ if (clientAssertionSigningKey && !payload.client_assertion) { const alg = clientAssertionSigningAlg || "RS256"; const privateKey = await jose.importPKCS8(clientAssertionSigningKey, alg); + const { v4: uuid } = await import("uuid"); payload.client_assertion = await new jose.SignJWT({}) .setProtectedHeader({ alg }) diff --git a/src/management/tests/unit/management-client-custom-domain.test.ts b/src/management/tests/unit/management-client-custom-domain.test.ts index 56671a8219..d56b6dfe6d 100644 --- a/src/management/tests/unit/management-client-custom-domain.test.ts +++ b/src/management/tests/unit/management-client-custom-domain.test.ts @@ -23,10 +23,6 @@ jest.mock("jose", () => ({ }, })); -jest.mock("uuid", () => ({ - v4: jest.fn(() => "test-uuid"), -})); - // Mock the core fetcher to avoid actual HTTP calls jest.mock("../../core/index.js", () => { const actual = jest.requireActual("../../core/index.js");