eventing icon indicating copy to clipboard operation
eventing copied to clipboard

InMemoryChannel doesn't reject invalid CloudEvents

Open aliok opened this issue 2 years ago • 4 comments

Describe the bug When you send an invalid CloudEvent to IMC and it won't reject the event.

See https://github.com/knative/eventing/issues/6046 for an example.

What I mean by invalid event is for example a CloudEvent without any type.

According to CloudEvents specification, the type is a required field: https://github.com/cloudevents/spec/blob/v1.0.1/spec.md#type

Expected behavior

  • [ ] Events validated and invalid events rejected.
  • [ ] Tests to make sure IMC rejects these kind of events.

To Reproduce Steps to reproduce the behavior.

Knative release version 1.0.1

Additional context Add any other context about the problem here such as proposed priority

aliok avatar Jan 14 '22 10:01 aliok

Would it make sense to add a general CE validation method to either a shared code repository for Knative Eventing or maybe even to the upstream CloudEvent SDK for go ?

rhuss avatar Jan 18 '22 07:01 rhuss

This issue is stale because it has been open for 90 days with no activity. It will automatically close after 30 more days of inactivity. Reopen the issue with /reopen. Mark the issue as fresh by adding the comment /remove-lifecycle stale.

github-actions[bot] avatar Jul 14 '22 01:07 github-actions[bot]

/remove-lifecycle stale

pierDipi avatar Jul 18 '22 07:07 pierDipi

/triage accepted

pierDipi avatar Jul 18 '22 07:07 pierDipi

/assign

liuchangyan avatar Sep 13 '22 09:09 liuchangyan

@liuchangyan @aliok this is done in https://github.com/knative/eventing/commit/fae8544d856880afd583da0d573b6d3b63ad53df

pierDipi avatar Sep 13 '22 09:09 pierDipi

Thanks @liuchangyan for the heads up.

Would it make sense to add a general CE validation method to either a shared code repository for Knative Eventing or maybe even to the upstream CloudEvent SDK for go ?

@rhuss It is done that way, using the CloudEvents SDK.

aliok avatar Sep 13 '22 10:09 aliok