Every IM platform calls a public, unauthenticated endpoint - the callback URL
cannot carry a bearer token - and each platform's signature is computed over the
request body, so the bytes have to be read before the request can be
authenticated at all. Each adapter read c.Request.Body with an unbounded
io.ReadAll, so a single unauthenticated POST decided how much memory the
process would allocate.
Add LimitWebhookBody to the shared internal/im package, mirroring how
internal/handler caps uploads and JSON bodies on the authenticated routes, and
call it ahead of all fifteen reads across the eight adapters. Nine of those
reads sit in VerifyCallback or HandleURLVerification, ahead of the credential
check; the rest parse the payload afterwards.
The cap is 4 MiB, far above any real callback: chat messages, interactive cards
and block payloads are kilobytes, and attachments travel as URLs the server
fetches separately under maxIMAttachmentBytes.