Skip to content
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

Remove any logic specific to Device ID #229

Open
2 tasks
kristinapathak opened this issue Aug 4, 2020 · 1 comment
Open
2 tasks

Remove any logic specific to Device ID #229

kristinapathak opened this issue Aug 4, 2020 · 1 comment

Comments

@kristinapathak
Copy link
Contributor

kristinapathak commented Aug 4, 2020

Currently, caduceus parses the device ID in two places:

id, _ := device.ParseID(msg.Source)

if deviceRegex.MatchString(msg.Source) {

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:

  • Remove webhook.Matcher regex logic
  • Remove adding specific Device ID headers in Caduceus (wrphttp package will add any needed headers)

This is dependent on xmidt-org/wrp-go#53 and https://github.com/xmidt-org/webpa-common/issues/514.

@kristinapathak
Copy link
Contributor Author

Discussion with the team today led to these decisions:

  1. Caduceus will not do anything to parse or determine the Device ID.
  2. We will remove the Matcher field in the webhook struct for the webhook registration API, and remove logic in Caduceus that uses it.
  3. Add a new required field in the WRP SimpleEvent that indicates the DeviceID. Caduceus will no longer have a special header for the Device ID specifically and instead will have a header for it that matches the other fields.

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.

@kristinapathak kristinapathak changed the title Should Caduceus be responsible for knowing the device ID? Remove any logic specific to Device ID Aug 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant