xmidt-org / ancla

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

Specify whether to get WRP or Payload when registering #19

Open kristinapathak opened 4 years ago

kristinapathak commented 4 years ago

https://github.com/xmidt-org/webpa-common/blob/main/webhook/webhook.go#L25

Currently, if a specific ContentType is specified in the WRP webhook registration, the full WRP encoded as Msgpack is sent instead of just the WRP's payload field. This functionality is not straightfoward to webhook clients, so we are proposing an additional field that would specify whether Caduceus sends the full WRP. The ContentType would no longer be involved in this logic.

Some name options for this new field:

kristinapathak commented 4 years ago

Further discussion with @schmidtw led us to having this field as an enum rather than a boolean. The example given

Provide: wrp
Provide: wrp.payload

This could also be structured in such a way as to allow webhook registrations to opt into multiple fields (such as payload+spans or payload+metadata).