mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
test(messaging): cover enabling SES provider with empty fromEmail
Regression test for the enable-guard fix: PATCH {enabled:true} on an SES
provider whose fromEmail is still empty must return 400 provider_missing_credentials
rather than enabling a provider that would fail every send at the AWS API.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
1bfb0b115c
commit
5e07e9fc6e
1 file changed
+8
@@ -1105,6 +1105,14 @@ trait MessagingBase
|
||||
$this->assertEquals('my-access-key', $updateResponse['body']['credentials']['accessKey']);
|
||||
$this->assertEquals('my-secret-key', $updateResponse['body']['credentials']['secretKey']);
|
||||
|
||||
// Regression: enabling while fromEmail is still empty must be rejected, not silently enabled.
|
||||
$enableWithoutFromEmail = $this->client->call(Client::METHOD_PATCH, '/messaging/providers/ses/' . $providerId, $headers, [
|
||||
'enabled' => true,
|
||||
]);
|
||||
|
||||
$this->assertEquals(400, $enableWithoutFromEmail['headers']['status-code']);
|
||||
$this->assertEquals('provider_missing_credentials', $enableWithoutFromEmail['body']['type']);
|
||||
|
||||
// Enable the first provider once fromEmail is supplied.
|
||||
$enableResponse = $this->client->call(Client::METHOD_PATCH, '/messaging/providers/ses/' . $providerId, $headers, [
|
||||
'fromEmail' => 'sender-email@my-domain.com',
|
||||
|
||||
Reference in new issue
Block a user