Skip to content

Commit

Permalink
Merge pull request #129 from jonnydgreen/prepare-fasify-v5
Browse files Browse the repository at this point in the history
Prepare for fastify v5
  • Loading branch information
jonnydgreen authored Oct 12, 2024
2 parents 2e9bd58 + 49feadc commit d890603
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [18.x, 20.x]
node-version: [20.x, 22.x]
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v3
Expand Down
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",
"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

0 comments on commit d890603

Please sign in to comment.