xmidt-org / ancla

Ancla provides event webhook registry capabilities to XMiDT services.
Apache License 2.0
1 stars 2 forks source link

Content Type Functionality is Misleading #18

Open kristinapathak opened 4 years ago

kristinapathak commented 4 years ago

https://github.com/xmidt-org/webpa-common/blob/7592f89376a7f05449299ec1391ef8456a87b3fe/webhook/webhook.go#L32

Currently the ContentType in the webhook registration is used to determine whether to send the full WRP or just the Payload. We are proposing changing the functionality of the ContentType to instead be used for content negotiation between Caduceus and its webhooks.

If the ContentType specified in the WRP doesn't match what the webhook wants, Caduceus will drop the event instead of sending it.

Ideally, we want to add a field to the webhook struct called Accept or AcceptHeader that specifies a semi-colon deliminated list of MIME ContentTypes that the webhook will accept. Then the ContentType field can be treated as a list of one when no values are given in the Accept field (in order to support backwards compatibility) or deprecated.

kristinapathak commented 4 years ago

The issue discussing what to do about sending the full WRP vs the payload can be found at this issue: https://github.com/xmidt-org/webpa-common/issues/505