mirror of
https://github.com/beenuar/AiSOC.git
synced 2026-11-24 08:35:46 +08:00
fix(connectors): T4.1 cloudflare_zt trusts cursor over short-page heuristic
The wave-2 pagination loop terminated on ``not cursor or len(events) < _PER_PAGE``. Cloudflare's new security-events endpoint routinely returns a ``result_info.cursor`` even when a page comes back short, so the short-page heuristic was clobbering legitimate continuations and dropping every-other event. Drop the page-size check; trust the cursor as the authoritative end-of-stream signal. The wave-2 pagination test now sees both pages (3 + 1 = 4 events) instead of stopping after page 1. Refs: AiSOC v8.0 wave-2 stabilization Signed-off-by: Prince Sinha <prince.sinha@cyble.com>
This commit is contained in:
@@ -214,12 +214,13 @@ class CloudflareZTConnector(BaseConnector):
|
||||
for ev in events:
|
||||
out.append(self.normalize(ev))
|
||||
# Cloudflare returns ``result_info.cursor`` for keyset paging
|
||||
# on the new security events endpoint, and a classic page
|
||||
# counter for older endpoints. Both terminate when the cursor
|
||||
# disappears or the page is short.
|
||||
# on the new security events endpoint. When the cursor is
|
||||
# present the server is telling us there is more — trust it
|
||||
# even if this page came back short. The cursor going empty
|
||||
# is the authoritative end-of-stream signal.
|
||||
info = body.get("result_info") or {}
|
||||
cursor = info.get("cursor") or info.get("next_cursor")
|
||||
if not cursor or len(events) < _PER_PAGE:
|
||||
if not cursor:
|
||||
break
|
||||
return out
|
||||
|
||||
|
||||
Reference in New Issue
Block a user