Get request headers.
(self)
| 53 | def _get_headers(self) -> dict: |
| 54 | """Get request headers.""" |
| 55 | headers = { |
| 56 | "Content-Type": "application/json", |
| 57 | **self.custom_headers, |
| 58 | } |
| 59 | |
| 60 | if self.auth_token: |
| 61 | if self.format == "pagerduty": |
| 62 | headers["Authorization"] = f"Token token={self.auth_token}" |
| 63 | else: |
| 64 | headers[self.auth_header] = f"Bearer {self.auth_token}" |
| 65 | |
| 66 | return headers |
| 67 | |
| 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) |
no outgoing calls