Open kristinapathak opened 3 years ago
Discussion with the team today led to these decisions:
Matcher
field in the webhook struct for the webhook registration API, and remove logic in Caduceus that uses it.Most of these decisions affect other repos. The main change needed for this issue is for Caduceus to no longer use the webhook Matcher
field for anything, and to only use the wrphttp
package to add the wrp headers.
Currently, caduceus parses the device ID in two places: https://github.com/xmidt-org/caduceus/blob/453f1410b1f109beeac7d9141eb20df4c86292d6/outboundSender.go#L582 https://github.com/xmidt-org/caduceus/blob/b2866f45a7891e20b49c005aaf46dd70baf247e8/outboundSender.go#L391
In talking with @schmidtw, we have reason to believe some consumers are using the device ID header, and we should probably keep that accurate. The part of the webhook struct that provides regex to apply against the device ID was more intended as a way to provide regex against the wrp.Source, so perhaps we could change the api to reflect that better without changing the Caduceus logic.
In our discussion, we didn't think Caduceus should be responsible for parsing the device ID from the event. Talaria knows the device ID already, so if it passes it to Caduceus, Caduceus could forward it - either as an http header or a new field in the wrp.
These are just options we discussed; further discussion is needed.
Update: Given our discussion, these are the changes needed in Caduceus:
This is dependent on https://github.com/xmidt-org/wrp-go/issues/53 and https://github.com/xmidt-org/webpa-common/issues/514.