Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
47 changes: 24 additions & 23 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions test/unit/jwt-configuration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
});

Expand All @@ -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);
});
});
Loading