Update /test-webhook and reevaluate sensitive fields

pull/1920/head
Louis Lam 2 years ago
parent e886df4788
commit ee1a56caae

@ -89,32 +89,23 @@ class Monitor extends BeanModel {
dns_resolve_type: this.dns_resolve_type, dns_resolve_type: this.dns_resolve_type,
dns_resolve_server: this.dns_resolve_server, dns_resolve_server: this.dns_resolve_server,
dns_last_result: this.dns_last_result, dns_last_result: this.dns_last_result,
pushToken: this.pushToken,
docker_container: this.docker_container, docker_container: this.docker_container,
docker_host: this.docker_host, docker_host: this.docker_host,
proxyId: this.proxy_id, proxyId: this.proxy_id,
notificationIDList, notificationIDList,
tags: tags, tags: tags,
maintenance: await Monitor.isUnderMaintenance(this.id), maintenance: await Monitor.isUnderMaintenance(this.id),
mqttUsername: this.mqttUsername,
mqttPassword: this.mqttPassword,
mqttTopic: this.mqttTopic, mqttTopic: this.mqttTopic,
mqttSuccessMessage: this.mqttSuccessMessage, mqttSuccessMessage: this.mqttSuccessMessage,
databaseConnectionString: this.databaseConnectionString,
databaseQuery: this.databaseQuery, databaseQuery: this.databaseQuery,
authMethod: this.authMethod, authMethod: this.authMethod,
authWorkstation: this.authWorkstation,
authDomain: this.authDomain,
grpcUrl: this.grpcUrl, grpcUrl: this.grpcUrl,
grpcProtobuf: this.grpcProtobuf, grpcProtobuf: this.grpcProtobuf,
grpcMethod: this.grpcMethod, grpcMethod: this.grpcMethod,
grpcServiceName: this.grpcServiceName, grpcServiceName: this.grpcServiceName,
grpcEnableTls: this.getGrpcEnableTls(), grpcEnableTls: this.getGrpcEnableTls(),
radiusUsername: this.radiusUsername,
radiusPassword: this.radiusPassword,
radiusCalledStationId: this.radiusCalledStationId, radiusCalledStationId: this.radiusCalledStationId,
radiusCallingStationId: this.radiusCallingStationId, radiusCallingStationId: this.radiusCallingStationId,
radiusSecret: this.radiusSecret,
}; };
if (includeSensitiveData) { if (includeSensitiveData) {
@ -127,9 +118,18 @@ class Monitor extends BeanModel {
basic_auth_user: this.basic_auth_user, basic_auth_user: this.basic_auth_user,
basic_auth_pass: this.basic_auth_pass, basic_auth_pass: this.basic_auth_pass,
pushToken: this.pushToken, 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; return data;
} }

@ -203,6 +203,7 @@ let needSetup = false;
if (isDev) { if (isDev) {
app.post("/test-webhook", async (request, response) => { app.post("/test-webhook", async (request, response) => {
log.debug("test", request.headers);
log.debug("test", request.body); log.debug("test", request.body);
response.send("OK"); response.send("OK");
}); });

Loading…
Cancel
Save