-
Notifications
You must be signed in to change notification settings - Fork 19
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
Filter on PartnerID #181
Comments
This should be a configurable feature. Off by default. |
AFAIK, this requires modifying the webhook struct, so that caduceus knows what partner id registered for a webhook: If we want to add a field to this struct that is a part of our api, this could be a good time, since we need to add a field for this issue: We do already have fields that can be sent in the request that we don't modify: |
Based on discussion, we agreed that struct passed to sns/argus will be changed to something similar to:
When a new webhook is created, the partner id will be determined from the JWT provided. If basic auth is provided, we'll pull them from a header (@joe94 knows more about this). Issue related to this: https:/xmidt-org/webpa-common/issues/517 Caduceus will only send an event to a webhook if one of the device's partner ID is contained in the webhook partner IDs list (or if the wildcard is present in the webhook partner ID list). It should be configurable whether to monitor the events for device ID or actually enforce it. We should have a metric for this so we know the partner id of the events we are sending to each webhook (and if an event isn't sent because the webhook isn't authorized to receive it). This can probably be added to a metric we already have. |
If basic auth is provided, the partnerIDs should be fetched from the HTTP headers like this: https:/xmidt-org/tr1d1um/blob/main/translation/transport.go#L75. This might be a good opportunity to move this shared logic into wrp-go/wrphttp or somewhere more fitting. |
Two quick things:
|
Fixed in #276. |
Add the ability to filter events by partnerID.
The text was updated successfully, but these errors were encountered: