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 handlers that need to pass through mutated json #78

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jspaleta
Copy link
Contributor

@jspaleta jspaleta commented Jun 9, 2022

In order to support mutated json passed into a handler, we need to disable eventRead and/or eventValidation.

Currently the SDK doesn't allow for this in the Handler concept.

This PR adds additional Handler functions to explicitly disable these plugin framework properties before handler Execute() is called.

Example handler use-case

building 'generic' webhook handlers to send json to arbitrary webhook url.
The payload needed by the receiving webhook would be mutated in the Sensu pipeline and will not longer be expected to be recognizable as a Sensu Event.

https://github.com/jspaleta/sensu-http-handler
This repo uses commits from this PR to disable event read so that arbitrary byte string on stdin can be passed to an external http endpoint

@jspaleta jspaleta requested a review from echlebek June 9, 2022 01:31
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

Successfully merging this pull request may close these issues.

None yet

1 participant