From 34e553662a001f0449c20b82b7eb227cdfc32575 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 7 Oct 2026 11:38:06 +0000 Subject: [PATCH 1/2] build(deps): bump ibm-cloud-sdk-core from 5.6.3 to 5.8.0 Bumps [ibm-cloud-sdk-core](https://github.com/IBM/node-sdk-core) from 5.6.3 to 5.8.0. - [Release notes](https://github.com/IBM/node-sdk-core/releases) - [Changelog](https://github.com/IBM/node-sdk-core/blob/main/CHANGELOG.md) - [Commits](https://github.com/IBM/node-sdk-core/compare/v5.6.3...v5.8.0) --- updated-dependencies: - dependency-name: ibm-cloud-sdk-core dependency-version: 5.8.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 49 +++++++++++++++++++++++++++++++++++++++-------- package.json | 2 +- 2 files changed, 42 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0d2bc964a..ec925110c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "Apache-2.0", "dependencies": { "@types/node": "22.20.5", - "ibm-cloud-sdk-core": "5.6.3" + "ibm-cloud-sdk-core": "5.8.0" }, "devDependencies": { "@eslint/js": "9.39.5", @@ -3312,7 +3312,8 @@ "node_modules/@types/tough-cookie": { "version": "4.0.5", "integrity": "sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@types/unist": { "version": "3.0.3", @@ -6167,13 +6168,12 @@ } }, "node_modules/ibm-cloud-sdk-core": { - "version": "5.6.3", - "integrity": "sha512-VtGZ2k/3zy+hVxQxfG/GZcn5mAu4tUnx4pKoLTCwRcNMjtooJ9pDaqE++oBNK43/xLXBEeFx2C/QHkgu96p9qQ==", + "version": "5.8.0", + "integrity": "sha512-ZqziN3Fyd+pNiDcfod0Uxb7s/15phefvQgRoMRMjgfIoALoJT/8zfE/TYhaDvyliEHrdYcL/4HUpy+5n2O18Ww==", "license": "Apache-2.0", "dependencies": { "@types/debug": "4.1.13", "@types/node": "18.19.130", - "@types/tough-cookie": "4.0.5", "axios": "1.20.0", "camelcase": "6.3.0", "debug": "4.4.3", @@ -6186,7 +6186,7 @@ "load-esm": "1.0.3", "mime-types": "2.1.35", "retry-axios": "2.6.0", - "tough-cookie": "4.1.4" + "tough-cookie": "6.0.2" }, "engines": { "node": ">=20" @@ -6211,6 +6211,17 @@ "url": "https://dotenvx.com" } }, + "node_modules/ibm-cloud-sdk-core/node_modules/tough-cookie": { + "version": "6.0.2", + "integrity": "sha512-exgYmnmL/sJpR3upZfXG5PoatXQii55xAiXGXzY+sROLZ/Y+SLcp9PgJNI9Vz37HpQ74WvDcLT8eqm+kV3FzrA==", + "license": "BSD-3-Clause", + "dependencies": { + "tldts": "^7.0.5" + }, + "engines": { + "node": ">=16" + } + }, "node_modules/ibm-cloud-sdk-core/node_modules/undici-types": { "version": "5.26.5", "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", @@ -10241,6 +10252,7 @@ "version": "1.15.0", "integrity": "sha512-JZd3gMVBAVQkSs6HdNZo9Sdo0LNcQeMNP3CozBJb3JYC/QUYZTnKxP+f8oWRX4rHP5EurWxqAHTSwUCjlNKa1w==", "license": "MIT", + "peer": true, "dependencies": { "punycode": "^2.3.1" }, @@ -10284,7 +10296,8 @@ "node_modules/querystringify": { "version": "2.2.0", "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/react-is": { "version": "18.3.1", @@ -10360,7 +10373,8 @@ "node_modules/requires-port": { "version": "1.0.0", "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/reserved-identifiers": { "version": "1.2.0", @@ -11084,6 +11098,22 @@ "url": "https://github.com/sponsors/SuperchupuDev" } }, + "node_modules/tldts": { + "version": "7.4.16", + "integrity": "sha512-QwBER5KMR86IIjpIiO7H/Z3IMJPsZ1A6RKPAqzTTgOyUQUSt9FdnKcqhTaJmkY6HVrgouZHZR0ncK5QxvmnQeg==", + "license": "MIT", + "dependencies": { + "tldts-core": "^7.4.16" + }, + "bin": { + "tldts": "bin/cli.js" + } + }, + "node_modules/tldts-core": { + "version": "7.4.16", + "integrity": "sha512-MDolfaSJtlSK5Y0A1xl3277ekubZwobpBjugknDizI9O5Rm60a1m8k4ICK+MRsCDzPygT81mp3BBf5RKDlFRfA==", + "license": "MIT" + }, "node_modules/to-regex-range": { "version": "5.0.1", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", @@ -11133,6 +11163,7 @@ "version": "4.1.4", "integrity": "sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag==", "license": "BSD-3-Clause", + "peer": true, "dependencies": { "psl": "^1.1.33", "punycode": "^2.1.1", @@ -11459,6 +11490,7 @@ "version": "0.2.0", "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", "license": "MIT", + "peer": true, "engines": { "node": ">= 4.0.0" } @@ -11543,6 +11575,7 @@ "version": "1.5.10", "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", "license": "MIT", + "peer": true, "dependencies": { "querystringify": "^2.1.1", "requires-port": "^1.0.0" diff --git a/package.json b/package.json index 0d4a6d43e..dd391488a 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ }, "dependencies": { "@types/node": "22.20.5", - "ibm-cloud-sdk-core": "5.6.3" + "ibm-cloud-sdk-core": "5.8.0" }, "devDependencies": { "@eslint/js": "9.39.5", From 179dc5a1572ed11b165327ed00fb0d608b60c1fe Mon Sep 17 00:00:00 2001 From: Veronika Al Raheem Date: Thu, 8 Oct 2026 18:43:53 +0200 Subject: [PATCH 2/2] fix: upgrade tsconfig module to node20 and add tough-cookie path resolution --- auth/couchdbSessionAuthenticator.ts | 57 ---------------------- package-lock.json | 76 +++-------------------------- package.json | 3 +- tsconfig.json | 7 ++- 4 files changed, 12 insertions(+), 131 deletions(-) diff --git a/auth/couchdbSessionAuthenticator.ts b/auth/couchdbSessionAuthenticator.ts index 2ac424aca..301a31347 100644 --- a/auth/couchdbSessionAuthenticator.ts +++ b/auth/couchdbSessionAuthenticator.ts @@ -15,21 +15,11 @@ */ import { Authenticator, UserOptions, validateInput } from 'ibm-cloud-sdk-core'; -import { Cookie, CookieJar, Store } from 'tough-cookie'; import { SessionTokenManager, SessionTokenManagerOptions, } from './sessionTokenManager'; -interface SessionCookieJar extends CookieJar { - cloudantPatch: boolean; - store: Store; -} - -interface SessionCookie extends Cookie { - cloudantPatchUpdateTime: Date; -} - /** Configuration options for CouchDB session authentication. */ export type CouchdbSessionAuthenticatorOptions = { /** The username to be used in CouchDB session authentication. */ @@ -93,53 +83,6 @@ export class CouchdbSessionAuthenticator extends Authenticator { // Merge the options Object.assign(this.tokenOptions, userOptions); - // START monkey patch for https://github.com/salesforce/tough-cookie/issues/154 - // Check if we've already patched the jar - const cookieJar = this.tokenOptions.jar as SessionCookieJar; - if (cookieJar && !cookieJar.cloudantPatch) { - // Set the patching flag - cookieJar.cloudantPatch = true; - // Replace the store's updateCookie function with one that applies a patch to newCookie - const originalUpdateCookieFn = cookieJar.store.updateCookie; - cookieJar.store.updateCookie = function updateCookie( - oldCookie, - newCookie: SessionCookie, - cb - ) { - // Add current time as an update timestamp to the newCookie - newCookie.cloudantPatchUpdateTime = new Date(); - // Replace the cookie's expiryTime function with one that uses cloudantPatchUpdateTime - // in place of creation time to check the expiry. - const originalExpiryTimeFn = newCookie.expiryTime; - newCookie.expiryTime = function expiryTime(now) { - // The original expiryTime check is relative to a time in this order: - // 1. supplied now argument - // 2. this.creation (original cookie creation time) - // 3. current time - // This patch replaces 2 with an expiry check relative to the cloudantPatchUpdateTime if set instead of - // the creation time by passing it as the now argument. - return originalExpiryTimeFn.call( - newCookie, - newCookie.cloudantPatchUpdateTime || now - ); - }; - // Finally, delegate back to the original update function or the fallback put (which is set by Cookie - // when an update function is not present on the store). Since we always set an update function for our - // patch we need to also provide that fallback. - if (originalUpdateCookieFn) { - originalUpdateCookieFn.call( - cookieJar.store, - oldCookie, - newCookie, - cb - ); - } else { - cookieJar.store.putCookie.call(cookieJar.store, newCookie, cb); - } - }; - } - // END cookie jar monkey patch - // Set the token manager this.tokenManager = new SessionTokenManager(this.tokenOptions); } diff --git a/package-lock.json b/package-lock.json index ec925110c..82d665c46 100644 --- a/package-lock.json +++ b/package-lock.json @@ -41,9 +41,8 @@ "node": "^22 || ^24" }, "peerDependencies": { - "@types/tough-cookie": "^4.0.0", "extend": "^3.0.2", - "tough-cookie": "^4.0.0" + "tough-cookie": "^6.0.0" } }, "node_modules/@babel/code-frame": { @@ -3309,12 +3308,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/tough-cookie": { - "version": "4.0.5", - "integrity": "sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA==", - "license": "MIT", - "peer": true - }, "node_modules/@types/unist": { "version": "3.0.3", "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", @@ -6211,17 +6204,6 @@ "url": "https://dotenvx.com" } }, - "node_modules/ibm-cloud-sdk-core/node_modules/tough-cookie": { - "version": "6.0.2", - "integrity": "sha512-exgYmnmL/sJpR3upZfXG5PoatXQii55xAiXGXzY+sROLZ/Y+SLcp9PgJNI9Vz37HpQ74WvDcLT8eqm+kV3FzrA==", - "license": "BSD-3-Clause", - "dependencies": { - "tldts": "^7.0.5" - }, - "engines": { - "node": ">=16" - } - }, "node_modules/ibm-cloud-sdk-core/node_modules/undici-types": { "version": "5.26.5", "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", @@ -10248,21 +10230,10 @@ "node": ">=10" } }, - "node_modules/psl": { - "version": "1.15.0", - "integrity": "sha512-JZd3gMVBAVQkSs6HdNZo9Sdo0LNcQeMNP3CozBJb3JYC/QUYZTnKxP+f8oWRX4rHP5EurWxqAHTSwUCjlNKa1w==", - "license": "MIT", - "peer": true, - "dependencies": { - "punycode": "^2.3.1" - }, - "funding": { - "url": "https://github.com/sponsors/lupomontero" - } - }, "node_modules/punycode": { "version": "2.3.1", "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -10293,12 +10264,6 @@ ], "license": "MIT" }, - "node_modules/querystringify": { - "version": "2.2.0", - "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", - "license": "MIT", - "peer": true - }, "node_modules/react-is": { "version": "18.3.1", "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", @@ -10370,12 +10335,6 @@ "node": ">=0.10.0" } }, - "node_modules/requires-port": { - "version": "1.0.0", - "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", - "license": "MIT", - "peer": true - }, "node_modules/reserved-identifiers": { "version": "1.2.0", "integrity": "sha512-yE7KUfFvaBFzGPs5H3Ops1RevfUEsDc5Iz65rOwWg4lE8HJSYtle77uul3+573457oHvBKuHYDl/xqUkKpEEdw==", @@ -11160,18 +11119,14 @@ } }, "node_modules/tough-cookie": { - "version": "4.1.4", - "integrity": "sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag==", + "version": "6.0.2", + "integrity": "sha512-exgYmnmL/sJpR3upZfXG5PoatXQii55xAiXGXzY+sROLZ/Y+SLcp9PgJNI9Vz37HpQ74WvDcLT8eqm+kV3FzrA==", "license": "BSD-3-Clause", - "peer": true, "dependencies": { - "psl": "^1.1.33", - "punycode": "^2.1.1", - "universalify": "^0.2.0", - "url-parse": "^1.5.3" + "tldts": "^7.0.5" }, "engines": { - "node": ">=6" + "node": ">=16" } }, "node_modules/ts-api-utils": { @@ -11486,15 +11441,6 @@ "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", "license": "MIT" }, - "node_modules/universalify": { - "version": "0.2.0", - "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", - "license": "MIT", - "peer": true, - "engines": { - "node": ">= 4.0.0" - } - }, "node_modules/unrs-resolver": { "version": "1.12.2", "integrity": "sha512-dmlRxBJJayXjqTwC+JtF1HhJmgf3ftQ3YejFcZrf4+KKtJv0qDsK1pjqaaVjG7wJ5NJ6UVP1OqRMQ71Z4C3rxQ==", @@ -11571,16 +11517,6 @@ "punycode": "^2.1.0" } }, - "node_modules/url-parse": { - "version": "1.5.10", - "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", - "license": "MIT", - "peer": true, - "dependencies": { - "querystringify": "^2.1.1", - "requires-port": "^1.0.0" - } - }, "node_modules/uuid": { "version": "14.0.1", "integrity": "sha512-6ZxzVpzDXDa3bJWaHilVayA+BH/1zmxCJoVgvmqJnid/gPoKHxUrS/aC/T6LGQtNHT+XHG9fXPJB4d+IrU30Ew==", diff --git a/package.json b/package.json index dd391488a..1395abbc4 100644 --- a/package.json +++ b/package.json @@ -69,9 +69,8 @@ "typescript": "6.0.3" }, "peerDependencies": { - "@types/tough-cookie": "^4.0.0", "extend": "^3.0.2", - "tough-cookie": "^4.0.0" + "tough-cookie": "^6.0.0" }, "jest": { "collectCoverage": true, diff --git a/tsconfig.json b/tsconfig.json index 4fd5205de..c23b76585 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { /* Basic Options */ "target": "es2022", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */ - "module": "node16", /* Specify module code generation: 'none', commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ + "module": "node20", /* Specify module code generation: 'none', commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ "lib": [ "es2022", "dom" @@ -23,7 +23,10 @@ "moduleResolution": "node16", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ "types": ["node"], /* Type declaration files to be included in compilation. */ "resolveJsonModule": true, /* Allows importing modules with a .json extension. */ - "esModuleInterop": true + "esModuleInterop": true, + "paths": { + "tough-cookie": ["./node_modules/tough-cookie"] + } }, "exclude": [ "node_modules",