-
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
fix(email): Fix SendGrid fallback integration #1026
Merged
Merged
Changes from 16 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
c3db924
email: Disable custom from addresses during fallback
zwliew 9c08ac6
middleware: Remove 1h estimation from error message
zwliew 40228df
middleware: Don't expose the custom address to the user during fallback
zwliew 8f1f39a
middleware: Remove Retry-After header
zwliew 7f2a04c
chore(routes): Document the 503 error
zwliew 507ccd8
chore: Refactor the 503 condition to a separate middleware
zwliew dc728a6
fix(config): Default fallback config to false
zwliew 811509e
chore(docs): Document the new env var
zwliew afb6a9a
chore(docs): Update SES env var names
zwliew 201d0f4
fix: correctly parse SendGrid callback payload for verification
zwliew 5473c72
Revert "fix: correctly parse SendGrid callback payload for verification"
zwliew 19381a8
fix: parse request body as text specifically for email callbacks
zwliew eec77ff
fix: install python-dev on both worker and backend Docker instances
zwliew 7f0025a
Revert "fix: install python-dev on both worker and backend Docker ins…
zwliew ce863d6
Revert "Revert "fix: install python-dev on both worker and backend Do…
zwliew da61e34
Merge branch 'develop' into sendgrid-email-fallback
lamkeewei 03a90b6
Revert "middleware: Don't expose the custom address to the user durin…
zwliew File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SendGrid events contain carriage return and newline characters (
\r\n
) and some even have unicode-encoded characters. The JSON body-parser that we currently use strips the newline characters and decodes the unicode characters, which causes the ECDSA verification to fail.I had a less intrusive fix here: 201d0f4
But, I think it's not great for reasons stated in the revert: 5473c72
I ended up with this solution since it isn't super intrusive, but it might affect SES callbacks. I doubt it would in practice though.
One other solution which doesn't affect SES callbacks is to split the SES and SendGrid callback endpoints, and only apply the text body-parser for SendGrid, but that would be sort of a breaking change. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is fine. I've checked and only one
body-parser
middleware will run each time.