Skip to content

test(notifications): harden and cover the email validator#576

Merged
mikewheeleer merged 1 commit into
Talenttrust:mainfrom
Jagadeeshftw:issue-570
Jun 29, 2026
Merged

test(notifications): harden and cover the email validator#576
mikewheeleer merged 1 commit into
Talenttrust:mainfrom
Jagadeeshftw:issue-570

Conversation

@Jagadeeshftw

Copy link
Copy Markdown
Contributor

Closes #570.

Tightens isValidEmail in src/services/notification.service.ts to reject control characters, comma/semicolon multi-recipient strings, quoting/backslash and angle-bracket forms, and addresses without a single @ and a dotted domain with a TLD, while still accepting normal RFC-shaped addresses. Keeps the CR/LF rejection, boolean contract and method signature, and applies the check before any dispatch. Adds tests in notification.email-validation.test.ts and validation rules in docs/email-notifications.md.

@mikewheeleer

Copy link
Copy Markdown
Contributor

love this — in it goes 👍

@mikewheeleer
mikewheeleer merged commit a8a11cd into Talenttrust:main Jun 29, 2026
3 of 5 checks passed
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.

Tighten the notification email validator against header injection and add tests

2 participants