Implement a POST /acquia-dam/webhook endpoint that processes key DAM webhook events synchronously and immediately. This keeps media entities in Drupal aligned with DAM state within seconds.

The endpoint must handle the three key event types inline in the controller, not through a queue. This removes dependency on cron frequency for actionable events and avoids duplicate queue entries between the webhook path and the cron polling path.

Acceptance criteria

  • Route acquia_dam_webhooks.webhook_receiver at POST /acquia-dam/webhook with _access: TRUE, _auth: []
  • Flood control: 200 req / 15 min per IP → HTTP 429 (FLOOD_EVENT = 'acquia_dam_webhooks.webhook_receive')
  • Empty body → 400
  • Malformed JSON or missing event_type → 400
  • webhook_signature_required = TRUE: HMAC validated → 401 on failure (optional)
  • webhook_signature_required = FALSE: HMAC skipped; notice logged on every request (optional)
  • ping → 200 immediately, no queue item
  • Missing asset_id → 400
  • asset_deleted + webhook_unpublish_on_delete = TRUE → unpublish referencing media entities inline, return 200 (no queue)
  • asset_deleted + webhook_unpublish_on_delete = FALSE → log + no-op, return 200
  • asset_metadata_value_updated → call AssetMediaSyncService::syncAsset() for each referencing media entity inline, return 200 (no queue)
  • asset_version_added → same as asset_metadata_value_updated
  • asset_created and all other known/unknown events → pushed to acquia_dam_webhook_events queue → 200
  • Injects acquia_dam.asset_media_sync service; no dependency on queue worker plugin manager
  • Config reads from acquia_dam_webhooks.settings (not acquia_dam.settings)
  • hook_install: auto-registers if parent token already set and webhook_enabled = TRUE
  • hook_uninstall: best-effort deregisterAll() + deletes all acquia_dam_webhooks.* State keys

Issue fork acquia_dam-3611280

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

rajeshreeputra created an issue. See original summary.

  • rajeshreeputra committed 39e9f3c7 on 1.1.x-webhook
    Resolve #3611280 "Create webhook receiver endpoint for real-time asset...
rajeshreeputra’s picture

Assigned: rajeshreeputra » Unassigned
Status: Active » Fixed

MR merged!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • rajeshreeputra committed 882173a0 on 1.1.x-webhook
    Resolve #3611280 "Create webhook receiver endpoint for real-time asset...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.