Skip to content

Commit e763e09

Browse files
committed
📦 deps(app): update undici
1 parent 1b44369 commit e763e09

4 files changed

Lines changed: 35 additions & 7 deletions

File tree

‎app/authentications/providers/oidc/Oidc.test.ts‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,23 @@ function expectDefaultRedirectPayload(res: any) {
112112
});
113113
}
114114

115+
function getUndiciAgentOptions(dispatcher: unknown): Record<string, unknown> | undefined {
116+
if (!dispatcher || typeof dispatcher !== 'object') {
117+
return undefined;
118+
}
119+
120+
const optionsSymbol = Object.getOwnPropertySymbols(dispatcher).find(
121+
(symbol) => symbol.description === 'options',
122+
);
123+
if (!optionsSymbol) {
124+
return undefined;
125+
}
126+
127+
return (dispatcher as Record<symbol, unknown>)[optionsSymbol] as
128+
| Record<string, unknown>
129+
| undefined;
130+
}
131+
115132
/** Perform a redirect flow and return the session with pending state */
116133
async function performRedirect(oidcInstance: any, mock: any, session?: any) {
117134
const sess = session || { save: vi.fn((cb) => cb()) };
@@ -1560,6 +1577,10 @@ test('initAuthentication should configure custom fetch when cafile is set', asyn
15601577
'https://idp.example.com/.well-known/openid-configuration',
15611578
expect.objectContaining({ dispatcher: expect.anything() }),
15621579
);
1580+
const requestInit = fetchSpy.mock.calls[0][1] as { dispatcher?: unknown };
1581+
expect(getUndiciAgentOptions(requestInit.dispatcher)).toEqual(
1582+
expect.objectContaining({ allowH2: false }),
1583+
);
15631584
} finally {
15641585
fetchSpy.mockRestore();
15651586
await cleanup();
@@ -1598,6 +1619,10 @@ test('initAuthentication should configure custom fetch and warn when insecure TL
15981619
'https://idp.example.com/.well-known/openid-configuration',
15991620
expect.objectContaining({ dispatcher: expect.anything() }),
16001621
);
1622+
const requestInit = fetchSpy.mock.calls[0][1] as { dispatcher?: unknown };
1623+
expect(getUndiciAgentOptions(requestInit.dispatcher)).toEqual(
1624+
expect.objectContaining({ allowH2: false }),
1625+
);
16011626
} finally {
16021627
fetchSpy.mockRestore();
16031628
}

‎app/authentications/providers/oidc/Oidc.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,10 @@ class Oidc extends Authentication<OidcConfiguration> {
455455
this.log.warn('TLS certificate verification disabled for OIDC - do not use in production');
456456
connectOptions.rejectUnauthorized = false;
457457
}
458-
const dispatcher = new Agent({ connect: connectOptions });
458+
const dispatcher = new Agent({
459+
allowH2: false,
460+
connect: connectOptions,
461+
});
459462
const oidcFetch: openidClientLibrary.CustomFetch = (input, init) =>
460463
fetch(
461464
input as RequestInfo | URL,

‎app/package-lock.json‎

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎app/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"semver": "7.8.0",
6767
"set-value": "4.1.0",
6868
"sort-es": "1.7.18",
69-
"undici": "7.24.6",
69+
"undici": "8.2.0",
7070
"unix-crypt-td-js": "1.1.4",
7171
"uuid": "14.0.0",
7272
"ws": "8.20.1",

0 commit comments

Comments
 (0)