From 32cc66fad404aed6a7a5a1bb04d3c4ff05b9ee0c Mon Sep 17 00:00:00 2001 From: emad-salah Date: Mon, 17 Feb 2020 22:24:14 +0100 Subject: [PATCH 1/4] Bug fixes --- services/auth/secrets.json | 10 +++++++++- services/gunDB/Mediator/index.js | 14 +++++++------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/services/auth/secrets.json b/services/auth/secrets.json index 0967ef42..8fce8ee3 100644 --- a/services/auth/secrets.json +++ b/services/auth/secrets.json @@ -1 +1,9 @@ -{} +{ + "1581957394733": "a92254e0-51a3-11ea-b10f-df8508e8b603", + "1581957773885": "8b202ed0-51a4-11ea-a0c5-5badab33daa8", + "1581958187220": "817e4050-51a5-11ea-bcd5-7f4db8cfd5a0", + "1581958393289": "fc51bb90-51a5-11ea-bb3c-2f0cf8e3df45", + "1581959300216": "18e3cf80-51a8-11ea-85bc-9131669d4e54", + "1581960697002": "597070a0-51ab-11ea-be48-7961189fa60f", + "1581961830350": "fcf79ee0-51ad-11ea-884e-bb0b313d8e64" +} diff --git a/services/gunDB/Mediator/index.js b/services/gunDB/Mediator/index.js index 31c8d2ae..94161aad 100644 --- a/services/gunDB/Mediator/index.js +++ b/services/gunDB/Mediator/index.js @@ -792,7 +792,7 @@ class Mediator { try { const { token } = body - console.log('ON_CHATS', body) + // console.log('ON_CHATS', body) await throwOnInvalidToken(token) @@ -894,9 +894,9 @@ class Mediator { API.Events.onSimplerReceivedRequests(receivedRequests => { if (Config.SHOW_LOG) { - console.log('---receivedRequests---') - console.log(receivedRequests) - console.log('-----------------------') + // console.log('---receivedRequests---') + // console.log(receivedRequests) + // console.log('-----------------------') } this.socket.emit(Event.ON_RECEIVED_REQUESTS, { @@ -931,9 +931,9 @@ class Mediator { API.Events.onSimplerSentRequests( debounce(sentRequests => { - console.log( - `new Reqss in mediator: ${JSON.stringify(sentRequests)}` - ) + // console.log( + // `new Reqss in mediator: ${JSON.stringify(sentRequests)}` + // ) this.socket.emit(Event.ON_SENT_REQUESTS, { msg: sentRequests, ok: true, From ca047a4441827fb5ad99784c7c587b9f8a3e5db6 Mon Sep 17 00:00:00 2001 From: Emad-salah Date: Mon, 17 Feb 2020 22:59:58 +0100 Subject: [PATCH 2/4] Revert `secrets.json` --- services/auth/secrets.json | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/services/auth/secrets.json b/services/auth/secrets.json index 8fce8ee3..0967ef42 100644 --- a/services/auth/secrets.json +++ b/services/auth/secrets.json @@ -1,9 +1 @@ -{ - "1581957394733": "a92254e0-51a3-11ea-b10f-df8508e8b603", - "1581957773885": "8b202ed0-51a4-11ea-a0c5-5badab33daa8", - "1581958187220": "817e4050-51a5-11ea-bcd5-7f4db8cfd5a0", - "1581958393289": "fc51bb90-51a5-11ea-bb3c-2f0cf8e3df45", - "1581959300216": "18e3cf80-51a8-11ea-85bc-9131669d4e54", - "1581960697002": "597070a0-51ab-11ea-be48-7961189fa60f", - "1581961830350": "fcf79ee0-51ad-11ea-884e-bb0b313d8e64" -} +{} From 38dabe850b582616b01ea388f83b0add9e8a9f4e Mon Sep 17 00:00:00 2001 From: Daniel Lugo Date: Mon, 17 Feb 2020 19:15:14 -0400 Subject: [PATCH 3/4] IS_GUN_AUTH event should not be encrypted --- utils/encryptionStore.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/encryptionStore.js b/utils/encryptionStore.js index 6505c0cb..d00e93de 100644 --- a/utils/encryptionStore.js +++ b/utils/encryptionStore.js @@ -6,7 +6,7 @@ const { Buffer } = require('buffer') const APIKeyPair = new Map() const authorizedDevices = new Map() -const nonEncryptedEvents = ['ping', 'disconnect'] +const nonEncryptedEvents = ['ping', 'disconnect', 'IS_GUN_AUTH'] const Encryption = { isNonEncrypted: event => nonEncryptedEvents.includes(event), From 43013d5e8dcc67b1e47095ec4ceb057ffa0abbc9 Mon Sep 17 00:00:00 2001 From: Daniel Lugo Date: Mon, 17 Feb 2020 20:00:43 -0400 Subject: [PATCH 4/4] no pesky gun log --- services/gunDB/Mediator/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/services/gunDB/Mediator/index.js b/services/gunDB/Mediator/index.js index 94161aad..e25240c8 100644 --- a/services/gunDB/Mediator/index.js +++ b/services/gunDB/Mediator/index.js @@ -2,6 +2,7 @@ * @format */ const Gun = require('gun') +Gun.log = () => {} // @ts-ignore require('gun/lib/open') const debounce = require('lodash/debounce')