Skip to content

[Mailer] AWS SES auth with SESSION_TOKEN support #40193

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

Closed
wants to merge 2 commits into from
Closed

[Mailer] AWS SES auth with SESSION_TOKEN support #40193

wants to merge 2 commits into from

Conversation

chekalsky
Copy link
Contributor

Q A
Branch? 5.x
Bug fix? no
New feature? yes
Deprecations? no
Tickets
License MIT
Doc PR symfony/symfony-docs#14983

When we use AWS Lambda, we need not only ACCESS_KEY and ACCESS_SECRET in order to make requests to AWS SES, but also SESSION TOKEN. This PR introduces support for SESSION_TOKEN. For using it include it in DSN as query parameter named sessionToken e. g. ses+https://%env(AWS_ACCESS_KEY_ID)%:%env(urlencode:AWS_SECRET_ACCESS_KEY)%@default?region=us-east-1&sessionToken=%env(urlencode:AWS_SESSION_TOKEN)%.

Didn't add any tests as there wasn't any testing for this part of code.

@chekalsky chekalsky changed the title sessionToken back support [Mailer] AWS SES auth with SESSION_TOKEN support Feb 14, 2021
Copy link
Member

@jderusse jderusse left a comment

Choose a reason for hiding this comment

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

In fact, if I don't mistaken, async-aws already support natively the SESSION_TOKEN when authenticating via end variable. But as soon as you provide a user and password via DSN, you tell async-aws to not take the env variables into account.

I think the best way to support this SESSION_TOKEN variable is to let async-aws authenticate via env variable: Instead of adding a new option that passthrough the env variable, remove credentials from DSN: ses://default?region=eu-east-1

@@ -5,6 +5,7 @@ CHANGELOG
---

* added the `mailer` monolog channel and set it on all transport definitions
* Add support for `SESSION_TOKEN` for Async AWS Mailer transport
Copy link
Member

Choose a reason for hiding this comment

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

this is not totally accurate. this PR does not add support for the end variable SESSION_TOKEN, but adds a new option in DSN.

@chekalsky
Copy link
Contributor Author

remove credentials from DSN

@jderusse thank you, it's working, didn't know about this possibility :-) and I agree, this option is much better. I think we could close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants