Problem/Motivation

As a site administrator, I want a webhook management UI, automated hook wiring, and configurable asset_created filtering, so that I can manage webhooks through the admin interface and control which new DAM uploads automatically create Drupal media entities.

Acceptance Criteria

Admin Settings Form (/admin/config/acquia-dam/webhooks, tab on parent admin page):

  • Reads/writes acquia_dam_webhooks.settings
  • Checkboxes: webhook_enabled
  • Event type selection: checkboxes for each supported event type
  • Read-only delivery URL; dev/staging private-IP warning banner
  • Status table of registered IDs; prerequisite notice
  • Action buttons: Register, Sync from DAM, Ping All, Deregister All
  • asset_created filter section only visible when asset_created is in webhook_event_types
  • Checkbox: "Allow all asset processing" — when checked, hides group selection
  • When unchecked: group selection table (Add/Remove rows, same pattern as BulkImportConfigForm)
    • Asset Groups source only (V1; categories deferred to V2)
    • Groups loaded from getAssetGroups() API, displayed as select, keyed by UUID
    • Per group: media type checkboxes from Acquia DAM-sourced media bundles
    • Empty media_types = all types allowed for that group
  • Form validation: if "Allow all" unchecked and no groups configured → block submit with error
  • Config stored as {uuid: {name: string, media_types: [...]}} — UUID for stability, name stored for display without extra API call

Hook Wiring (submodule .module / .install):

  • hook_cron: reads acquia_dam_webhooks.settings; 24h sync via WebhookManager::syncFromDam(); uses acquia_dam_webhooks.webhook_last_sync State key
  • hook_form_acquia_dam_config_alter: injects pre/post submit handlers for credential rotation — parent form has zero webhook knowledge
    • Pre-submit: deregisterAll() while old token valid
    • Post-submit: register() with new token; failure → admin messenger link to /admin/config/acquia-dam/webhooks

Config (acquia_dam_webhooks.settings):

  • webhook_enabled (bool, default false)
  • webhook_event_types (sequence) — list of enabled event types
  • webhook_asset_created_allow_all (bool, default false) — process every asset_created event without group/type filter
  • webhook_asset_created_groups (mapping) — {uuid: {name: string, media_types: [bundle_ids]}}, default empty
  • webhook_sync_frequency (int, default 86400)

Issue fork acquia_dam-3611283

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’s picture

Issue summary: View changes
rajeshreeputra’s picture

Issue summary: View changes
Status: Active » Needs work
rajeshreeputra’s picture

Assigned: rajeshreeputra » Unassigned
Status: Needs work » Needs review

Requesting review.

  • rajeshreeputra committed d0178dad on 1.1.x-webhook
    Resolve #3611283 "Config form UI, Hook Wiring and Drush CLI."
    
rajeshreeputra’s picture

Status: Needs review » 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.

Status: Fixed » Closed (fixed)

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