-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Mailer] Use AsyncAws to handle SES requests #35992
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
Conversation
new SesApiTransport('ACCESS_KEY', 'SECRET_KEY'), | ||
'ses+api://ACCESS_KEY@email.eu-west-1.amazonaws.com', | ||
new SesApiTransport(new SesClient(Configuration::create(['accessKeyId' => 'ACCESS_KEY', 'accessKeySecret' => 'SECRET_KEY']))), | ||
'ses+api://ACCESS_KEY@us-east-1', |
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.
Is it a BC Break?
src/Symfony/Component/Mailer/Bridge/Amazon/Tests/Transport/SesApiTransportTest.php
Outdated
Show resolved
Hide resolved
if ($email->getAttachments()) { | ||
return [ | ||
'Action' => 'SendRawEmail', | ||
'RawMessage.Data' => base64_encode($email->toString()), |
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.
this is probably the issue of #35037
$simpleMessage->setBody(new Body([ | ||
'Text' => [ | ||
'Data' => $email->getTextBody(), | ||
'Charset' => $email->getTextCharset(), |
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.
this were not provided in current version
IMHO AsyncAWS should also be a soft dependency when using the HTTP transport. |
Thank you for the PR and thank you @chalasr for the review. I agree with you. AsyncAws should be a soft dependency. Currently it is only installed in |
@Nyholm My point is: we have an HTTP implementation that works out of the box currently. Requiring AsyncAWS to be available for using the HTTP transport implicitly makes it an hard dependency, even if it's not in the Considering the pros + the fact that AsyncAWS is maintained by two core members, I'm OK for requiring it with a meaningful exception. |
Thank you. I understand the point you are trying to make.
Yes, But it has some bugs and it does not support all authentication mechanism available for AWS.
True, but this component and this bridge is still marked as experimental. Side note: Most code in Async AWS is generated so the maintenance is kept to a minimum. |
Oh no.. @chalasr pinged my privately and very politely pointed out that I was wrong. This component is not experimental. |
Thanks you for your review @chalasr. I agreed with you, The current HttpClient implementation should stay for BC. But as @Nyholm pointed it, this implementation have several opened bugs. One of them is the way the request is signed. It currently use the version 2 which is not supported by all regions (https://docs.aws.amazon.com/general/latest/gr/signature-version-2.html). And maintaing a new implementation, is not trivial (see async-aws or AWS SDK) I suggest to use the AsyncAws Adapter when installed package is installed otherwise to fallback to HttpClient Adapter (as suggested by @chalasr), AND to deprecate the HttpClient Adapter in 5.1 to remove the complexity from Symfony. WDYT? |
Since this is experimental, we can break BC and cut maintenance efforts. |
@nicolas-grekas Actually, this is not experimental :) #35992 (comment) |
06828b9
to
0da08e2
Compare
PR updated according our discussion. |
Tests seem broken |
e298f62
to
55fa287
Compare
src/Symfony/Component/Mailer/Bridge/Amazon/Transport/SesTransportFactory.php
Outdated
Show resolved
Hide resolved
Rebase needed |
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.
If this is ready for merge we should release 1.0.0 of async-aws/ses.
@jderusse Could you verify the failing tests?
7bcb68d
to
9e9c6c7
Compare
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.
CI failures are unrelated. 👍
Thank you @jderusse. |
…ication (jderusse) This PR was squashed before being merged into the 5.1-dev branch. Discussion ---------- [AmazonSqsMessenger] Use AsyncAws to handle SQS communication | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | / | License | MIT | Doc PR | / Similar to #35992 this PR use AsyncAws to handle Sqs messages sent/receive It move complexity of authentication/streaming outside Symfony while keeping HttpClient integration. Commits ------- 7c4888e [AmazonSqsMessenger] Use AsyncAws to handle SQS communication
alternative to #33326
This PR replace the native code to call AWS SES by the new AsyncAws project maintained by @Nyholm and me.
This removes complexity of signing request, and adds new features likes:
Because it's based on
symfony/http-client
, it's fully integrable with Symfony application.