Page MenuHomePhabricator

Update SES API to use AWSv4 signatures
ClosedPublic

Authored by epriestley on Sep 15 2020, 4:15 PM.

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 OK
Unit
Unit Test Errors
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.