-
Notifications
You must be signed in to change notification settings - Fork 21
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
Feat: Grant activity email trigger #3571 #3647
base: main
Are you sure you want to change the base?
Conversation
7e5eb94
to
78996e2
Compare
}); | ||
|
||
// TODO: add plain text version of the email | ||
const emailPlain = emailHTML.replace(/<[^>]+>/g, ''); |
Check failure
Code scanning / CodeQL
Incomplete multi-character sanitization High
<script
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI about 1 month ago
To fix the problem, we should replace the current regular expression-based sanitization with a well-tested library that can handle HTML sanitization more effectively. One such library is sanitize-html
, which is designed to remove unsafe HTML tags and attributes while preserving safe content.
Steps to fix:
- Install the
sanitize-html
library. - Replace the current regular expression-based sanitization with a call to
sanitize-html
.
-
Copy modified lines R566-R570
@@ -565,3 +565,7 @@ | ||
// TODO: add plain text version of the email | ||
const emailPlain = emailHTML.replace(/<[^>]+>/g, ''); | ||
const sanitizeHtml = require('sanitize-html'); | ||
const emailPlain = sanitizeHtml(emailHTML, { | ||
allowedTags: [], // Remove all HTML tags | ||
allowedAttributes: {} // Remove all attributes | ||
}); | ||
|
-
Copy modified lines R88-R89
@@ -87,3 +87,4 @@ | ||
"uuid": "^8.3.2", | ||
"xlsx": "^0.18.5" | ||
"xlsx": "^0.18.5", | ||
"sanitize-html": "^2.13.1" | ||
}, |
Package | Version | Security advisories |
sanitize-html (npm) | 2.13.1 | None |
QA Summary
Test CoverageCoverage report for `packages/client`
Coverage report for `packages/server`
|
Terraform Summary
Hint: If "Terraform Format & Style" failed, run OutputValidation Output
Plan Summary
Pusher: @greg-adams, Action: |
b064b84
to
11900d8
Compare
11900d8
to
8cc26fc
Compare
Ticket #3571
Description
Screenshots / Demo Video
Testing
docker compose exec app yarn workspace server node ./src/scripts/sendGrantActivityDigestEmail.js
. The time window (periodStart
/periodEnd
) can be adjusted in this file if needed.ENABLE_GRANT_ACTIVITY_DIGEST_SCHEDULED_TASK
must be enabledAutomated and Unit Tests
Manual tests for Reviewer
Checklist