From 7799b42d24ea36ecc9129e10c835f2cb7b682ec8 Mon Sep 17 00:00:00 2001 From: Moreno Feltscher Date: Wed, 30 Sep 2026 09:57:11 +0200 Subject: [PATCH 1/3] fix(deps): add explicit @types/node and test on supported node versions @tsconfig/node-lts >= 22.0.4 enables lib es2024, which makes Uint8Array generic. The only @types/node in the tree was a stale transitive 18.x, whose Buffer is incompatible with it, breaking the generated protobuf code. Also move the CI test matrix from EOL node 18/20 to 22/24 (ava 8 requires node >= 22.20). Co-Authored-By: Claude Opus 5.5 --- .github/workflows/testing.yml | 4 ++-- package-lock.json | 31 +++++++++++++++++++++++++------ package.json | 1 + 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 7446ffa4..a256e991 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -14,8 +14,8 @@ jobs: fail-fast: true matrix: version: - - 18 - - 20 + - 22 + - 24 name: test and build package (node ${{ matrix.version }}) runs-on: ubuntu-latest steps: diff --git a/package-lock.json b/package-lock.json index 9e601c01..26a2d1ae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,6 +20,7 @@ "devDependencies": { "@bufbuild/buf": "^1.18.0-1", "@tsconfig/node-lts": "^22.0.0", + "@types/node": "22.20.4", "@types/node-rsa": "1.1.4", "ava": "6.4.1", "grpc-tools": "1.13.1", @@ -518,9 +519,13 @@ "dev": true }, "node_modules/@types/node": { - "version": "18.8.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.8.5.tgz", - "integrity": "sha512-Bq7G3AErwe5A/Zki5fdD3O6+0zDChhg671NfPjtIcbtzDNZTv4NPKMRFr7gtYPG7y+B8uTiNK4Ngd9T0FTar6Q==" + "version": "22.20.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.20.4.tgz", + "integrity": "sha512-zJRE40jpHtKqE/C4fgHrAKQLJuSpzEnP9ff9Y7YtoR3Wd2pwqzlekDeEuUQXjRd+QCYnVnNwuJYmhdk9XV8gvA==", + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } }, "node_modules/@types/node-rsa": { "version": "1.1.4", @@ -2897,6 +2902,12 @@ "node": ">=14.17" } }, + "node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "license": "MIT" + }, "node_modules/unicorn-magic": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.3.0.tgz", @@ -3375,9 +3386,12 @@ "dev": true }, "@types/node": { - "version": "18.8.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.8.5.tgz", - "integrity": "sha512-Bq7G3AErwe5A/Zki5fdD3O6+0zDChhg671NfPjtIcbtzDNZTv4NPKMRFr7gtYPG7y+B8uTiNK4Ngd9T0FTar6Q==" + "version": "22.20.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.20.4.tgz", + "integrity": "sha512-zJRE40jpHtKqE/C4fgHrAKQLJuSpzEnP9ff9Y7YtoR3Wd2pwqzlekDeEuUQXjRd+QCYnVnNwuJYmhdk9XV8gvA==", + "requires": { + "undici-types": "~6.21.0" + } }, "@types/node-rsa": { "version": "1.1.4", @@ -5011,6 +5025,11 @@ "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", "dev": true }, + "undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==" + }, "unicorn-magic": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.3.0.tgz", diff --git a/package.json b/package.json index ecbca551..e8a4f9cc 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "devDependencies": { "@bufbuild/buf": "^1.18.0-1", "@tsconfig/node-lts": "^22.0.0", + "@types/node": "22.20.4", "@types/node-rsa": "1.1.4", "ava": "6.4.1", "grpc-tools": "1.13.1", From bfda4e9cffa5e8e3587b1d59065d9a03ec82b496 Mon Sep 17 00:00:00 2001 From: Moreno Feltscher Date: Wed, 30 Sep 2026 09:59:18 +0200 Subject: [PATCH 2/3] fix(credentials): use valid RS256 alg when importing the private key Co-Authored-By: Claude Opus 5.5 --- src/credentials/application.ts | 2 +- src/credentials/service-account.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/credentials/application.ts b/src/credentials/application.ts index b6e9b14f..99016433 100644 --- a/src/credentials/application.ts +++ b/src/credentials/application.ts @@ -115,7 +115,7 @@ export class Application { */ public async getSignedJwt(audience: string): Promise { const rsa = new NodeRSA(this.key); - const key = await importPKCS8(rsa.exportKey('pkcs8-private-pem'), 'RSA256'); + const key = await importPKCS8(rsa.exportKey('pkcs8-private-pem'), 'RS256'); return await new SignJWT({}) .setProtectedHeader({ kid: this.keyId, alg: 'RS256' }) diff --git a/src/credentials/service-account.ts b/src/credentials/service-account.ts index e104703c..6ef17e88 100644 --- a/src/credentials/service-account.ts +++ b/src/credentials/service-account.ts @@ -183,7 +183,7 @@ export class ServiceAccount { private async getSignedJwt(audience: string): Promise { const rsa = new NodeRSA(this.key); - const key = await importPKCS8(rsa.exportKey('pkcs8-private-pem'), 'RSA256'); + const key = await importPKCS8(rsa.exportKey('pkcs8-private-pem'), 'RS256'); return await new SignJWT({}) .setProtectedHeader({ kid: this.keyId, alg: 'RS256' }) From b41dadb4b1152272153ec2814d056be7ce899a28 Mon Sep 17 00:00:00 2001 From: Moreno Feltscher Date: Wed, 30 Sep 2026 10:00:21 +0200 Subject: [PATCH 3/3] fix(deps): update dependency jose to v6 Co-Authored-By: Claude Opus 5.5 --- package-lock.json | 15 ++++++++------- package.json | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 26a2d1ae..b7308535 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "Apache-2.0", "dependencies": { "axios": "1.20.0", - "jose": "5.10.0", + "jose": "6.2.12", "long": "5.3.2", "nice-grpc": "2.1.17", "node-rsa": "2.0.0", @@ -1911,9 +1911,10 @@ } }, "node_modules/jose": { - "version": "5.10.0", - "resolved": "https://registry.npmjs.org/jose/-/jose-5.10.0.tgz", - "integrity": "sha512-s+3Al/p9g32Iq+oqXxkW//7jk2Vig6FF1CFqzVXoTUXt2qz89YWbL+OwS17NFYEvxC35n0FKeGO2LGYSxeM2Gg==", + "version": "6.2.12", + "resolved": "https://registry.npmjs.org/jose/-/jose-6.2.12.tgz", + "integrity": "sha512-9NiFmJEex0sy2Dk58j2UGBSHgUs2ypF9eZSu4L6vjOX3Dp96Sw1F3uL+H+D1sx02jZZdzUT0HgvCy59CuvXcWw==", + "license": "MIT", "funding": { "url": "https://github.com/sponsors/panva" } @@ -4369,9 +4370,9 @@ } }, "jose": { - "version": "5.10.0", - "resolved": "https://registry.npmjs.org/jose/-/jose-5.10.0.tgz", - "integrity": "sha512-s+3Al/p9g32Iq+oqXxkW//7jk2Vig6FF1CFqzVXoTUXt2qz89YWbL+OwS17NFYEvxC35n0FKeGO2LGYSxeM2Gg==" + "version": "6.2.12", + "resolved": "https://registry.npmjs.org/jose/-/jose-6.2.12.tgz", + "integrity": "sha512-9NiFmJEex0sy2Dk58j2UGBSHgUs2ypF9eZSu4L6vjOX3Dp96Sw1F3uL+H+D1sx02jZZdzUT0HgvCy59CuvXcWw==" }, "js-string-escape": { "version": "1.0.1", diff --git a/package.json b/package.json index e8a4f9cc..af3e7abc 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ }, "dependencies": { "axios": "1.20.0", - "jose": "5.10.0", + "jose": "6.2.12", "long": "5.3.2", "nice-grpc": "2.1.17", "node-rsa": "2.0.0",