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_createdfilter section only visible whenasset_createdis inwebhook_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: readsacquia_dam_webhooks.settings; 24h sync viaWebhookManager::syncFromDam(); usesacquia_dam_webhooks.webhook_last_syncState keyhook_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
- Pre-submit:
Config (acquia_dam_webhooks.settings):
webhook_enabled(bool, defaultfalse)webhook_event_types(sequence) — list of enabled event typeswebhook_asset_created_allow_all(bool, defaultfalse) — process everyasset_createdevent without group/type filterwebhook_asset_created_groups(mapping) —{uuid: {name: string, media_types: [bundle_ids]}}, default emptywebhook_sync_frequency(int, default86400)
Issue fork acquia_dam-3611283
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
Comment #3
rajeshreeputraComment #4
rajeshreeputraComment #5
rajeshreeputraRequesting review.
Comment #7
rajeshreeputraMR merged!