From ea342db79b87478698a36bbe4e8efc7c117ab18a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Tue, 8 Sep 2026 13:51:14 +0200 Subject: [PATCH] Add TikTok and Kakao OAuth2 providers to the migration allow-list Both store a plain client id and secret, so only the client id is readable and migratable. Co-Authored-By: Claude Opus 5 (1M context) --- .../Resources/Auth/OAuth2/OAuth2Provider.php | 2 ++ .../Unit/Resources/OAuth2ProviderTest.php | 36 +++++++++++++++++++ 2 files changed, 38 insertions(+) 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) {