diff --git a/src/Migration/Resources/Auth/OAuth2/OAuth2Provider.php b/src/Migration/Resources/Auth/OAuth2/OAuth2Provider.php index dc20dfb0..aa2f577f 100644 --- a/src/Migration/Resources/Auth/OAuth2/OAuth2Provider.php +++ b/src/Migration/Resources/Auth/OAuth2/OAuth2Provider.php @@ -38,6 +38,7 @@ final class OAuth2Provider extends Resource 'bitbucket' => ['clientId' => ['target' => self::TARGET_APP_ID]], 'bitly' => ['clientId' => ['target' => self::TARGET_APP_ID]], 'box' => ['clientId' => ['target' => self::TARGET_APP_ID]], + 'cloudflare' => ['clientId' => ['target' => self::TARGET_APP_ID]], 'dailymotion' => ['clientId' => ['target' => self::TARGET_APP_ID]], 'discord' => ['clientId' => ['target' => self::TARGET_APP_ID]], 'disqus' => ['clientId' => ['target' => self::TARGET_APP_ID]], diff --git a/tests/Migration/Unit/Resources/OAuth2ProviderTest.php b/tests/Migration/Unit/Resources/OAuth2ProviderTest.php index b666aaf9..ca1a1f8c 100644 --- a/tests/Migration/Unit/Resources/OAuth2ProviderTest.php +++ b/tests/Migration/Unit/Resources/OAuth2ProviderTest.php @@ -61,6 +61,24 @@ public function testFromArrayResend(): void $this->assertTrue($provider->isConfigured()); } + public function testFromArrayCloudflare(): void + { + $provider = OAuth2Provider::fromArray('cloudflare', [ + 'id' => 'cloudflare', + 'enabled' => true, + 'clientId' => 'client-123', + 'clientSecret' => 'super-secret', + ]); + + $this->assertNotNull($provider); + $this->assertEquals('cloudflare', $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) {