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

Catch EmailAddressExceptions and return 400 #464

Merged
merged 15 commits into from
Nov 12, 2021

Conversation

DMRobertson
Copy link
Contributor

Fixes #451

David Robertson added 3 commits November 10, 2021 20:00
because the source address is part of the application config. (It should
really be validated once at startup IMO.)
@DMRobertson DMRobertson requested a review from a team as a code owner November 10, 2021 20:14
sydent/util/emailutils.py Outdated Show resolved Hide resolved
David Robertson added 4 commits November 11, 2021 20:30
@clokep clokep self-requested a review November 12, 2021 12:26
Copy link
Member

@clokep clokep left a comment

Choose a reason for hiding this comment

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

Looks good overall! A couple of minor things (and linting seems to fail).

sydent/config/exceptions.py Show resolved Hide resolved
sydent/util/emailutils.py Outdated Show resolved Hide resolved
tests/test_store_invite.py Outdated Show resolved Hide resolved
David Robertson added 5 commits November 12, 2021 15:06
I'd rather put the comment next to the code that checks it
I thought `raise expr from e` would include `e`'s string representation,
but it doens't; rather `raise expr from e` seems to replace all mention
of `e` and its stack frames from the traceback.
@DMRobertson DMRobertson requested a review from clokep November 12, 2021 15:23
@@ -129,6 +125,25 @@ def sendEmail(
raise EmailSendException() from origException


def check_valid_email_address(address: str, allow_description: bool = True) -> None:
Copy link
Member

Choose a reason for hiding this comment

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

Does this want allow_description to default to False?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Argh, it does. Thank you, I need to slow down and think more carefully.

@DMRobertson DMRobertson force-pushed the dmr/store-invalid-reject-bad-emailaddr branch from 40890cd to b101614 Compare November 12, 2021 17:59
@DMRobertson DMRobertson requested a review from clokep November 12, 2021 17:59
Copy link
Member

@clokep clokep left a comment

Choose a reason for hiding this comment

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

Looks great!

@DMRobertson
Copy link
Contributor Author

Cheers!

@DMRobertson DMRobertson merged commit adc76bc into main Nov 12, 2021
@DMRobertson DMRobertson deleted the dmr/store-invalid-reject-bad-emailaddr branch November 12, 2021 18:06
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.

Uncaught EmailAddressExceptions
2 participants