MCPcopy Create free account
hub / github.com/blacklanternsecurity/bbot / handle_event

Method handle_event

bbot/modules/output/http.py:52–73  ·  view source on GitHub ↗
(self, event)

Source from the content-addressed store, hash-verified

50 return True
51
52 async def handle_event(self, event):
53 while 1:
54 response = await self.helpers.request(
55 url=self.url,
56 method=self.method,
57 auth=self.auth,
58 headers=self.headers,
59 json=event.json(siem_friendly=self.siem_friendly),
60 )
61 is_success = False if response is None else response.is_success
62 if not is_success:
63 status_code = getattr(response, "status_code", 0)
64 self.warning(f"Error sending {event} (HTTP status code: {status_code}), retrying...")
65 body = getattr(response, "text", "")
66 self.debug(body)
67 if status_code == 429:
68 sleep_interval = 10
69 else:
70 sleep_interval = 1
71 await self.helpers.sleep(sleep_interval)
72 continue
73 break

Callers

nothing calls this directly

Calls 4

requestMethod · 0.45
jsonMethod · 0.45
warningMethod · 0.45
debugMethod · 0.45

Tested by

no test coverage detected