Skip to content
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

Open
jkva opened this issue Oct 17, 2022 · 3 comments
Open

Support webhook updates #9

jkva opened this issue Oct 17, 2022 · 3 comments
Milestone

Comments

@jkva
Copy link
Collaborator

jkva commented Oct 17, 2022

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.

@jkva jkva added this to the First release milestone Oct 17, 2022
@jkva
Copy link
Collaborator Author

jkva commented Oct 17, 2022

@jkva
Copy link
Collaborator Author

jkva commented Jan 24, 2023

@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?

@jkva
Copy link
Collaborator Author

jkva commented Mar 29, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant