iachat/enterprise/app
Shivam Mishra 95463230cb
feat: sign webhooks for API channel and agentbots (#13892)
Account webhooks sign outgoing payloads with HMAC-SHA256, but agent bot
and API inbox webhooks were delivered unsigned. This PR adds the same
signing to both.

Each model gets a dedicated `secret` column rather than reusing the
agent bot's `access_token` (for API auth back into Chatwoot) or the API
inbox's `hmac_token` (for inbound contact identity verification). These
serve different trust boundaries and shouldn't be coupled — rotating a
signing secret shouldn't invalidate API access or contact verification.

The existing `Webhooks::Trigger` already signs when a secret is present,
so the backend change is just passing `secret:` through to the jobs.
Shared token logic is extracted into a `WebhookSecretable` concern
included by `Webhook`, `AgentBot`, and `Channel::Api`. The frontend
reuses the existing `AccessToken` component for secret display. Secrets
are admin-only and excluded from enterprise audit logs.

### How to test

Point an agent bot or API inbox webhook URL at a request inspector. Send
a message and verify `X-Chatwoot-Signature` and `X-Chatwoot-Timestamp`
headers are present. Reset the secret from settings and confirm
subsequent deliveries use the new value.

---------

Co-authored-by: Sojan Jose <sojan@pepalo.com>
2026-04-06 15:28:25 +05:30
..
builders fix: restrict existing user sign-in to account members (#13793) 2026-03-13 12:22:25 +05:30
controllers fix: strip manually_managed_features from params in super admin account create (#13983) 2026-04-02 19:58:43 +05:30
dispatchers/enterprise feat(ee): Add Captain features (#10665) 2025-01-14 16:15:47 -08:00
drops feat: Add push/email notification support for SLA (#9140) 2024-03-29 20:27:21 +11:00
fields fix: Render all account limit fields (#13435) 2026-02-04 20:21:07 +05:30
finders/enterprise feat: Conversation API to return applied_sla and sla_events (#9174) 2024-04-01 23:30:07 +05:30
helpers feat: allow captain to access contact attributes (#13850) 2026-03-20 16:15:06 +05:30
jobs fix: handoff only if conversation pending (#13882) 2026-03-23 17:09:58 +05:30
listeners feat: Add support for realtime-events in copilot-threads and copilot-messages (#11557) 2025-05-22 22:25:05 -07:00
mailers/enterprise/agent_notifications chore: fix sla email notifications (#9192) 2024-04-04 21:16:49 +05:30
models feat: sign webhooks for API channel and agentbots (#13892) 2026-04-06 15:28:25 +05:30
policies feat: captain custom tools v1 (#13890) 2026-04-02 12:40:11 +05:30
presenters/enterprise/conversations feat: UI to show the SLA threshold in chat screen (#9146) 2024-04-04 15:46:46 +05:30
services feat: captain custom tools v1 (#13890) 2026-04-02 12:40:11 +05:30
views feat: captain custom tools v1 (#13890) 2026-04-02 12:40:11 +05:30