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..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", @@ -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", @@ -1906,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" } @@ -2897,6 +2903,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 +3387,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", @@ -4355,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", @@ -5011,6 +5026,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..af3e7abc 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", @@ -47,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", 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' })