Page MenuHomePhabricator

Update SES API to use AWSv4 signatures
ClosedPublic

Authored by epriestley on Sep 15 2020, 4:15 PM.
Tags
None
Referenced Files
F13095718: D21461.id51072.diff
Thu, Apr 25, 12:17 PM
F13092220: D21461.diff
Thu, Apr 25, 3:30 AM
F13082867: D21461.id.diff
Wed, Apr 24, 10:20 PM
Unknown Object (File)
Thu, Apr 11, 10:48 AM
Unknown Object (File)
Wed, Mar 27, 2:02 AM
Unknown Object (File)
Mar 21 2024, 2:08 PM
Unknown Object (File)
Mar 9 2024, 3:26 PM
Unknown Object (File)
Feb 19 2024, 7:31 AM
Subscribers
None

Details

Summary

Ref T13570. Fixes T13235. In most cases, we use modern (v4) signatures for almost all AWS API calls, and have for several years.

However, sending email via SES currently uses an older piece of external code which uses the older (v3) signature method.

AWS is retiring v3 signatures on October 1 2020, so this pathway will stop working.

Update the pathway to use PhutilAWSFuture, which provides v4 signatures.

T13235 discusses poor error messages from SES. Switching to Futures fixes this for free, as they have more useful error handling.

Test Plan
  • Configured an SES mailer, including the new region parameter.
  • Used bin/mail send-test to send mail via SES.
  • Sent invalid mail (from an unverified address); got a more useful error message.
  • Grepped for removed external, no hits.

Diff Detail

Repository
rP Phabricator
Branch
ses1
Lint
Lint Passed
Unit
Test Failures
Build Status
Buildable 24886
Build 34336: Run Core Tests
Build 34335: arc lint + arc unit

Unit TestsFailed

TimeTest
0 msPhabricatorMailAdapterTestCase::testSupportsMessageID
EXCEPTION (PhutilTypeCheckException): Parameter 'region' has invalid type. Expected type 'string', got type 'null'. #0 /Users/epriestley/dev/core/lib/arcanist/src/parser/PhutilTypeSpec.php(169): PhutilTypeSpec->check(NULL, 'region') #1 /Users/epriestley/dev/core/lib/phabricator/src/applications/metamta/adapter/PhabricatorMailAmazonSESAdapter.php(18): PhutilTypeSpec::checkMap(Array, Array)
1 msPhabricatorMailAdapterTestCase::testSupportsMessageID
EXCEPTION (PhutilTypeCheckException): Parameter 'region' has invalid type. Expected type 'string', got type 'null'. #0 /core/data/drydock/workingcopy-74/repo/arcanist/src/parser/PhutilTypeSpec.php(169): PhutilTypeSpec->check(NULL, 'region') #1 /core/data/drydock/workingcopy-74/repo/phabricator/src/applications/metamta/adapter/PhabricatorMailAmazonSESAdapter.php(22): PhutilTypeSpec::checkMap(Array, Array)
0 msAlmanacNamesTestCase::testServiceOrDeviceNames
30 assertions passed.
0 msAlmanacServiceTypeTestCase::testGetAllServiceTypes
1 assertion passed.
0 msAphrontHTTPHeaderParserTestCase::testHeaderParser
18 assertions passed.
View Full Test Results (2 Failed · 425 Passed · 2 Skipped)

Event Timeline

Harbormaster returned this revision to the author for changes because remote builds failed.Sep 15 2020, 4:17 PM
Harbormaster failed remote builds in B24886: Diff 51071!
This revision was not accepted when it landed; it landed in state Needs Review.Sep 15 2020, 8:03 PM
This revision was automatically updated to reflect the committed changes.