badmfck-api-server 2.4.5 → 2.4.7
Sign up to get free protection for your applications and to get access to all the features.
@@ -26,6 +26,7 @@ class HUBService extends BaseService_1.BaseService {
|
|
26
26
|
path: "/hub"
|
27
27
|
});
|
28
28
|
wss.on("connection", (ws) => {
|
29
|
+
(0, LogService_1.logInfo)("HUBService: new connection on wss server");
|
29
30
|
const conn = new HUBConnection_1.HUBConnection({
|
30
31
|
ws: ws,
|
31
32
|
privateKey: this.options.hubPrivateKey,
|
@@ -62,6 +62,7 @@ class HUBConnection {
|
|
62
62
|
this.ws.on("open", () => {
|
63
63
|
(0, LogService_1.logInfo)("HUBConnection: connection opened");
|
64
64
|
if (options.authorized) {
|
65
|
+
(0, LogService_1.logInfo)("HUBConnection: connection authorized");
|
65
66
|
if (this.onAuthorized)
|
66
67
|
this.onAuthorized();
|
67
68
|
}
|
@@ -163,6 +164,7 @@ class HUBConnection {
|
|
163
164
|
}, options.maxTimeout || 1000 * 60 * 15);
|
164
165
|
}
|
165
166
|
async authorize(data) {
|
167
|
+
(0, LogService_1.logInfo)("HUBConnection: try to authorize connection", data);
|
166
168
|
if (typeof data !== "object" || !data || !data.signature || !data.publicKey || !data.clientID || !data.url)
|
167
169
|
return { ...DefaultErrors_1.default.BAD_REQUEST, details: "invalid data, expected {signature:encrypted hub key,publicKey:encrypted public key, clientID:clientID,url: service url}" };
|
168
170
|
let hubKey = null;
|