Merge pull request #465 from shocknet/small-fixes-sep-6
Small fixes sep 6
This commit is contained in:
commit
1270ff5603
4 changed files with 21 additions and 11 deletions
10
.vscode/settings.json
vendored
10
.vscode/settings.json
vendored
|
|
@ -4,5 +4,13 @@
|
|||
"debug.node.autoAttach": "on",
|
||||
"editor.formatOnSave": true,
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"cSpell.words": ["Epub", "GUNRPC", "ISEA", "PUBKEY", "Reqs", "uuidv"]
|
||||
"cSpell.words": [
|
||||
"Epub",
|
||||
"falsey",
|
||||
"GUNRPC",
|
||||
"ISEA",
|
||||
"PUBKEY",
|
||||
"Reqs",
|
||||
"uuidv"
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,15 +53,13 @@ const deepDecryptIfNeeded = async (value, publicKey, epubForDecryption) => {
|
|||
if (user.is.pub === publicKey || 'me' === publicKey) {
|
||||
sec = getMySecret()
|
||||
} else {
|
||||
sec = await SEA.secret(
|
||||
await (() => {
|
||||
if (epubForDecryption) {
|
||||
return epubForDecryption
|
||||
let epub = epubForDecryption
|
||||
|
||||
if (!epub) {
|
||||
epub = await pubToEpub(publicKey)
|
||||
}
|
||||
return pubToEpub(publicKey)
|
||||
})(),
|
||||
user._.sea
|
||||
)
|
||||
|
||||
sec = await SEA.secret(epub, user._.sea)
|
||||
}
|
||||
|
||||
const decrypted = SEA.decrypt(value, sec)
|
||||
|
|
|
|||
|
|
@ -2380,7 +2380,7 @@ module.exports = async (
|
|||
return new Promise((res, rej) => {
|
||||
const listener = data => {
|
||||
logger.info(`got res for: ${keys}`)
|
||||
logger.info(data)
|
||||
logger.info(data || 'falsey data (does not get logged)')
|
||||
if (publicKeyForDecryption) {
|
||||
GunWriteRPC.deepDecryptIfNeeded(
|
||||
data,
|
||||
|
|
|
|||
|
|
@ -47,6 +47,10 @@ module.exports = (
|
|||
*/
|
||||
|
||||
try {
|
||||
logger.info(
|
||||
'Connect event for socket with handshake: ',
|
||||
socket.handshake.auth
|
||||
)
|
||||
if (!isAuthenticated()) {
|
||||
socket.emit(Common.Constants.ErrorCode.NOT_AUTH)
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue