-
Notifications
You must be signed in to change notification settings - Fork 81
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
Email Notification for Actions on Share Requests #734
Comments
Hi @TejasRGitHub , thanks for opening an issue this is a great feature idea. First, we need to define the actions that are going to be notified:
Secondly, and this is more complex, we need to decide on the subscription architecture. Presumably we'll be using AWS SNS to get the notifications from the ECS share task + GraphQL API calls. I can brainstorm different alternatives, let me know if this is aligned with what you have in mind:
One SNS topics in data.all infrastructure accountPROS:
CONS:
One SNS topic per environmentPROS:
CONS:
One SNS topics per teamVery similar to the previous PROS:
CONS:
|
@noah-paige I have not used SNS that much, so feel free to add any thoughts |
Other considerations to note:
|
Hi @dlpzx , Thanks for the ideas about implementation. I think I would be leaning towards using SNS topic per environment , in which , any share workflow which is created a notification will be sent to each SNS topic and delivered to both the producer and the consumer team. Here though we would like to have filtering to send it to only a set of people in a team OR only certain teams in that environment. But as per the discussion, it seems that is a user experience concern in which if a user belongs to multiple environment then the same user would have to verify his email for each SNS topics subscription. It would be great to know your thoughts on it and see if there is a work around this. I am thinking on another alternative to sending email via SES which would look like, Share Workflow -> Create Task for Email notification -> Put in Worker.queue ( sqs.queue) -> When the worker.process is called , appropriate handler will be called . Here for the handler another ECS service specifically for sending email notification can be made which will use SES. Hi @noah-paige , Email notification should be sent to the teams ( for e.g. when a share is created, email notification can be sent to all the teams( cognito groups ) in requester's environment and on the approvers side , email can be sent to dataset owners team and stewards team but a way to configure to send the email only to the user requesting for dataset in that team and only to the dataset owners would be nice to have. |
Hi @noah-paige , @dlpzx , Here is the design and few other details for this enhancement feature The actions made on the UI for any share workflow will trigger GraphQL Lambda. This lambda ( This Task will be sent to the The SES setup on AWS accounts will happen through SesStack which will be initialized during the pipeline phase. This will setup the identity ( domain ) used for sending email on SES and also setup monitoring for email bounces, complaints & delivery issues. For now, the domain which is specified in the Configs Introduced
"share_notifications": [
{
"email": {
"active": true,
"features": {
"group_notifications": true
}
}
}
]
Permission Granted as a part of Email notification Change
|
Hi @TejasRGitHub, @noah-paige , @anmolsgandhi I created the issue #785 that describes one preliminary task needed for @TejasRGitHub to contribute this feature back to the open-source repo |
### Feature or Bugfix - Feature ### Detail Whenever a share request is created and transitions from states ( approved, revoked, etc ) a notification is created. This notification is displayed on the bell icon on the UI . We want such a similar notification to be sent to the dataset owner, requester, etc via email Please take a look at Github Issue 734 For more details - #734 ### Relates - #734 ### Security Please answer the questions below briefly where applicable, or write `N/A`. Based on [OWASP 10](https://owasp.org/Top10/en/). - Does this PR introduce or modify any input fields or queries - this includes fetching data from storage outside the application (e.g. a database, an S3 bucket)? No - Is the input sanitized? - What precautions are you taking before deserializing the data you consume? - Is injection prevented by parametrizing queries? - Have you ensured no `eval` or similar functions are used? - Does this PR introduce any functionality or component that requires authorization? No - How have you ensured it respects the existing AuthN/AuthZ mechanisms? - Are you logging failed auth attempts? - Are you using or adding any cryptographic features? No - Do you use a standard proven implementations? - Are the used keys controlled by the customer? Where are they stored? - Are you introducing any new policies/roles/users? Yes - Have you used the least-privilege principle? How? --> **Permission granted for SES:sendEmail to Lambda on resources - (Ses identity and configuration set ) , Also created KMS and SNS for SES setup to handle email bounces . Used least privleged and restricted access on both whenever required. ** By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. Co-authored-by: trajopadhye <tejas.rajopadhye@yahooinc.com>
### Feature or Bugfix - Refactoring ### Detail As a rule of thumb, we encourage customization of `modules` while changes in `core` should be avoided when possible. `notifications` is a component initially in core which is only used by `dataset_sharing`. To facilitate customization of the `notifications` module and also to clearly see its dependencies we have: - Moved `notifications` code from core to modules as it is a reusable component that is not needed by any core component. - Moved dataset_sharing references inside dataset_sharing module and left `notifications` independent from any other module (done mostly in #734, so credits to @TejasRGitHub) - Added depends_on in the dataset_sharing module to load notifications if the data_sharing module is imported. - Modified frontend navigation bar to make it conditional of the notifications module - Added migration script to modify the notification type column - Fix tests from #734, some references on the payload of the notification tasks were wrong - Small fixes to SES stack: added account in KMS policy and email_id as input ### [WIP] Testing Local testing - [ ] loading of notifications with datasets enabled - [ ] ... AWS testing - [ ] CICD pipeline succeds ### Other remarks Not for this PR, but as a general note, we should clean up deprecated ECS tasks ### Relates - #785 - #734 ### Security Please answer the questions below briefly where applicable, or write `N/A`. Based on [OWASP 10](https://owasp.org/Top10/en/). `N/A` just refactoring By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
### Feature or Bugfix - Feature ( Documentation ) ### Detail When enabling email notification on share workflow, an SES identity is created on AWS SES. This PR contains documentation about the manual steps that need to be taken towards setting up SES and also additional steps to setup monitoring. ### Relates - #734 - #785 ### Security Please answer the questions below briefly where applicable, or write `N/A`. Based on [OWASP 10](https://owasp.org/Top10/en/). - Does this PR introduce or modify any input fields or queries - this includes fetching data from storage outside the application (e.g. a database, an S3 bucket)? N/A - Is the input sanitized? - What precautions are you taking before deserializing the data you consume? - Is injection prevented by parametrizing queries? - Have you ensured no `eval` or similar functions are used? - Does this PR introduce any functionality or component that requires authorization? N/A - How have you ensured it respects the existing AuthN/AuthZ mechanisms? - Are you logging failed auth attempts? - Are you using or adding any cryptographic features? N/A - Do you use a standard proven implementations? - Are the used keys controlled by the customer? Where are they stored? - Are you introducing any new policies/roles/users? N/A - Have you used the least-privilege principle? How? By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Merged and released with v2.1.0 🚀 |
Is your idea related to a problem? Please describe.
Whenever a share request is created and transitions from states ( approved, revoked, etc ) a notification is created. This notification is displayed on the bell icon on the UI .
We want such a similar notification to be sent to the dataset owner, requester, etc via email
Describe the solution you'd like
An email is sent on creation and on any transition of the share request to the dataset owner, requester, etc
A solution consisting of using SNS topic - for which dataset owner, requester of the dataset are subscribed - where any notification which is sent to the topic gets delivered to the email addresses could be one potential way to implement this.
Further, a way to filter recipient email list where email about the share request are sent to only specific email ids ( from the environment teams ) would be nice to have.
P.S. Don't attach files. Please, prefer add code snippets directly in the message body.
The text was updated successfully, but these errors were encountered: