Skip to content

fix: ensure loose validation for isEvent and toEvent #394

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

Merged
merged 1 commit into from
Mar 25, 2021

Conversation

lance
Copy link
Member

@lance lance commented Mar 24, 2021

The HTTP.isEvent() and HTTP.toEvent() functions both had some validation
code that violated the principle of loose validation when receiving an
event over HTTP. As discussed, the validation should be managed by the
receiver in this case with event.validate()

Signed-off-by: Lance Ball [email protected]

The `HTTP.isEvent()` and `HTTP.toEvent()` functions both had some validation
code that violated the principle of loose validation when receiving an
event over HTTP. As discussed, the validation should be managed by the
receiver in this case with `event.validate()`

Signed-off-by: Lance Ball <[email protected]>
@lance lance added the type/fix A change that fixes something that is broken label Mar 24, 2021
@lance lance requested a review from a team March 24, 2021 20:01
@lance lance self-assigned this Mar 24, 2021
@lance
Copy link
Member Author

lance commented Mar 24, 2021

@lholmquist I was hoping to get this in before 4.0.1 but 🤷. Once this is out, I can replace all of this with HTTP.isEvent(). https://github.com/boson-project/faas-js-runtime/blob/e06ee4297e6a806ca1df0ac2b075bae7cdd289f0/lib/event-handler.js#L34-L50

@lance lance merged commit efe466a into cloudevents:main Mar 25, 2021
@lance lance deleted the lance/is-event-fix branch March 25, 2021 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/fix A change that fixes something that is broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants