diff --git a/docker/Dockerfile b/docker/Dockerfile index fe14de8..f190d0f 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1 -ARG NODE_VERSION=26.12.1 +ARG NODE_VERSION=26.13.1 FROM node:${NODE_VERSION}-alpine AS build @@ -10,7 +10,7 @@ ENV CI=true WORKDIR /resources-api RUN apk upgrade --no-cache \ - && apk add --no-cache bash git openssh-client openssl \ + && apk add --no-cache 'zlib>=1.4-r0' bash git openssh-client openssl \ && npm install --global "pnpm@${PNPM_VERSION}" \ && npm cache clean --force @@ -42,7 +42,7 @@ WORKDIR /resources-api # Alpine replaces old APK patch versions. Keep the configured Node major while # accepting maintained patch releases and verify the selected runtime below. RUN apk upgrade --no-cache \ - && apk add --no-cache bash "nodejs-current~${NODE_VERSION%%.*}" \ + && apk add --no-cache 'zlib>=1.4-r0' bash "nodejs-current~${NODE_VERSION%%.*}" "nodejs-current>=${NODE_VERSION}-r0" \ && test "$(node -p 'process.versions.node.split(".")[0]')" = "${NODE_VERSION%%.*}" \ && addgroup -S -g 10001 app \ && adduser -S -D -H -u 10001 -G app app diff --git a/package.json b/package.json index 74ff783..688cd3b 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,7 @@ "rxjs": "^7.8.1", "superagent": "^10.3.0", "swagger-ui-express": "^4.1.3", - "tc-core-library-js": "github:topcoder-platform/tc-core-library-js#v4.0.0-rc.2", + "tc-core-library-js": "https://codeload.github.com/topcoder-platform/tc-core-library-js/tar.gz/c2df92b2227089909ab6e229df0ec6b658bb431a", "uuid": "^14.0.1", "winston": "^3.2.1", "xss": "^1.0.7", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0df76f6..a6279bf 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -16,12 +16,12 @@ overrides: handlebars: 4.7.10 csv-parse: 7.0.2 '@faker-js/faker': 10.6.0 - node-forge: 1.4.1 + node-forge: 1.4.3 joi: 18.3.1 moment: 2.31.0 mysql2: 3.23.1 - hono: 4.13.11 - '@hono/node-server': 2.1.3 + hono: 4.13.18 + '@hono/node-server': 2.1.8 js-yaml@^3: 3.15.2 js-yaml@^4: 4.3.2 brace-expansion@^1: 1.1.21 @@ -125,8 +125,8 @@ importers: specifier: ^4.1.3 version: 4.6.3(express@4.22.1(supports-color@5.5.0)) tc-core-library-js: - specifier: github:topcoder-platform/tc-core-library-js#v4.0.0-rc.2 - version: https://codeload.github.com/topcoder-platform/tc-core-library-js/tar.gz/58de37670180e183e8378c3d203df0112a0414f6(supports-color@5.5.0) + specifier: https://codeload.github.com/topcoder-platform/tc-core-library-js/tar.gz/c2df92b2227089909ab6e229df0ec6b658bb431a + version: https://codeload.github.com/topcoder-platform/tc-core-library-js/tar.gz/c2df92b2227089909ab6e229df0ec6b658bb431a(supports-color@5.5.0) uuid: specifier: ^14.0.1 version: 14.0.1 @@ -416,11 +416,11 @@ packages: '@hapi/topo@6.0.2': resolution: {integrity: sha512-KR3rD5inZbGMrHmgPxsJ9dbi6zEK+C3ZwUwTa+eMwWLz7oijWUTWD2pMSNNYJAU6Qq+65NkxXjqHr/7LM2Xkqg==} - '@hono/node-server@2.1.3': - resolution: {integrity: sha512-TA//nWMqPhbfdfneACk6t5a9eqbS9lABEPyKn0/xZTah3H3U2XaVg85rJFl0/Fyit0I552YDHgXGVSf3GwqbUw==} + '@hono/node-server@2.1.8': + resolution: {integrity: sha512-jdf7FHh6A1lzjpHHQUgxsg2GeER2vMetnAOfeActzcoli6jamlK+NAwL6Dsr5Fl3BS3tYUQzCdtZjU8Qxv7bEA==} engines: {node: '>=20'} peerDependencies: - hono: 4.13.11 + hono: 4.13.18 '@humanfs/core@0.19.2': resolution: {integrity: sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA==} @@ -2051,8 +2051,8 @@ packages: resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==} hasBin: true - hono@4.13.11: - resolution: {integrity: sha512-/SMX/RQNJn7oNmFwH6DtwDqcrzZU2otm1FD6OJe2cWF6cfy/F8hq0XVBv7xW3FTJshRQwuBnXHDq2kNsdZnshg==} + hono@4.13.18: + resolution: {integrity: sha512-H9q/E1XizaWstJxUW881dmLxEj+t/TrGGnyxINkm4+sK0qUwsMtFdo2BWI9Vs3cIS19MU6b6iCijoUoEf4f3DA==} engines: {node: '>=16.9.0'} html-escaper@2.0.2: @@ -2584,12 +2584,13 @@ packages: node-abort-controller@3.1.1: resolution: {integrity: sha512-AGK2yQKIjRuqnc6VkX2Xj5d+QW8xZ87pa1UK6yA6ouUyuxfHuMP6umE5QK7UmTeOAymo+Zx1Fxiuw9rVx8taHQ==} + deprecated: This package is no longer needed on supported Node.js versions. Node.js 16+ includes AbortController and AbortSignal as built-in globals. All Node.js versions requiring this polyfill are end-of-life. Use the built-in globals instead. node-emoji@1.11.0: resolution: {integrity: sha512-wo2DpQkQp7Sjm2A0cq+sN7EHKO6Sl0ctXeBdFZrL9T9+UywORbufTcTZxom8YqpLQt/FqNMUkOpkZrJVYSKD3A==} - node-forge@1.4.1: - resolution: {integrity: sha512-w5/MfWaeMrpR/5ba6fZyAUTLSuE6aYz7H/3cYrqwZEmf5eQS3IaaLgJt4MBv7HglGFWmV22K8h4U18RJQmw/ow==} + node-forge@1.4.3: + resolution: {integrity: sha512-P6wzfh6t70avmV8FrVEAd/36sOPJQ+hkaJVX1Laap9J/77m7M0eyozDvc8SwnDf4P7MP94gwbAAo0rg3YVXT+g==} engines: {node: '>= 6.13.0'} node-oauth1@1.3.0: @@ -3260,9 +3261,9 @@ packages: resolution: {integrity: sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A==} engines: {node: '>=6'} - tc-core-library-js@https://codeload.github.com/topcoder-platform/tc-core-library-js/tar.gz/58de37670180e183e8378c3d203df0112a0414f6: - resolution: {gitHosted: true, tarball: https://codeload.github.com/topcoder-platform/tc-core-library-js/tar.gz/58de37670180e183e8378c3d203df0112a0414f6} - version: 4.0.0-rc.2 + tc-core-library-js@https://codeload.github.com/topcoder-platform/tc-core-library-js/tar.gz/c2df92b2227089909ab6e229df0ec6b658bb431a: + resolution: {gitHosted: true, integrity: sha512-n+4KUOeV4LEIsTI/R216dBc6bUkbSyO/2O0LpoY3Hk7eqKsRQFUHloB3y0hfK/v1rzf8qYQxTdv8ikeRGBn4pQ==, tarball: https://codeload.github.com/topcoder-platform/tc-core-library-js/tar.gz/c2df92b2227089909ab6e229df0ec6b658bb431a} + version: 4.0.0-rc.2.1 engines: {node: '>=22.13'} teleport-javascript@1.0.0: @@ -3903,9 +3904,9 @@ snapshots: dependencies: '@hapi/hoek': 11.0.7 - '@hono/node-server@2.1.3(hono@4.13.11)': + '@hono/node-server@2.1.8(hono@4.13.18)': dependencies: - hono: 4.13.11 + hono: 4.13.18 '@humanfs/core@0.19.2': dependencies: @@ -4271,13 +4272,13 @@ snapshots: '@electric-sql/pglite': 0.4.1 '@electric-sql/pglite-socket': 0.1.1(@electric-sql/pglite@0.4.1) '@electric-sql/pglite-tools': 0.3.1(@electric-sql/pglite@0.4.1) - '@hono/node-server': 2.1.3(hono@4.13.11) + '@hono/node-server': 2.1.8(hono@4.13.18) '@prisma/get-platform': 7.2.0 '@prisma/query-plan-executor': 7.2.0 '@prisma/streams-local': 0.1.2 foreground-child: 3.3.1 get-port-please: 3.2.0 - hono: 4.13.11 + hono: 4.13.18 http-status-codes: 2.3.0 pathe: 2.0.3 proper-lockfile: 4.1.2 @@ -5689,7 +5690,7 @@ snapshots: he@1.2.0: {} - hono@4.13.11: {} + hono@4.13.18: {} html-escaper@2.0.2: {} @@ -6214,7 +6215,7 @@ snapshots: dependencies: lodash: 4.18.1 - node-forge@1.4.1: {} + node-forge@1.4.3: {} node-oauth1@1.3.0: {} @@ -6539,7 +6540,7 @@ snapshots: js-sha512: 0.9.0 lodash: 4.18.1 mime-types: 2.1.35 - node-forge: 1.4.1 + node-forge: 1.4.3 node-oauth1: 1.3.0 performance-now: 2.1.0 postman-collection: 4.4.0(patch_hash=17b540b14b6535c79f5c2f5416e3d4461863b60277b152d57bbca198010988dd) @@ -7007,7 +7008,7 @@ snapshots: tapable@2.3.3: {} - tc-core-library-js@https://codeload.github.com/topcoder-platform/tc-core-library-js/tar.gz/58de37670180e183e8378c3d203df0112a0414f6(supports-color@5.5.0): + tc-core-library-js@https://codeload.github.com/topcoder-platform/tc-core-library-js/tar.gz/c2df92b2227089909ab6e229df0ec6b658bb431a(supports-color@5.5.0): dependencies: '@types/jsonwebtoken': 9.0.10 jsonwebtoken: 9.0.3 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 0fd153f..31175ef 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -10,12 +10,12 @@ overrides: 'handlebars': 4.7.10 'csv-parse': 7.0.2 '@faker-js/faker': 10.6.0 - 'node-forge': 1.4.1 + 'node-forge': 1.4.3 'joi': 18.3.1 'moment': 2.31.0 'mysql2': 3.23.1 - 'hono': 4.13.11 - '@hono/node-server': 2.1.3 + 'hono': 4.13.18 + '@hono/node-server': 2.1.8 'js-yaml@^3': 3.15.2 'js-yaml@^4': 4.3.2 'brace-expansion@^1': 1.1.21 diff --git a/test/unit/jwt-configuration.test.ts b/test/unit/jwt-configuration.test.ts index a4cb8fc..060b1c7 100644 --- a/test/unit/jwt-configuration.test.ts +++ b/test/unit/jwt-configuration.test.ts @@ -66,7 +66,7 @@ describe('route JWT configuration', () => { } it('accepts browser RSA tokens using JWT_AUDIENCE', async () => { - const token = jwt.sign({ userId: '42', roles: ['User'] }, privateKey, { algorithm: 'RS256', keyid: 'test-key', issuer, audience: 'browser-client', expiresIn: 300 }); + const token = jwt.sign({ emailVerified: true, userId: '42', roles: ['User'] }, privateKey, { algorithm: 'RS256', keyid: 'test-key', issuer, audience: 'browser-client', expiresIn: 300 }); const result = await verify(token); assert.equal(result.status, 200); assert.equal(result.user.isMachine, false); @@ -80,12 +80,12 @@ describe('route JWT configuration', () => { }); it('retains legacy HS256 human tokens without an audience', async () => { - const token = jwt.sign({ userId: '42', roles: ['User'] }, secret, { issuer, expiresIn: 300 }); + const token = jwt.sign({ emailVerified: true, userId: '42', roles: ['User'] }, secret, { issuer, expiresIn: 300 }); assert.equal((await verify(token)).status, 200); }); it('rejects an untrusted audience', async () => { - const token = jwt.sign({ userId: '42' }, privateKey, { algorithm: 'RS256', keyid: 'test-key', issuer, audience: 'another-api', expiresIn: 300 }); + const token = jwt.sign({ emailVerified: true, userId: '42' }, privateKey, { algorithm: 'RS256', keyid: 'test-key', issuer, audience: 'another-api', expiresIn: 300 }); assert.equal((await verify(token)).status, 401); }); @@ -95,7 +95,7 @@ describe('route JWT configuration', () => { }); it('rejects an invalid signature', async () => { - const token = jwt.sign({ userId: '42' }, 'incorrect-secret-at-least-32-bytes', { issuer, expiresIn: 300 }); + const token = jwt.sign({ emailVerified: true, userId: '42' }, 'incorrect-secret-at-least-32-bytes', { issuer, expiresIn: 300 }); assert.equal((await verify(token)).status, 401); }); });