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

[5.6] Allowing IAM role SESSION_TOKEN to be used with SES #23766

Merged
merged 1 commit into from
Apr 9, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Illuminate/Mail/TransportManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ protected function createSesDriver()
protected function addSesCredentials(array $config)
{
if ($config['key'] && $config['secret']) {
$config['credentials'] = Arr::only($config, ['key', 'secret']);
$config['credentials'] = Arr::only($config, ['key', 'secret', 'token']);
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens if token is not defined in the array at this point? Does Arr::only() handle that gracefully?

Copy link
Member

Choose a reason for hiding this comment

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

Ping.

Copy link
Contributor Author

@footballencarta footballencarta Apr 3, 2018

Choose a reason for hiding this comment

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

Sorry, I've been away for the last couple of days for Easter.

From looking at the Arr::only function, all it does is an intersection:

return array_intersect_key($array, array_flip((array) $keys));

So, running that through PHP with all 3 gives:

image

Just having 'key' and 'secret' in the config gives:

image

So it handles the lack of the token gracefully based off the source code.

I can check with the actual code tonight once I've finished work, however based off the check now, it's handled gracefully.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can confirm it has no effect on existing functionality. Our current local development environment for the given project only contains key and secret, yet our live servers with the above change contain key, secret and token, and both send emails as expected.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is there any progress on this guys?

}

return $config;
Expand Down