From ee1a56caae1d3eff5a70886ccb6b1a53c407d3dd Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Mon, 5 Dec 2022 18:18:19 +0800 Subject: [PATCH] Update /test-webhook and reevaluate sensitive fields --- server/model/monitor.js | 18 +++++++++--------- server/server.js | 1 + 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/server/model/monitor.js b/server/model/monitor.js index b6123382a..00eb87dbb 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -89,32 +89,23 @@ class Monitor extends BeanModel { dns_resolve_type: this.dns_resolve_type, dns_resolve_server: this.dns_resolve_server, dns_last_result: this.dns_last_result, - pushToken: this.pushToken, docker_container: this.docker_container, docker_host: this.docker_host, proxyId: this.proxy_id, notificationIDList, tags: tags, maintenance: await Monitor.isUnderMaintenance(this.id), - mqttUsername: this.mqttUsername, - mqttPassword: this.mqttPassword, mqttTopic: this.mqttTopic, mqttSuccessMessage: this.mqttSuccessMessage, - databaseConnectionString: this.databaseConnectionString, databaseQuery: this.databaseQuery, authMethod: this.authMethod, - authWorkstation: this.authWorkstation, - authDomain: this.authDomain, grpcUrl: this.grpcUrl, grpcProtobuf: this.grpcProtobuf, grpcMethod: this.grpcMethod, grpcServiceName: this.grpcServiceName, grpcEnableTls: this.getGrpcEnableTls(), - radiusUsername: this.radiusUsername, - radiusPassword: this.radiusPassword, radiusCalledStationId: this.radiusCalledStationId, radiusCallingStationId: this.radiusCallingStationId, - radiusSecret: this.radiusSecret, }; if (includeSensitiveData) { @@ -127,9 +118,18 @@ class Monitor extends BeanModel { basic_auth_user: this.basic_auth_user, basic_auth_pass: this.basic_auth_pass, pushToken: this.pushToken, + databaseConnectionString: this.databaseConnectionString, + radiusUsername: this.radiusUsername, + radiusPassword: this.radiusPassword, + radiusSecret: this.radiusSecret, + mqttUsername: this.mqttUsername, + mqttPassword: this.mqttPassword, + authWorkstation: this.authWorkstation, + authDomain: this.authDomain, }; } + data.includeSensitiveData = includeSensitiveData; return data; } diff --git a/server/server.js b/server/server.js index 4d9cdb180..033b85b20 100644 --- a/server/server.js +++ b/server/server.js @@ -203,6 +203,7 @@ let needSetup = false; if (isDev) { app.post("/test-webhook", async (request, response) => { + log.debug("test", request.headers); log.debug("test", request.body); response.send("OK"); });