feat(02-03): add MediaAttachment model, WhatsApp normalizer, and signature verification

- Add MediaType(StrEnum) and MediaAttachment(BaseModel) to shared/models/message.py
- Add media: list[MediaAttachment] field to MessageContent
- Add whatsapp_app_secret, whatsapp_verify_token, and MinIO settings to shared/config.py
- Add normalize_whatsapp_event() to gateway/normalize.py (text, image, document support)
- Create whatsapp.py adapter with verify_whatsapp_signature() and verify_hub_challenge()
- 30 new passing tests (signature verification + normalizer)
This commit is contained in:
2026-03-23 14:41:48 -06:00
parent b2e86f1046
commit 370a860622
7 changed files with 1987 additions and 3 deletions

View File

@@ -65,6 +65,38 @@ class Settings(BaseSettings):
description="Slack app-level token for Socket Mode (xapp-...)",
)
# -------------------------------------------------------------------------
# WhatsApp
# -------------------------------------------------------------------------
whatsapp_app_secret: str = Field(
default="",
description="WhatsApp app secret for HMAC-SHA256 webhook signature verification",
)
whatsapp_verify_token: str = Field(
default="",
description="WhatsApp webhook verification token (hub.verify_token)",
)
# -------------------------------------------------------------------------
# MinIO / Object Storage
# -------------------------------------------------------------------------
minio_endpoint: str = Field(
default="http://localhost:9000",
description="MinIO endpoint URL (S3-compatible)",
)
minio_access_key: str = Field(
default="minioadmin",
description="MinIO access key",
)
minio_secret_key: str = Field(
default="minioadmin",
description="MinIO secret key",
)
minio_media_bucket: str = Field(
default="konstruct-media",
description="MinIO bucket name for media attachments",
)
# -------------------------------------------------------------------------
# LLM Providers
# -------------------------------------------------------------------------