iachat/enterprise/app/models/enterprise
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
..
account fix: disable email transcript for free plans (#13509) 2026-02-11 21:21:36 +05:30
audit feat: sign webhooks for API channel and agentbots (#13892) 2026-04-06 15:28:25 +05:30
concerns feat: Conversation workflows(EE) (#13040) 2026-01-27 11:36:20 +04:00
account_user.rb feat: Add APIs to manage custom roles in Chatwoot (#9995) 2024-08-23 17:18:28 +05:30
account.rb fix: V2 Assignment service enhancements (#13036) 2026-02-11 12:24:45 +05:30
activity_message_handler.rb feat: captain decides if conversation should be resolved or kept open (#13336) 2026-03-13 10:03:58 +05:30
application_record.rb feat: Add push/email notification support for SLA (#9140) 2024-03-29 20:27:21 +11:00
audit_log.rb chore: Refactor Response Bot Data Schema (#8011) 2023-10-01 19:31:38 -07:00
automation_rule.rb feat: sla-2 add automation backend support for SLA (#8775) 2024-02-01 15:42:12 +05:30
channelable.rb feat: sign webhooks for API channel and agentbots (#13892) 2026-04-06 15:28:25 +05:30
conversation.rb feat: captain decides if conversation should be resolved or kept open (#13336) 2026-03-13 10:03:58 +05:30
inbox_agent_availability.rb fix: resolve V2 capacity bypass in team assignment (#13904) 2026-03-27 15:38:17 +05:30
inbox.rb fix: resolve V2 capacity bypass in team assignment (#13904) 2026-03-27 15:38:17 +05:30
message.rb fix: skip captain auto-open for templates (#13802) 2026-03-16 18:54:12 +05:30