|
@@ -13,17 +13,6 @@ const base64id = require('base64id')
|
|
|
const { UnexpectedArgumentsError } = require('./Errors')
|
|
const { UnexpectedArgumentsError } = require('./Errors')
|
|
|
const Joi = require('@hapi/joi')
|
|
const Joi = require('@hapi/joi')
|
|
|
|
|
|
|
|
-const basicAuth = require('basic-auth-connect')
|
|
|
|
|
-const httpAuth = basicAuth(function (user, pass) {
|
|
|
|
|
- const isValid =
|
|
|
|
|
- user === settings.internal.realTime.user &&
|
|
|
|
|
- pass === settings.internal.realTime.pass
|
|
|
|
|
- if (!isValid) {
|
|
|
|
|
- logger.err({ user, pass }, 'invalid login details')
|
|
|
|
|
- }
|
|
|
|
|
- return isValid
|
|
|
|
|
-})
|
|
|
|
|
-
|
|
|
|
|
const HOSTNAME = require('os').hostname()
|
|
const HOSTNAME = require('os').hostname()
|
|
|
|
|
|
|
|
const JOI_OBJECT_ID = Joi.string()
|
|
const JOI_OBJECT_ID = Joi.string()
|
|
@@ -122,15 +111,13 @@ module.exports = Router = {
|
|
|
|
|
|
|
|
app.post(
|
|
app.post(
|
|
|
'/project/:project_id/message/:message',
|
|
'/project/:project_id/message/:message',
|
|
|
- httpAuth,
|
|
|
|
|
bodyParser.json({ limit: '5mb' }),
|
|
bodyParser.json({ limit: '5mb' }),
|
|
|
HttpApiController.sendMessage
|
|
HttpApiController.sendMessage
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
- app.post('/drain', httpAuth, HttpApiController.startDrain)
|
|
|
|
|
|
|
+ app.post('/drain', HttpApiController.startDrain)
|
|
|
app.post(
|
|
app.post(
|
|
|
'/client/:client_id/disconnect',
|
|
'/client/:client_id/disconnect',
|
|
|
- httpAuth,
|
|
|
|
|
HttpApiController.disconnectClient
|
|
HttpApiController.disconnectClient
|
|
|
)
|
|
)
|
|
|
|
|
|