Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: Upgrade to Fastify 5 and Node 20 #367

Merged
merged 1 commit into from
Oct 11, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
AUTH0_API_AUDIENCE: ${{ secrets.AUTH0_API_AUDIENCE }}
strategy:
matrix:
node: [16, 18, 20]
node: [20, 22]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function fastifyAuth0Verify(instance, options, done) {
}
}

module.exports = fastifyPlugin(fastifyAuth0Verify, { name: 'fastify-auth0-verify', fastify: '4.x' })
module.exports = fastifyPlugin(fastifyAuth0Verify, { name: 'fastify-auth0-verify', fastify: '5.x' })

// Set the default export to the fastifyAuth0Verify function for ES module compatibility
module.exports.default = fastifyAuth0Verify
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@
"postpublish": "git push origin && git push origin -f --tags"
},
"dependencies": {
"@fastify/cookie": "^9.0.4",
"@fastify/jwt": "^8.0.0",
"fastify-jwt-jwks": "^1.1.3",
"fastify-plugin": "^4.0.0"
"@fastify/cookie": "^11.0.1",
"@fastify/jwt": "^9.0.1",
"fastify-jwt-jwks": "^2.0.0",
"fastify-plugin": "^5.0.1"
},
"devDependencies": {
"cross-fetch": "^4.0.0",
Expand All @@ -63,14 +63,14 @@
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-promise": "^6.0.1",
"fast-jwt": "^4.0.0",
"fastify": "^4.0.2",
"fastify": "^5.0.0",
"jest": "^29.0.0",
"nock": "^13.0.2",
"prettier": "^3.0.1",
"tsd": "^0.31.0",
"typescript": "^5.0.2"
},
"engines": {
"node": ">= 16"
"node": ">= 20"
}
}
12 changes: 6 additions & 6 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,12 +295,12 @@ describe('JWT token decoding', function () {
it('should complain if the HTTP Authorization header is in the wrong format', async function () {
const response = await server.inject({ method: 'GET', url: '/decode', headers: { Authorization: 'FOO' } })

expect(response.statusCode).toEqual(400)
expect(response.statusCode).toEqual(401)
expect(response.json()).toEqual({
code: 'FST_JWT_BAD_REQUEST',
statusCode: 400,
error: 'Bad Request',
message: 'Format is Authorization: Bearer [token]'
code: 'FST_JWT_NO_AUTHORIZATION_IN_HEADER',
statusCode: 401,
error: 'Unauthorized',
message: 'No Authorization was found in request.headers'
})
})
})
Expand Down Expand Up @@ -920,7 +920,7 @@ describe('General error handling', function () {
expect(response.json()).toEqual({
statusCode: 401,
error: 'Unauthorized',
message: 'Authorization header should be in format: Bearer [token].'
message: 'Missing Authorization HTTP header.'
})
})

Expand Down
Loading