querysub 0.411.0 → 0.412.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -147,13 +147,16 @@ class IdentityControllerBase {
|
|
|
147
147
|
if (!areNodeIdsEqual(payload.serverId, localNodeId)) {
|
|
148
148
|
throw new Error(`Identity is for another server! The connection is calling us ${localNodeId}, but signature is for ${payload.serverId}`);
|
|
149
149
|
}
|
|
150
|
-
|
|
151
|
-
if (
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
150
|
+
// If they're calling from the browser, then they're not going to be able to use our machine ID, etc. However, they should be calling an actual https node, so it should still be secure for them.
|
|
151
|
+
if (payload.clientIsNode) {
|
|
152
|
+
let calledMachineId = getMachineId(payload.serverId);
|
|
153
|
+
if (calledMachineId !== "127-0-0-1" && calledMachineId !== getOwnMachineId()) {
|
|
154
|
+
throw new Error(`Tried to call a different machine. We are ${getOwnMachineId()}, they called ${calledMachineId}`);
|
|
155
|
+
}
|
|
156
|
+
let calledThreadId = decodeNodeId(payload.serverId)?.threadId;
|
|
157
|
+
if (calledThreadId && calledThreadId !== "127-0-0-1" && calledThreadId !== getOwnThreadId()) {
|
|
158
|
+
throw new Error(`Tried to call a different thread. We are ${getOwnThreadId()}, they called ${calledThreadId}`);
|
|
159
|
+
}
|
|
157
160
|
}
|
|
158
161
|
|
|
159
162
|
|