Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Made EmailServerCredentials username/password optional #42

Merged
merged 7 commits into from
Oct 8, 2022

Conversation

drfraser
Copy link
Contributor

@drfraser drfraser commented Oct 6, 2022

EmailServerCredentials username/password were mandatory settings which makes no sense if an INSECURE SMTP server (aka port 25) is being used - no need to login etc.

Also potentially possible are secured SMTP servers (e.g. through SSL client/server certificates) that require no login step and server.login() would have caused problems.

Closes #40

Example

    server = EmailServerCredentials(
        smtp_server="a.public.server",
        smtp_type=SMTPType.INSECURE
    ).get_server()

Checklist

  • This pull request references any related issue by including "Closes #<ISSUE_NUMBER>"
    • If no issue exists and your change is not a small fix, please create an issue first.
  • This pull request includes tests or only affects documentation.
  • Summarized PR's changes in CHANGELOG.md

Copy link
Contributor

@ahuang11 ahuang11 left a comment

Choose a reason for hiding this comment

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

Thanks! Few stylistic changes suggested.

prefect_email/credentials.py Outdated Show resolved Hide resolved
prefect_email/credentials.py Outdated Show resolved Hide resolved
prefect_email/credentials.py Show resolved Hide resolved
Copy link
Contributor

@ahuang11 ahuang11 left a comment

Choose a reason for hiding this comment

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

I think we're close to wrapping this PR; just a couple more things:

  1. adding back Optional to kwargs that default to None
  2. Adding a simple unit test for testing not passing username / password.

Thanks for all your help!

prefect_email/credentials.py Outdated Show resolved Hide resolved
prefect_email/credentials.py Outdated Show resolved Hide resolved
@ahuang11 ahuang11 merged commit 7de2d45 into PrefectHQ:main Oct 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

username and password mandatory even if EmailServerCredentials is using an INSECURE server
2 participants