basyx's picture
Upload 236 files
e1104b3 verified
Raw
History Blame Contribute Delete
697 Bytes
from __future__ import annotations
from abc import ABC, abstractmethod
from datetime import datetime
from typing import Any
from pydantic import BaseModel, ConfigDict
class NormalizedWebhookEvent(BaseModel):
model_config = ConfigDict(extra="forbid")
provider: str
event_type: str
external_event_id: str
workspace_id: str | None = None
payload: dict[str, Any]
received_at: datetime
class SocialWebhookAdapter(ABC):
provider: str
@abstractmethod
async def verify_and_normalize(
self, *, headers: dict[str, str], body: bytes
) -> list[NormalizedWebhookEvent]:
"""Verify the provider signature before returning normalized events."""