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

Prepare for fastify v5 #129

Merged
merged 4 commits into from
Oct 12, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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 index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const plugin = fp(
},
{
name: 'mercurius-auth',
fastify: '4.x',
fastify: '5.x',
dependencies: ['mercurius']
}
)
Expand Down
4 changes: 1 addition & 3 deletions lib/filter-schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ function filterIntrospectionSchema (app, policy, { applyPolicy: policyFunction }
app[kDirectiveGrouping] = []

// the filter hook must be the last one to be executed (after all the authContextHook ones)
app.ready(err => {
/* istanbul ignore next */
if (err) throw err
app.addHook('onReady', async function () {
app.graphql.addHook('preExecution', filterGraphQLSchemaHook.bind(app))
})
}
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@
},
"homepage": "https://github.com/mercurius-js/auth",
"devDependencies": {
"@mercuriusjs/federation": "^2.0.0",
"@mercuriusjs/gateway": "^1.0.0",
"@mercuriusjs/federation": "^4.0.0",
"@mercuriusjs/gateway": "^4.0.0",
"@sinonjs/fake-timers": "^10.0.2",
"@types/node": "^20.1.0",
"@types/ws": "^8.5.3",
"@typescript-eslint/eslint-plugin": "^5.30.5",
"@typescript-eslint/parser": "^5.30.5",
"autocannon": "^7.9.0",
"concurrently": "^8.0.1",
"fastify": "^4.2.0",
"mercurius": "^13.0.0",
"fastify": "^5.0.0-alpha.4",
mcollina marked this conversation as resolved.
Show resolved Hide resolved
"mercurius": "^15.0.0",
"pre-commit": "^1.2.2",
"snazzy": "^9.0.0",
"standard": "^17.0.0",
Expand All @@ -50,8 +50,8 @@
"wait-on": "^7.0.1"
},
"dependencies": {
"@fastify/error": "^3.0.0",
"fastify-plugin": "^4.0.0",
"@fastify/error": "^4.0.0",
"fastify-plugin": "^5.0.0",
"graphql": "^16.2.0"
},
"tsd": {
Expand Down
26 changes: 0 additions & 26 deletions test/auth_on_type-gateway.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,32 +345,6 @@ test('gateway - should protect the schema, user object protected', async (t) =>
'0'
]
},
{
message: 'Failed auth policy check on User',
locations: [
{
line: 2,
column: 3
}
],
path: [
'_entities',
'1'
]
},
{
message: 'Failed auth policy check on User',
locations: [
{
line: 2,
column: 3
}
],
path: [
'_entities',
'0'
]
},
{
message: 'Failed auth policy check on User',
locations: [
Expand Down
Loading