feat: reject requests from incompatible machines
This commit is contained in:
parent
737672c07a
commit
1830f90c2c
5 changed files with 31 additions and 19 deletions
|
|
@ -22,7 +22,7 @@ const logsRoutes = require('./routes/logsRoutes')
|
|||
const pairingRoutes = require('./routes/pairingRoutes')
|
||||
const diagnosticsRoutes = require('./routes/diagnosticsRoutes')
|
||||
const performanceRoutes = require('./routes/performanceRoutes')
|
||||
const pollingRoutes = require('./routes/pollingRoutes')
|
||||
const rejectIncompatibleMachines = require('./middlewares/rejectIncompatbleMachines')
|
||||
const stateRoutes = require('./routes/stateRoutes')
|
||||
const termsAndConditionsRoutes = require('./routes/termsAndConditionsRoutes')
|
||||
const { router: txRoutes } = require('./routes/txRoutes')
|
||||
|
|
@ -81,7 +81,6 @@ const loadRoutes = async () => {
|
|||
|
||||
// other app routes
|
||||
app.use('/graphql', recordPing)
|
||||
app.use('/poll', pollingRoutes)
|
||||
app.use('/terms_conditions', termsAndConditionsRoutes)
|
||||
app.use('/state', stateRoutes)
|
||||
app.use('/cashbox', cashboxRoutes)
|
||||
|
|
@ -103,6 +102,9 @@ const loadRoutes = async () => {
|
|||
|
||||
app.use('/probe', probeRoutes)
|
||||
|
||||
// Not all requests have the machine version on the url
|
||||
// rejecting poll is enough to render the machine "stuck"
|
||||
app.use(rejectIncompatibleMachines)
|
||||
await graphQLServer.start()
|
||||
app.use('/graphql',
|
||||
express.json(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue