Skip to content

Commit

Permalink
Security: remove ws subscription dependencies (#5416)
Browse files Browse the repository at this point in the history
* remove unused vulnerable dependency from api

* remove unused vulnerable dependency from frontend

* remove wsClient from App.js

* remove split link from client
  • Loading branch information
lcampbell2 authored Jun 19, 2024
1 parent be01350 commit 19b0f2b
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 159 deletions.
1 change: 0 additions & 1 deletion api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,5 @@ const {
await server.listen(PORT, (err) => {
if (err) throw err
console.log(`🚀 Server ready at http://localhost:${PORT}/graphql`)
console.log(`🚀 Subscriptions ready at ws://localhost:${PORT}/graphql`)
})
})()
63 changes: 2 additions & 61 deletions api/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
"ms": "^2.1.3",
"nats": "^2.18.0",
"notifications-node-client": "^8.0.0",
"subscriptions-transport-ws": "^0.11.0",
"url-slug": "^3.0.2",
"uuid": "^8.3.2",
"validator": "^13.7.0"
Expand Down
15 changes: 1 addition & 14 deletions api/src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ import { ApolloServerPluginLandingPageLocalDefault } from '@apollo/server/plugin
import compression from 'compression'

import requestLanguage from 'express-request-language'
import { execute, subscribe, GraphQLSchema } from 'graphql'
import { GraphQLSchema } from 'graphql'
import depthLimit from 'graphql-depth-limit'
import { createComplexityLimitRule } from 'graphql-validation-complexity'
import { SubscriptionServer } from 'subscriptions-transport-ws'

import { createQuerySchema } from './query'
import { createMutationSchema } from './mutation'
Expand Down Expand Up @@ -101,17 +100,5 @@ export const Server = async ({
res.json({ ok: 'yes' })
})

SubscriptionServer.create(
{
schema,
execute,
subscribe,
},
{
server: httpServer,
path: server.graphqlPath,
},
)

return httpServer
}
Loading

0 comments on commit 19b0f2b

Please sign in to comment.