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

modify care team confirmation context for alerting #129

Closed
wants to merge 2 commits into from

Conversation

ewollesen
Copy link
Contributor

@ewollesen ewollesen commented Sep 8, 2023

Care team invitation/confirmation contexts are currently a clients.Permissions object. To support alerting, the context is extended to include a models.AlertsConfig.

The custom JSON unmarshaler allows flexibility in parsing the following received contexts:

1. The existing permissions only context
2. A hybrid context with old-style permissions plus an "AlertsConfig"
3. A future context with a "Permissions" and an "AlertsConfig" as sibling
   properties

When the API is migrated to scenario #3 above, the custom marshaler can be removed.

Pulling in platform as a dependency brought a lot of vendor changes with it.

Part of BACK-2500

@ewollesen ewollesen force-pushed the eric/alerting-context branch 2 times, most recently from ecacd3c to cafe1af Compare September 11, 2023 19:54
@ewollesen ewollesen force-pushed the eric/alerting-context branch 3 times, most recently from 5af4513 to 735397c Compare September 26, 2023 17:13
@ewollesen ewollesen changed the base branch from eric/alerts-config to master September 26, 2023 17:14
a.sendModelAsResWithStatus(res, statusErr, http.StatusBadRequest)
return
}
setPerms, err := a.gatekeeper.SetPermissions(inviteeID, invitorID, ctc.Permissions)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think permissions must include the new "follow" permission and validate that the new permission is present in the request body if alertsConfig is not empty.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's fair. In theory, the alerts config that existed would be ignored without the permissions to match it, but there's also no sense in storing the alerts config if they don't have the permission. I'll make the change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also worth noting, that the new alerting permission isn't added yet. That happens in #126. I'm making a note to address it there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've now addressed this in #126.

Care team invitation/confirmation contexts are currently a
clients.Permissions object. To support alerting, the context is extended to
include a alerts.Config (defined in platform).

The custom JSON unmarshaler allows flexibility in parsing the following
received contexts:

    1. The existing permissions only context
    2. A hybrid context with old-style permissions plus an alertsConfig
    3. A future context with a "Permissions" and an alertsConfig as sibling
       properties

When the API is migrated to scenario #3 above, the custom marshaler can be
removed.

Bringing in platform as a dependency brought many vendor changes as well.

Part of BACK-2500
This struct property was changed in platform. This is the corresponding
change.

BACK-2500
@ewollesen
Copy link
Contributor Author

Closing this, as it's been consumed by #126

@ewollesen ewollesen closed this Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants