fix: accept VK confirmation callback without secret

This commit is contained in:
nyan404 committed 2026-10-10 21:34:58 +03:00
1 parent 835be75049
commit e0e1e4f6bd
5 files changed
+9 -9

No files matched your search

+2 -2
View File
@@ -35,8 +35,6 @@ def process_callback(
The function returns a response before the caller writes it to the socket,
which keeps HTTP transport concerns separate from bot event processing.
"""
if expected_secret and secret != expected_secret:
return CallbackResponse(403, "forbidden")
if not isinstance(payload, dict):
return CallbackResponse(400, "invalid payload")
if int(payload.get("group_id", 0) or 0) != int(group_id):
@@ -47,6 +45,8 @@ def process_callback(
if not confirmation:
return CallbackResponse(503, "confirmation is not configured")
return CallbackResponse(200, confirmation)
if expected_secret and secret != expected_secret:
return CallbackResponse(403, "forbidden")
event_id = payload.get("event_id")
if event_id is None and isinstance(payload.get("object"), dict):