events & global sync. unstable

This commit is contained in:
unexpected committed 2025-10-15 16:57:21 +00:00
1 parent 77921ba6a8
commit f140181c45
21 files changed
+1196 -31

No files matched your search

+8 -2
View File
@@ -62,9 +62,15 @@ def verify_request(request, memory) -> Tuple[bool, str, str]:
import nacl.signing
vk = nacl.signing.VerifyKey(b58decode(node_id))
sig = b58decode(sig_b58)
msg = canonical_string(request.method, request.path, request.body or b"", ts, nonce, node_id)
path = request.path
query_string = getattr(request, 'query_string', None)
if query_string:
if not isinstance(query_string, str):
query_string = query_string.decode() if isinstance(query_string, bytes) else str(query_string)
if query_string:
path = f"{path}?{query_string}"
msg = canonical_string(request.method, path, request.body or b"", ts, nonce, node_id)
vk.verify(msg, sig)
return True, node_id, ""
except Exception as e:
return False, "", f"BAD_SIGNATURE: {e}"