MCPcopy Create free account
hub / github.com/TheSecuredAnalyst/security-suite / _format_payload

Method _format_payload

modules/siem/webhook.py:70–79  ·  view source on GitHub ↗

Format event payload based on target format.

(self, event: SIEMEvent)

Source from the content-addressed store, hash-verified

68 def _format_payload(self, event: SIEMEvent) -> dict:
69 """Format event payload based on target format."""
70 if self.format == "slack":
71 return self._format_slack(event)
72 elif self.format == "discord":
73 return self._format_discord(event)
74 elif self.format == "pagerduty":
75 return self._format_pagerduty(event)
76 else:
77 return event.to_dict()
78
79 def _format_slack(self, event: SIEMEvent) -> dict:
80 """Format as Slack message."""
81 color_map = {
82 "critical": "#FF0000",

Callers 1

exportMethod · 0.95

Calls 4

_format_slackMethod · 0.95
_format_discordMethod · 0.95
_format_pagerdutyMethod · 0.95
to_dictMethod · 0.45

Tested by

no test coverage detected