From b820ce9a8dfcefcb774a9e18eaa22b67f4f6b256 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Thu, 27 Aug 2026 18:28:49 +0200 Subject: [PATCH] Add resend OAuth2 provider to migration allow-list Appwrite server is adding a built-in 'resend' OAuth2 provider (appwrite/appwrite#13366). Without an entry in the PROVIDERS allow-list, migrations report "No migration resource for OAuth2 provider 'resend'; skipped." and the transfer fails. Only clientId migrates (to the resendAppid attribute); clientSecret is write-only and stays redacted per the existing policy. Co-Authored-By: Claude Fable 5 --- .../Resources/Auth/OAuth2/OAuth2Provider.php | 1 + .../Unit/Resources/OAuth2ProviderTest.php | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/Migration/Resources/Auth/OAuth2/OAuth2Provider.php b/src/Migration/Resources/Auth/OAuth2/OAuth2Provider.php index 54c2ee00..dc20dfb0 100644 --- a/src/Migration/Resources/Auth/OAuth2/OAuth2Provider.php +++ b/src/Migration/Resources/Auth/OAuth2/OAuth2Provider.php @@ -74,6 +74,7 @@ final class OAuth2Provider extends Resource 'paypal' => ['clientId' => ['target' => self::TARGET_APP_ID]], 'paypalSandbox' => ['clientId' => ['target' => self::TARGET_APP_ID]], 'podio' => ['clientId' => ['target' => self::TARGET_APP_ID]], + 'resend' => ['clientId' => ['target' => self::TARGET_APP_ID]], 'salesforce' => ['clientId' => ['target' => self::TARGET_APP_ID]], 'slack' => ['clientId' => ['target' => self::TARGET_APP_ID]], 'spotify' => ['clientId' => ['target' => self::TARGET_APP_ID]], diff --git a/tests/Migration/Unit/Resources/OAuth2ProviderTest.php b/tests/Migration/Unit/Resources/OAuth2ProviderTest.php index c74b009b..b666aaf9 100644 --- a/tests/Migration/Unit/Resources/OAuth2ProviderTest.php +++ b/tests/Migration/Unit/Resources/OAuth2ProviderTest.php @@ -43,6 +43,24 @@ public function testFromArrayHuggingFace(): void $this->assertTrue($provider->isConfigured()); } + public function testFromArrayResend(): void + { + $provider = OAuth2Provider::fromArray('resend', [ + 'id' => 'resend', + 'enabled' => true, + 'clientId' => 'client-123', + 'clientSecret' => 'super-secret', + ]); + + $this->assertNotNull($provider); + $this->assertEquals('resend', $provider->getProviderKey()); + $this->assertTrue($provider->getEnabled()); + $this->assertEquals(['clientId' => 'client-123'], $provider->getSettings()); + $this->assertEquals('client-123', $provider->getDestinationAppId()); + $this->assertEquals([], $provider->getDestinationSecretFields()); + $this->assertTrue($provider->isConfigured()); + } + public function testFromArrayNeverCopiesSecrets(): void { foreach (\array_keys(OAuth2Provider::PROVIDERS) as $providerKey) {