Skip to content

Commit 881d1f9

Browse files
authored
chore(deps-dev): bump openid-client to v6.x (#1329)
1 parent 750b629 commit 881d1f9

File tree

4 files changed

+34
-61
lines changed

4 files changed

+34
-61
lines changed

package-lock.json

Lines changed: 21 additions & 47 deletions
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
@@ -55,7 +55,7 @@
5555
"fastify": "^5.0.0",
5656
"got": "^11.8.1",
5757
"neostandard": "^0.12.0",
58-
"openid-client": "^5.6.1",
58+
"openid-client": "^6.6.1",
5959
"passport-facebook": "^3.0.0",
6060
"passport-github2": "^0.1.12",
6161
"passport-google-oauth": "^2.0.0",

test/strategies-integration.test.ts

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import assert, { fail } from 'node:assert'
33
import { Strategy as FacebookStrategy } from 'passport-facebook'
44
import { Strategy as GitHubStrategy } from 'passport-github2'
55
import { OAuth2Strategy as GoogleStrategy } from 'passport-google-oauth'
6-
import { Issuer as OpenIdIssuer, Strategy as OpenIdStrategy } from 'openid-client'
6+
import { Configuration as OpenIdClientConfiguration } from 'openid-client'
7+
import { Strategy as OpenIdClientStrategy } from 'openid-client/passport'
78
import { getConfiguredTestServer, TestStrategy } from './helpers'
89

910
const testSuite = (sessionPluginName: string) => {
@@ -90,20 +91,18 @@ const testSuite = (sessionPluginName: string) => {
9091
})
9192

9293
test('should initiate oauth with the openid-client strategy from npm', async () => {
93-
const issuer = new OpenIdIssuer({ issuer: 'test_issuer', authorization_endpoint: 'http://www.example.com' })
94-
95-
const client = new issuer.Client({
94+
const issuer = { issuer: 'https://as.example.com/', authorization_endpoint: 'https://as.example.com/authorize' }
95+
const client = {
9696
client_id: 'identifier',
9797
client_secret: 'secure',
98-
redirect_uris: ['http://www.example.com/auth/openid-client/callback']
99-
})
98+
}
10099

101-
const strategy = new OpenIdStrategy(
102-
{
103-
client
104-
},
100+
const config = new OpenIdClientConfiguration(issuer, client.client_id, client.client_secret)
101+
102+
const strategy = new OpenIdClientStrategy(
103+
{ config },
105104
() => fail()
106-
) as TestStrategy
105+
) as unknown as TestStrategy
107106

108107
const { server, fastifyPassport } = getConfiguredTestServer('openid-client', strategy)
109108

tsconfig.test.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
"compilerOptions": {
33
"outDir": "dist",
44
"sourceMap": true,
5-
"moduleResolution": "node",
5+
"moduleResolution": "nodenext",
66
"esModuleInterop": true,
77
"declaration": true,
88
"target": "es2017",
9-
"module": "commonjs",
9+
"module": "nodenext",
1010
"pretty": true,
1111
"noEmitOnError": true,
1212
"strict": true,

0 commit comments

Comments
 (0)