diff --git a/src/Migration/Resources/Auth/OAuth2/OAuth2Provider.php b/src/Migration/Resources/Auth/OAuth2/OAuth2Provider.php index aa2f577f..95bf7674 100644 --- a/src/Migration/Resources/Auth/OAuth2/OAuth2Provider.php +++ b/src/Migration/Resources/Auth/OAuth2/OAuth2Provider.php @@ -51,6 +51,7 @@ final class OAuth2Provider extends Resource 'gitlab' => ['clientId' => ['target' => self::TARGET_APP_ID], 'endpoint' => ['target' => self::TARGET_SECRET]], 'google' => ['clientId' => ['target' => self::TARGET_APP_ID], 'prompt' => ['target' => self::TARGET_SECRET]], 'huggingface' => ['clientId' => ['target' => self::TARGET_APP_ID]], + 'kakao' => ['clientId' => ['target' => self::TARGET_APP_ID]], 'keycloak' => [ 'clientId' => ['target' => self::TARGET_APP_ID], 'endpoint' => ['target' => self::TARGET_SECRET, 'key' => 'keycloakDomain'], @@ -80,6 +81,7 @@ final class OAuth2Provider extends Resource 'slack' => ['clientId' => ['target' => self::TARGET_APP_ID]], 'spotify' => ['clientId' => ['target' => self::TARGET_APP_ID]], 'stripe' => ['clientId' => ['target' => self::TARGET_APP_ID]], + 'tiktok' => ['clientId' => ['target' => self::TARGET_APP_ID]], 'tradeshift' => ['clientId' => ['target' => self::TARGET_APP_ID]], 'tradeshiftBox' => ['clientId' => ['target' => self::TARGET_APP_ID]], 'twitch' => ['clientId' => ['target' => self::TARGET_APP_ID]], diff --git a/tests/Migration/Unit/Resources/OAuth2ProviderTest.php b/tests/Migration/Unit/Resources/OAuth2ProviderTest.php index ca1a1f8c..06499043 100644 --- a/tests/Migration/Unit/Resources/OAuth2ProviderTest.php +++ b/tests/Migration/Unit/Resources/OAuth2ProviderTest.php @@ -79,6 +79,42 @@ public function testFromArrayCloudflare(): void $this->assertTrue($provider->isConfigured()); } + public function testFromArrayTikTok(): void + { + $provider = OAuth2Provider::fromArray('tiktok', [ + 'id' => 'tiktok', + 'enabled' => true, + 'clientId' => 'client-123', + 'clientSecret' => 'super-secret', + ]); + + $this->assertNotNull($provider); + $this->assertEquals('tiktok', $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 testFromArrayKakao(): void + { + $provider = OAuth2Provider::fromArray('kakao', [ + 'id' => 'kakao', + 'enabled' => true, + 'clientId' => 'client-123', + 'clientSecret' => 'super-secret', + ]); + + $this->assertNotNull($provider); + $this->assertEquals('kakao', $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) {