-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support webhook updates #9
Comments
Some work for this has already been done in https://github.com/coyote-team/coyote-drupal-8/blob/develop/src/Controller/RestApiController.php |
@catorghans given our conversation a while ago on the webhook payload I created issue coyote-team/coyote#659 on the Coyote server side. Having looked into its implementation, it actually makes sense - when a resource or a related representation gets modified, the server posts the entirety of the modified resource model towards the webhook, including all its representations. This means that when a resource's name gets modified, this also happens. There is (currently) no metadata in this payload regarding what change triggered the webhook call. On the Drupal-side, the only representation we're really interested in is the "top representation by metum", which is already handled by the Rest API hook handler. Given this, I would posit that the response to a webhook call can be idempotent: the hook code takes the top representation value — content notwithstanding — and updates it locally. For efficiency's sake there could be a string compare (and accompanying info log message) since that would save a potential cache invalidation. What do you think? |
This item is currently blocked on coyote-team/coyote#659. For now, the module will grab the top representation for its metum from within the serialised resource payload that gets posted to the module callback. |
When a resource on the Coyote side is managed using a webhook which posts to a Drupal website running the module, the module should expose an API endpoint which can receive Coyote's
POST
payloads. When a valid resource update comes through, this should cause the module to update its own information about the resource.The text was updated successfully, but these errors were encountered: