Skip to content

Commit 44e53f9

Browse files
committed
chore(deps): update node in ci to 22
1 parent 2dafeb4 commit 44e53f9

File tree

7 files changed

+24
-11
lines changed

7 files changed

+24
-11
lines changed

.evergreen.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ functions:
1414
set -e
1515
set -x
1616
17-
export NODE_VERSION=16.19.0
17+
export NODE_VERSION=22.15.1
1818
bash .evergreen/install-node.sh
1919
install:
2020
- command: shell.exec

.github/workflows/nodejs.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
os: [ubuntu-latest, macos-latest, windows-latest]
18-
node-version: [16.x, 18.x, 20.x]
18+
node-version: [22.x, 24.x]
1919
runs-on: ${{matrix.os}}
2020
steps:
2121
- uses: actions/checkout@v4
2222
- name: Use Node.js ${{ matrix.node-version }}
2323
uses: actions/setup-node@v4
2424
with:
2525
node-version: ${{ matrix.node-version }}
26-
# the oidc-provider package we use doesn't list Node.js 20 as supported
26+
# the oidc-provider package we use doesn't list Node.js 22 and 24 as supported
2727
- name: Install Dependencies
2828
run: npm ci --ignore-engines
2929
- name: Test
@@ -34,7 +34,7 @@ jobs:
3434
fail-fast: false
3535
matrix:
3636
os: [ubuntu-latest]
37-
node-version: [18.x]
37+
node-version: [22.x]
3838
runs-on: ${{matrix.os}}
3939
steps:
4040
- uses: actions/checkout@v4
@@ -56,10 +56,10 @@ jobs:
5656
steps:
5757
- uses: actions/checkout@v4
5858

59-
- name: Use Node.js 20.x
59+
- name: Use Node.js 22.x
6060
uses: actions/setup-node@v4
6161
with:
62-
node-version: 20.x
62+
node-version: 22.x
6363

6464
- name: Install Dependencies
6565
run: npm ci --ignore-engines

.github/workflows/publish-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ jobs:
1919

2020
- uses: actions/checkout@v4
2121

22-
- name: Use Node.js 20.x
22+
- name: Use Node.js 22.x
2323
uses: actions/setup-node@v4
2424
with:
25-
node-version: 20.x
25+
node-version: 22.x
2626
registry-url: 'https://registry.npmjs.org'
2727

2828
- name: Install Dependencies

.tool-versions

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# This file is for the version management tool "asdf".
2+
# mms uses it as well.
3+
4+
# This Node.js version matches the one required in
5+
# the "engines" in the package.json and .everygreen.yml
6+
nodejs 22.15.1

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"import": "./dist/.esm-wrapper.mjs"
3131
},
3232
"engines": {
33-
"node": ">= 16.20.1"
33+
"node": ">= 22.15.1"
3434
},
3535
"types": "./index.d.ts",
3636
"scripts": {

src/plugin.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ interface UserOIDCAuthState {
5757
// A Promise that resolves when the current authentication attempt
5858
// is finished, if there is one at the moment.
5959
currentAuthAttempt: Promise<IdPServerResponse> | null;
60+
currentAuthAttemptId: string | null;
6061
// The last set of OIDC tokens we have received together with a
6162
// callback to refresh it and the client used to obtain it, if available.
6263
currentTokenSet: {
@@ -246,6 +247,7 @@ export class MongoDBOIDCPluginImpl implements MongoDBOIDCPlugin {
246247
const state: UserOIDCAuthState = {
247248
serverOIDCMetadata: { ...serializedState.serverOIDCMetadata },
248249
currentAuthAttempt: null,
250+
currentAuthAttemptId: null,
249251
currentTokenSet: null,
250252
lastIdTokenClaims: serializedState.lastIdTokenClaims
251253
? { ...serializedState.lastIdTokenClaims }
@@ -283,6 +285,7 @@ export class MongoDBOIDCPluginImpl implements MongoDBOIDCPlugin {
283285
currentTokenSet: {
284286
set: { ...state.currentTokenSet?.set },
285287
},
288+
currentAuthAttemptId: state.currentAuthAttemptId,
286289
lastIdTokenClaims: state.lastIdTokenClaims
287290
? { ...state.lastIdTokenClaims }
288291
: undefined,
@@ -345,6 +348,7 @@ export class MongoDBOIDCPluginImpl implements MongoDBOIDCPlugin {
345348
const newState: UserOIDCAuthState = {
346349
serverOIDCMetadata: serverMetadata,
347350
currentAuthAttempt: null,
351+
currentAuthAttemptId: null,
348352
currentTokenSet: null,
349353
};
350354
this.mapIdpToAuthState.set(key, newState);
@@ -1021,10 +1025,13 @@ export class MongoDBOIDCPluginImpl implements MongoDBOIDCPlugin {
10211025
);
10221026
try {
10231027
state.currentAuthAttempt = newAuthAttempt;
1028+
state.currentAuthAttemptId = `${Date.now()}`; // TODO req id typing.
10241029
return await newAuthAttempt;
10251030
} finally {
1026-
if (state.currentAuthAttempt === newAuthAttempt)
1031+
if (state.currentAuthAttempt === newAuthAttempt) {
10271032
state.currentAuthAttempt = null;
1033+
state.currentAuthAttemptId = null;
1034+
}
10281035
}
10291036
} finally {
10301037
if (params.refreshToken) {

0 commit comments

Comments
 (0)