Page MenuHomePhabricator

Update SES API to use AWSv4 signatures
ClosedPublic

Authored by epriestley on Sep 15 2020, 4:15 PM.
Tags
None
Referenced Files
F14591944: D21461.id51072.diff
Wed, Jan 8, 3:44 PM
Unknown Object (File)
Fri, Jan 3, 2:21 PM
Unknown Object (File)
Wed, Jan 1, 10:58 PM
Unknown Object (File)
Tue, Dec 31, 11:17 PM
Unknown Object (File)
Tue, Dec 24, 2:36 AM
Unknown Object (File)
Mon, Dec 23, 8:21 PM
Unknown Object (File)
Sun, Dec 22, 7:41 PM
Unknown Object (File)
Fri, Dec 20, 8:53 PM
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.