diff --git a/src/Appwrite/Platform/Modules/Project/Http/Project/OAuth2/Apple/Update.php b/src/Appwrite/Platform/Modules/Project/Http/Project/OAuth2/Apple/Update.php index 4f8437ce8d..79a30e02d4 100644 --- a/src/Appwrite/Platform/Modules/Project/Http/Project/OAuth2/Apple/Update.php +++ b/src/Appwrite/Platform/Modules/Project/Http/Project/OAuth2/Apple/Update.php @@ -3,6 +3,7 @@ namespace Appwrite\Platform\Modules\Project\Http\Project\OAuth2\Apple; use Appwrite\Auth\OAuth2\Apple; +use Appwrite\Event\Event as QueueEvent; use Appwrite\Platform\Action; use Appwrite\Platform\Modules\Project\Http\Project\OAuth2\Base; use Appwrite\SDK\AuthType; @@ -71,8 +72,8 @@ class Update extends Base ->desc('Update project OAuth2 ' . $providerLabel) ->groups(['api', 'project']) ->label('scope', 'oauth2.write') - ->label('event', 'oauth2.' . $providerId . '.update') - ->label('audits.event', 'project.oauth2.' . $providerId . '.update') + ->label('event', 'oauth2.[providerId].update') + ->label('audits.event', 'project.oauth2.[providerId].update') ->label('audits.resource', 'project.oauth2/{response.$id}') ->label('sdk', new Method( namespace: 'project', @@ -96,6 +97,7 @@ class Update extends Base ->inject('dbForPlatform') ->inject('project') ->inject('authorization') + ->inject('queueForEvents') ->callback($this->handle(...)); } @@ -130,9 +132,11 @@ class Update extends Base Response $response, Database $dbForPlatform, Document $project, - Authorization $authorization + Authorization $authorization, + QueueEvent $queueForEvents ): void { $providerId = static::getProviderId(); + $queueForEvents->setParam('providerId', $providerId); // The secret is stored as JSON `{"p8": "...", "keyID": "...", "teamID": "..."}` // to match the shape Apple's OAuth2 adapter expects in getAppSecret(). diff --git a/src/Appwrite/Platform/Modules/Project/Http/Project/OAuth2/Auth0/Update.php b/src/Appwrite/Platform/Modules/Project/Http/Project/OAuth2/Auth0/Update.php index 1bbdd02a0d..4cb314af13 100644 --- a/src/Appwrite/Platform/Modules/Project/Http/Project/OAuth2/Auth0/Update.php +++ b/src/Appwrite/Platform/Modules/Project/Http/Project/OAuth2/Auth0/Update.php @@ -3,6 +3,7 @@ namespace Appwrite\Platform\Modules\Project\Http\Project\OAuth2\Auth0; use Appwrite\Auth\OAuth2\Auth0; +use Appwrite\Event\Event as QueueEvent; use Appwrite\Platform\Action; use Appwrite\Platform\Modules\Project\Http\Project\OAuth2\Base; use Appwrite\SDK\AuthType; @@ -64,8 +65,8 @@ class Update extends Base ->desc('Update project OAuth2 ' . $providerLabel) ->groups(['api', 'project']) ->label('scope', 'oauth2.write') - ->label('event', 'oauth2.' . $providerId . '.update') - ->label('audits.event', 'project.oauth2.' . $providerId . '.update') + ->label('event', 'oauth2.[providerId].update') + ->label('audits.event', 'project.oauth2.[providerId].update') ->label('audits.resource', 'project.oauth2/{response.$id}') ->label('sdk', new Method( namespace: 'project', @@ -88,6 +89,7 @@ class Update extends Base ->inject('dbForPlatform') ->inject('project') ->inject('authorization') + ->inject('queueForEvents') ->callback($this->handle(...)); } @@ -119,9 +121,11 @@ class Update extends Base Response $response, Database $dbForPlatform, Document $project, - Authorization $authorization + Authorization $authorization, + QueueEvent $queueForEvents ): void { $providerId = static::getProviderId(); + $queueForEvents->setParam('providerId', $providerId); // The secret is stored as JSON `{"clientSecret": "...", "auth0Domain": "..."}` // to match the shape Auth0's OAuth2 adapter expects (getAuth0Domain()). diff --git a/src/Appwrite/Platform/Modules/Project/Http/Project/OAuth2/Authentik/Update.php b/src/Appwrite/Platform/Modules/Project/Http/Project/OAuth2/Authentik/Update.php index 62e314053a..834a68597a 100644 --- a/src/Appwrite/Platform/Modules/Project/Http/Project/OAuth2/Authentik/Update.php +++ b/src/Appwrite/Platform/Modules/Project/Http/Project/OAuth2/Authentik/Update.php @@ -3,6 +3,7 @@ namespace Appwrite\Platform\Modules\Project\Http\Project\OAuth2\Authentik; use Appwrite\Auth\OAuth2\Authentik; +use Appwrite\Event\Event as QueueEvent; use Appwrite\Platform\Action; use Appwrite\Platform\Modules\Project\Http\Project\OAuth2\Base; use Appwrite\SDK\AuthType; @@ -64,8 +65,8 @@ class Update extends Base ->desc('Update project OAuth2 ' . $providerLabel) ->groups(['api', 'project']) ->label('scope', 'oauth2.write') - ->label('event', 'oauth2.' . $providerId . '.update') - ->label('audits.event', 'project.oauth2.' . $providerId . '.update') + ->label('event', 'oauth2.[providerId].update') + ->label('audits.event', 'project.oauth2.[providerId].update') ->label('audits.resource', 'project.oauth2/{response.$id}') ->label('sdk', new Method( namespace: 'project', @@ -88,6 +89,7 @@ class Update extends Base ->inject('dbForPlatform') ->inject('project') ->inject('authorization') + ->inject('queueForEvents') ->callback($this->handle(...)); } @@ -119,9 +121,11 @@ class Update extends Base Response $response, Database $dbForPlatform, Document $project, - Authorization $authorization + Authorization $authorization, + QueueEvent $queueForEvents ): void { $providerId = static::getProviderId(); + $queueForEvents->setParam('providerId', $providerId); // The secret is stored as JSON `{"clientSecret": "...", "authentikDomain": "..."}` // to match the shape Authentik's OAuth2 adapter expects (getAuthentikDomain()). diff --git a/src/Appwrite/Platform/Modules/Project/Http/Project/OAuth2/Base.php b/src/Appwrite/Platform/Modules/Project/Http/Project/OAuth2/Base.php index ddaac7c602..50531d647f 100644 --- a/src/Appwrite/Platform/Modules/Project/Http/Project/OAuth2/Base.php +++ b/src/Appwrite/Platform/Modules/Project/Http/Project/OAuth2/Base.php @@ -2,6 +2,7 @@ namespace Appwrite\Platform\Modules\Project\Http\Project\OAuth2; +use Appwrite\Event\Event as QueueEvent; use Appwrite\Extend\Exception; use Appwrite\Platform\Action; use Appwrite\SDK\AuthType; @@ -111,8 +112,8 @@ abstract class Base extends Action ->desc('Update project OAuth2 ' . $providerLabel) ->groups(['api', 'project']) ->label('scope', 'oauth2.write') - ->label('event', 'oauth2.' . $providerId . '.update') - ->label('audits.event', 'project.oauth2.' . $providerId . '.update') + ->label('event', 'oauth2.[providerId].update') + ->label('audits.event', 'project.oauth2.[providerId].update') ->label('audits.resource', 'project.oauth2/{response.$id}') ->label('sdk', new Method( namespace: 'project', @@ -134,6 +135,7 @@ abstract class Base extends Action ->inject('dbForPlatform') ->inject('project') ->inject('authorization') + ->inject('queueForEvents') ->callback($this->action(...)); } @@ -304,13 +306,16 @@ abstract class Base extends Action Response $response, Database $dbForPlatform, Document $project, - Authorization $authorization + Authorization $authorization, + QueueEvent $queueForEvents ): void { $project = $this->persistCredentials($project, $dbForPlatform, $authorization, $clientId, $clientSecret, $enabled); $providerId = static::getProviderId(); $oAuthProviders = $project->getAttribute('oAuthProviders', []); + $queueForEvents->setParam('providerId', $providerId); + $response->dynamic(new Document([ '$id' => $providerId, 'enabled' => $oAuthProviders[$providerId . 'Enabled'] ?? false, diff --git a/src/Appwrite/Platform/Modules/Project/Http/Project/OAuth2/Gitlab/Update.php b/src/Appwrite/Platform/Modules/Project/Http/Project/OAuth2/Gitlab/Update.php index 8d4f4e88da..a727f3f3a4 100644 --- a/src/Appwrite/Platform/Modules/Project/Http/Project/OAuth2/Gitlab/Update.php +++ b/src/Appwrite/Platform/Modules/Project/Http/Project/OAuth2/Gitlab/Update.php @@ -3,6 +3,7 @@ namespace Appwrite\Platform\Modules\Project\Http\Project\OAuth2\Gitlab; use Appwrite\Auth\OAuth2\Gitlab; +use Appwrite\Event\Event as QueueEvent; use Appwrite\Platform\Action; use Appwrite\Platform\Modules\Project\Http\Project\OAuth2\Base; use Appwrite\SDK\AuthType; @@ -75,8 +76,8 @@ class Update extends Base ->desc('Update project OAuth2 ' . $providerLabel) ->groups(['api', 'project']) ->label('scope', 'oauth2.write') - ->label('event', 'oauth2.' . $providerId . '.update') - ->label('audits.event', 'project.oauth2.' . $providerId . '.update') + ->label('event', 'oauth2.[providerId].update') + ->label('audits.event', 'project.oauth2.[providerId].update') ->label('audits.resource', 'project.oauth2/{response.$id}') ->label('sdk', new Method( namespace: 'project', @@ -99,6 +100,7 @@ class Update extends Base ->inject('dbForPlatform') ->inject('project') ->inject('authorization') + ->inject('queueForEvents') ->callback($this->handle(...)); } @@ -130,9 +132,11 @@ class Update extends Base Response $response, Database $dbForPlatform, Document $project, - Authorization $authorization + Authorization $authorization, + QueueEvent $queueForEvents ): void { $providerId = static::getProviderId(); + $queueForEvents->setParam('providerId', $providerId); // The secret is stored as JSON `{"clientSecret": "...", "endpoint": "..."}` // so that the Gitlab OAuth2 adapter can extract the endpoint via getEndpoint(). diff --git a/src/Appwrite/Platform/Modules/Project/Http/Project/OAuth2/Microsoft/Update.php b/src/Appwrite/Platform/Modules/Project/Http/Project/OAuth2/Microsoft/Update.php index 60479cf5f5..894631fbaa 100644 --- a/src/Appwrite/Platform/Modules/Project/Http/Project/OAuth2/Microsoft/Update.php +++ b/src/Appwrite/Platform/Modules/Project/Http/Project/OAuth2/Microsoft/Update.php @@ -3,6 +3,7 @@ namespace Appwrite\Platform\Modules\Project\Http\Project\OAuth2\Microsoft; use Appwrite\Auth\OAuth2\Microsoft; +use Appwrite\Event\Event as QueueEvent; use Appwrite\Platform\Action; use Appwrite\Platform\Modules\Project\Http\Project\OAuth2\Base; use Appwrite\SDK\AuthType; @@ -74,8 +75,8 @@ class Update extends Base ->desc('Update project OAuth2 ' . $providerLabel) ->groups(['api', 'project']) ->label('scope', 'oauth2.write') - ->label('event', 'oauth2.' . $providerId . '.update') - ->label('audits.event', 'project.oauth2.' . $providerId . '.update') + ->label('event', 'oauth2.[providerId].update') + ->label('audits.event', 'project.oauth2.[providerId].update') ->label('audits.resource', 'project.oauth2/{response.$id}') ->label('sdk', new Method( namespace: 'project', @@ -98,6 +99,7 @@ class Update extends Base ->inject('dbForPlatform') ->inject('project') ->inject('authorization') + ->inject('queueForEvents') ->callback($this->handle(...)); } @@ -129,9 +131,11 @@ class Update extends Base Response $response, Database $dbForPlatform, Document $project, - Authorization $authorization + Authorization $authorization, + QueueEvent $queueForEvents ): void { $providerId = static::getProviderId(); + $queueForEvents->setParam('providerId', $providerId); // The secret is stored as JSON `{"clientSecret": "...", "tenantID": "..."}` // to match the shape Microsoft's OAuth2 adapter expects (getTenantID()). diff --git a/src/Appwrite/Platform/Modules/Project/Http/Project/OAuth2/Oidc/Update.php b/src/Appwrite/Platform/Modules/Project/Http/Project/OAuth2/Oidc/Update.php index d849e18efd..f950c78b13 100644 --- a/src/Appwrite/Platform/Modules/Project/Http/Project/OAuth2/Oidc/Update.php +++ b/src/Appwrite/Platform/Modules/Project/Http/Project/OAuth2/Oidc/Update.php @@ -3,6 +3,7 @@ namespace Appwrite\Platform\Modules\Project\Http\Project\OAuth2\Oidc; use Appwrite\Auth\OAuth2\Oidc; +use Appwrite\Event\Event as QueueEvent; use Appwrite\Extend\Exception; use Appwrite\Platform\Action; use Appwrite\Platform\Modules\Project\Http\Project\OAuth2\Base; @@ -66,8 +67,8 @@ class Update extends Base ->desc('Update project OAuth2 ' . $providerLabel) ->groups(['api', 'project']) ->label('scope', 'oauth2.write') - ->label('event', 'oauth2.' . $providerId . '.update') - ->label('audits.event', 'project.oauth2.' . $providerId . '.update') + ->label('event', 'oauth2.[providerId].update') + ->label('audits.event', 'project.oauth2.[providerId].update') ->label('audits.resource', 'project.oauth2/{response.$id}') ->label('sdk', new Method( namespace: 'project', @@ -93,6 +94,7 @@ class Update extends Base ->inject('dbForPlatform') ->inject('project') ->inject('authorization') + ->inject('queueForEvents') ->callback($this->handle(...)); } @@ -138,9 +140,11 @@ class Update extends Base Response $response, Database $dbForPlatform, Document $project, - Authorization $authorization + Authorization $authorization, + QueueEvent $queueForEvents ): void { $providerId = static::getProviderId(); + $queueForEvents->setParam('providerId', $providerId); // The secret is stored as JSON // `{"clientSecret": "...", "wellKnownEndpoint": "...", "authorizationEndpoint": "...", "tokenEndpoint": "...", "userInfoEndpoint": "..."}` diff --git a/src/Appwrite/Platform/Modules/Project/Http/Project/OAuth2/Okta/Update.php b/src/Appwrite/Platform/Modules/Project/Http/Project/OAuth2/Okta/Update.php index 47d6cb2add..1aef7684be 100644 --- a/src/Appwrite/Platform/Modules/Project/Http/Project/OAuth2/Okta/Update.php +++ b/src/Appwrite/Platform/Modules/Project/Http/Project/OAuth2/Okta/Update.php @@ -3,6 +3,7 @@ namespace Appwrite\Platform\Modules\Project\Http\Project\OAuth2\Okta; use Appwrite\Auth\OAuth2\Okta; +use Appwrite\Event\Event as QueueEvent; use Appwrite\Extend\Exception; use Appwrite\Platform\Action; use Appwrite\Platform\Modules\Project\Http\Project\OAuth2\Base; @@ -66,8 +67,8 @@ class Update extends Base ->desc('Update project OAuth2 ' . $providerLabel) ->groups(['api', 'project']) ->label('scope', 'oauth2.write') - ->label('event', 'oauth2.' . $providerId . '.update') - ->label('audits.event', 'project.oauth2.' . $providerId . '.update') + ->label('event', 'oauth2.[providerId].update') + ->label('audits.event', 'project.oauth2.[providerId].update') ->label('audits.resource', 'project.oauth2/{response.$id}') ->label('sdk', new Method( namespace: 'project', @@ -91,6 +92,7 @@ class Update extends Base ->inject('dbForPlatform') ->inject('project') ->inject('authorization') + ->inject('queueForEvents') ->callback($this->handle(...)); } @@ -125,9 +127,11 @@ class Update extends Base Response $response, Database $dbForPlatform, Document $project, - Authorization $authorization + Authorization $authorization, + QueueEvent $queueForEvents ): void { $providerId = static::getProviderId(); + $queueForEvents->setParam('providerId', $providerId); // The secret is stored as JSON `{"clientSecret": "...", "oktaDomain": "...", "authorizationServerId": "..."}` // to match the shape Okta's OAuth2 adapter expects. diff --git a/src/Appwrite/Platform/Modules/Project/Services/Http.php b/src/Appwrite/Platform/Modules/Project/Services/Http.php index 8a330ca041..d6ff3c4925 100644 --- a/src/Appwrite/Platform/Modules/Project/Services/Http.php +++ b/src/Appwrite/Platform/Modules/Project/Services/Http.php @@ -17,6 +17,7 @@ use Appwrite\Platform\Modules\Project\Http\Project\MockPhone\Get as GetMockPhone use Appwrite\Platform\Modules\Project\Http\Project\MockPhone\Update as UpdateMockPhone; use Appwrite\Platform\Modules\Project\Http\Project\MockPhone\XList as ListMockPhones; use Appwrite\Platform\Modules\Project\Http\Project\OAuth2\Amazon\Update as UpdateOAuth2Amazon; +use Appwrite\Platform\Modules\Project\Http\Project\OAuth2\Apple\Update as UpdateOAuth2Apple; use Appwrite\Platform\Modules\Project\Http\Project\OAuth2\Auth0\Update as UpdateOAuth2Auth0; use Appwrite\Platform\Modules\Project\Http\Project\OAuth2\Authentik\Update as UpdateOAuth2Authentik; use Appwrite\Platform\Modules\Project\Http\Project\OAuth2\Autodesk\Update as UpdateOAuth2Autodesk; @@ -212,6 +213,7 @@ class Http extends Service $this->addAction(UpdateOAuth2Oidc::getName(), new UpdateOAuth2Oidc()); $this->addAction(UpdateOAuth2Okta::getName(), new UpdateOAuth2Okta()); $this->addAction(UpdateOAuth2Kick::getName(), new UpdateOAuth2Kick()); + $this->addAction(UpdateOAuth2Apple::getName(), new UpdateOAuth2Apple()); $this->addAction(UpdateOAuth2Microsoft::getName(), new UpdateOAuth2Microsoft()); } } diff --git a/src/Appwrite/Utopia/Response/Model/OAuth2Amazon.php b/src/Appwrite/Utopia/Response/Model/OAuth2Amazon.php index 33708374cc..f6c935648d 100644 --- a/src/Appwrite/Utopia/Response/Model/OAuth2Amazon.php +++ b/src/Appwrite/Utopia/Response/Model/OAuth2Amazon.php @@ -6,6 +6,10 @@ use Appwrite\Utopia\Response; class OAuth2Amazon extends OAuth2Base { + public array $conditions = [ + '$id' => 'amazon', + ]; + public function getProviderLabel(): string { return 'Amazon'; diff --git a/src/Appwrite/Utopia/Response/Model/OAuth2Apple.php b/src/Appwrite/Utopia/Response/Model/OAuth2Apple.php index 080925e6d8..075494b8ef 100644 --- a/src/Appwrite/Utopia/Response/Model/OAuth2Apple.php +++ b/src/Appwrite/Utopia/Response/Model/OAuth2Apple.php @@ -6,6 +6,10 @@ use Appwrite\Utopia\Response; class OAuth2Apple extends OAuth2Base { + public array $conditions = [ + '$id' => 'apple', + ]; + public function getProviderLabel(): string { return 'Apple'; @@ -39,6 +43,12 @@ class OAuth2Apple extends OAuth2Base // contents, Key ID, Team ID) instead of a single clientSecret, so the // rules are defined manually rather than delegating to OAuth2Base. $this + ->addRule('$id', [ + 'type' => self::TYPE_STRING, + 'description' => 'OAuth2 provider ID.', + 'default' => '', + 'example' => 'apple', + ]) ->addRule('enabled', [ 'type' => self::TYPE_BOOLEAN, 'description' => 'OAuth2 provider is active and can be used to create sessions.', diff --git a/src/Appwrite/Utopia/Response/Model/OAuth2Auth0.php b/src/Appwrite/Utopia/Response/Model/OAuth2Auth0.php index 2f1893f4d5..6e83b1b05b 100644 --- a/src/Appwrite/Utopia/Response/Model/OAuth2Auth0.php +++ b/src/Appwrite/Utopia/Response/Model/OAuth2Auth0.php @@ -6,6 +6,10 @@ use Appwrite\Utopia\Response; class OAuth2Auth0 extends OAuth2Base { + public array $conditions = [ + '$id' => 'auth0', + ]; + public function getProviderLabel(): string { return 'Auth0'; diff --git a/src/Appwrite/Utopia/Response/Model/OAuth2Authentik.php b/src/Appwrite/Utopia/Response/Model/OAuth2Authentik.php index 4e67e1f4fe..db192ea24b 100644 --- a/src/Appwrite/Utopia/Response/Model/OAuth2Authentik.php +++ b/src/Appwrite/Utopia/Response/Model/OAuth2Authentik.php @@ -6,6 +6,10 @@ use Appwrite\Utopia\Response; class OAuth2Authentik extends OAuth2Base { + public array $conditions = [ + '$id' => 'authentik', + ]; + public function getProviderLabel(): string { return 'Authentik'; diff --git a/src/Appwrite/Utopia/Response/Model/OAuth2Autodesk.php b/src/Appwrite/Utopia/Response/Model/OAuth2Autodesk.php index 6f55b5d475..3317f15bec 100644 --- a/src/Appwrite/Utopia/Response/Model/OAuth2Autodesk.php +++ b/src/Appwrite/Utopia/Response/Model/OAuth2Autodesk.php @@ -6,6 +6,10 @@ use Appwrite\Utopia\Response; class OAuth2Autodesk extends OAuth2Base { + public array $conditions = [ + '$id' => 'autodesk', + ]; + public function getProviderLabel(): string { return 'Autodesk'; diff --git a/src/Appwrite/Utopia/Response/Model/OAuth2Base.php b/src/Appwrite/Utopia/Response/Model/OAuth2Base.php index 8eb8d0f4cb..058afc0fa1 100644 --- a/src/Appwrite/Utopia/Response/Model/OAuth2Base.php +++ b/src/Appwrite/Utopia/Response/Model/OAuth2Base.php @@ -97,6 +97,12 @@ abstract class OAuth2Base extends Model public function __construct() { $this + ->addRule('$id', [ + 'type' => self::TYPE_STRING, + 'description' => 'OAuth2 provider ID.', + 'default' => '', + 'example' => 'github', + ]) ->addRule('enabled', [ 'type' => self::TYPE_BOOLEAN, 'description' => 'OAuth2 provider is active and can be used to create sessions.', diff --git a/src/Appwrite/Utopia/Response/Model/OAuth2Bitbucket.php b/src/Appwrite/Utopia/Response/Model/OAuth2Bitbucket.php index 3465cb6cd7..870cd0bda3 100644 --- a/src/Appwrite/Utopia/Response/Model/OAuth2Bitbucket.php +++ b/src/Appwrite/Utopia/Response/Model/OAuth2Bitbucket.php @@ -6,6 +6,10 @@ use Appwrite\Utopia\Response; class OAuth2Bitbucket extends OAuth2Base { + public array $conditions = [ + '$id' => 'bitbucket', + ]; + public function getProviderLabel(): string { return 'Bitbucket'; diff --git a/src/Appwrite/Utopia/Response/Model/OAuth2Bitly.php b/src/Appwrite/Utopia/Response/Model/OAuth2Bitly.php index e32d089898..6a27176d3d 100644 --- a/src/Appwrite/Utopia/Response/Model/OAuth2Bitly.php +++ b/src/Appwrite/Utopia/Response/Model/OAuth2Bitly.php @@ -6,6 +6,10 @@ use Appwrite\Utopia\Response; class OAuth2Bitly extends OAuth2Base { + public array $conditions = [ + '$id' => 'bitly', + ]; + public function getProviderLabel(): string { return 'Bitly'; diff --git a/src/Appwrite/Utopia/Response/Model/OAuth2Box.php b/src/Appwrite/Utopia/Response/Model/OAuth2Box.php index 6c23c0d3ad..9bbfd6021f 100644 --- a/src/Appwrite/Utopia/Response/Model/OAuth2Box.php +++ b/src/Appwrite/Utopia/Response/Model/OAuth2Box.php @@ -6,6 +6,10 @@ use Appwrite\Utopia\Response; class OAuth2Box extends OAuth2Base { + public array $conditions = [ + '$id' => 'box', + ]; + public function getProviderLabel(): string { return 'Box'; diff --git a/src/Appwrite/Utopia/Response/Model/OAuth2Dailymotion.php b/src/Appwrite/Utopia/Response/Model/OAuth2Dailymotion.php index 0e149c986c..6c3d0eba95 100644 --- a/src/Appwrite/Utopia/Response/Model/OAuth2Dailymotion.php +++ b/src/Appwrite/Utopia/Response/Model/OAuth2Dailymotion.php @@ -6,6 +6,10 @@ use Appwrite\Utopia\Response; class OAuth2Dailymotion extends OAuth2Base { + public array $conditions = [ + '$id' => 'dailymotion', + ]; + public function getProviderLabel(): string { return 'Dailymotion'; diff --git a/src/Appwrite/Utopia/Response/Model/OAuth2Discord.php b/src/Appwrite/Utopia/Response/Model/OAuth2Discord.php index da7c4873b5..6ac72ad8e4 100644 --- a/src/Appwrite/Utopia/Response/Model/OAuth2Discord.php +++ b/src/Appwrite/Utopia/Response/Model/OAuth2Discord.php @@ -6,6 +6,10 @@ use Appwrite\Utopia\Response; class OAuth2Discord extends OAuth2Base { + public array $conditions = [ + '$id' => 'discord', + ]; + public function getProviderLabel(): string { return 'Discord'; diff --git a/src/Appwrite/Utopia/Response/Model/OAuth2Disqus.php b/src/Appwrite/Utopia/Response/Model/OAuth2Disqus.php index dbdc973b65..bec78ed189 100644 --- a/src/Appwrite/Utopia/Response/Model/OAuth2Disqus.php +++ b/src/Appwrite/Utopia/Response/Model/OAuth2Disqus.php @@ -6,6 +6,10 @@ use Appwrite\Utopia\Response; class OAuth2Disqus extends OAuth2Base { + public array $conditions = [ + '$id' => 'disqus', + ]; + public function getProviderLabel(): string { return 'Disqus'; diff --git a/src/Appwrite/Utopia/Response/Model/OAuth2Dropbox.php b/src/Appwrite/Utopia/Response/Model/OAuth2Dropbox.php index 4924db1397..db7285fd47 100644 --- a/src/Appwrite/Utopia/Response/Model/OAuth2Dropbox.php +++ b/src/Appwrite/Utopia/Response/Model/OAuth2Dropbox.php @@ -6,6 +6,10 @@ use Appwrite\Utopia\Response; class OAuth2Dropbox extends OAuth2Base { + public array $conditions = [ + '$id' => 'dropbox', + ]; + public function getProviderLabel(): string { return 'Dropbox'; diff --git a/src/Appwrite/Utopia/Response/Model/OAuth2Etsy.php b/src/Appwrite/Utopia/Response/Model/OAuth2Etsy.php index f80cce7cf1..be12e4c51c 100644 --- a/src/Appwrite/Utopia/Response/Model/OAuth2Etsy.php +++ b/src/Appwrite/Utopia/Response/Model/OAuth2Etsy.php @@ -6,6 +6,10 @@ use Appwrite\Utopia\Response; class OAuth2Etsy extends OAuth2Base { + public array $conditions = [ + '$id' => 'etsy', + ]; + public function getProviderLabel(): string { return 'Etsy'; diff --git a/src/Appwrite/Utopia/Response/Model/OAuth2Facebook.php b/src/Appwrite/Utopia/Response/Model/OAuth2Facebook.php index 8bec9b9bf8..9ad14bdb2a 100644 --- a/src/Appwrite/Utopia/Response/Model/OAuth2Facebook.php +++ b/src/Appwrite/Utopia/Response/Model/OAuth2Facebook.php @@ -6,6 +6,10 @@ use Appwrite\Utopia\Response; class OAuth2Facebook extends OAuth2Base { + public array $conditions = [ + '$id' => 'facebook', + ]; + public function getProviderLabel(): string { return 'Facebook'; diff --git a/src/Appwrite/Utopia/Response/Model/OAuth2Figma.php b/src/Appwrite/Utopia/Response/Model/OAuth2Figma.php index 533d353d01..9339257e5b 100644 --- a/src/Appwrite/Utopia/Response/Model/OAuth2Figma.php +++ b/src/Appwrite/Utopia/Response/Model/OAuth2Figma.php @@ -6,6 +6,10 @@ use Appwrite\Utopia\Response; class OAuth2Figma extends OAuth2Base { + public array $conditions = [ + '$id' => 'figma', + ]; + public function getProviderLabel(): string { return 'Figma'; diff --git a/src/Appwrite/Utopia/Response/Model/OAuth2GitHub.php b/src/Appwrite/Utopia/Response/Model/OAuth2GitHub.php index 30d3a71187..2f975f16e4 100644 --- a/src/Appwrite/Utopia/Response/Model/OAuth2GitHub.php +++ b/src/Appwrite/Utopia/Response/Model/OAuth2GitHub.php @@ -6,6 +6,10 @@ use Appwrite\Utopia\Response; class OAuth2GitHub extends OAuth2Base { + public array $conditions = [ + '$id' => 'github', + ]; + public function getProviderLabel(): string { return 'GitHub'; diff --git a/src/Appwrite/Utopia/Response/Model/OAuth2Gitlab.php b/src/Appwrite/Utopia/Response/Model/OAuth2Gitlab.php index 41c91acfe8..39c148caec 100644 --- a/src/Appwrite/Utopia/Response/Model/OAuth2Gitlab.php +++ b/src/Appwrite/Utopia/Response/Model/OAuth2Gitlab.php @@ -6,6 +6,10 @@ use Appwrite\Utopia\Response; class OAuth2Gitlab extends OAuth2Base { + public array $conditions = [ + '$id' => 'gitlab', + ]; + public function getProviderLabel(): string { return 'GitLab'; diff --git a/src/Appwrite/Utopia/Response/Model/OAuth2Google.php b/src/Appwrite/Utopia/Response/Model/OAuth2Google.php index 109060b7bd..3dbc892631 100644 --- a/src/Appwrite/Utopia/Response/Model/OAuth2Google.php +++ b/src/Appwrite/Utopia/Response/Model/OAuth2Google.php @@ -6,6 +6,10 @@ use Appwrite\Utopia\Response; class OAuth2Google extends OAuth2Base { + public array $conditions = [ + '$id' => 'google', + ]; + public function getProviderLabel(): string { return 'Google'; diff --git a/src/Appwrite/Utopia/Response/Model/OAuth2Kick.php b/src/Appwrite/Utopia/Response/Model/OAuth2Kick.php index e4692ac6ea..2f5814f1d3 100644 --- a/src/Appwrite/Utopia/Response/Model/OAuth2Kick.php +++ b/src/Appwrite/Utopia/Response/Model/OAuth2Kick.php @@ -6,6 +6,10 @@ use Appwrite\Utopia\Response; class OAuth2Kick extends OAuth2Base { + public array $conditions = [ + '$id' => 'kick', + ]; + public function getProviderLabel(): string { return 'Kick'; diff --git a/src/Appwrite/Utopia/Response/Model/OAuth2Linkedin.php b/src/Appwrite/Utopia/Response/Model/OAuth2Linkedin.php index ccfec9d523..99f8bfa8f7 100644 --- a/src/Appwrite/Utopia/Response/Model/OAuth2Linkedin.php +++ b/src/Appwrite/Utopia/Response/Model/OAuth2Linkedin.php @@ -6,6 +6,10 @@ use Appwrite\Utopia\Response; class OAuth2Linkedin extends OAuth2Base { + public array $conditions = [ + '$id' => 'linkedin', + ]; + public function getProviderLabel(): string { return 'LinkedIn'; diff --git a/src/Appwrite/Utopia/Response/Model/OAuth2Microsoft.php b/src/Appwrite/Utopia/Response/Model/OAuth2Microsoft.php index 30cd8da2f5..b7004fdb85 100644 --- a/src/Appwrite/Utopia/Response/Model/OAuth2Microsoft.php +++ b/src/Appwrite/Utopia/Response/Model/OAuth2Microsoft.php @@ -6,6 +6,10 @@ use Appwrite\Utopia\Response; class OAuth2Microsoft extends OAuth2Base { + public array $conditions = [ + '$id' => 'microsoft', + ]; + public function getProviderLabel(): string { return 'Microsoft'; diff --git a/src/Appwrite/Utopia/Response/Model/OAuth2Notion.php b/src/Appwrite/Utopia/Response/Model/OAuth2Notion.php index bb4260f672..8796ce603e 100644 --- a/src/Appwrite/Utopia/Response/Model/OAuth2Notion.php +++ b/src/Appwrite/Utopia/Response/Model/OAuth2Notion.php @@ -6,6 +6,10 @@ use Appwrite\Utopia\Response; class OAuth2Notion extends OAuth2Base { + public array $conditions = [ + '$id' => 'notion', + ]; + public function getProviderLabel(): string { return 'Notion'; diff --git a/src/Appwrite/Utopia/Response/Model/OAuth2Oidc.php b/src/Appwrite/Utopia/Response/Model/OAuth2Oidc.php index 97a9ace5ad..e4f0919666 100644 --- a/src/Appwrite/Utopia/Response/Model/OAuth2Oidc.php +++ b/src/Appwrite/Utopia/Response/Model/OAuth2Oidc.php @@ -6,6 +6,10 @@ use Appwrite\Utopia\Response; class OAuth2Oidc extends OAuth2Base { + public array $conditions = [ + '$id' => 'oidc', + ]; + public function getProviderLabel(): string { return 'OpenID Connect'; diff --git a/src/Appwrite/Utopia/Response/Model/OAuth2Okta.php b/src/Appwrite/Utopia/Response/Model/OAuth2Okta.php index f0926193d8..0804adfa1b 100644 --- a/src/Appwrite/Utopia/Response/Model/OAuth2Okta.php +++ b/src/Appwrite/Utopia/Response/Model/OAuth2Okta.php @@ -6,6 +6,10 @@ use Appwrite\Utopia\Response; class OAuth2Okta extends OAuth2Base { + public array $conditions = [ + '$id' => 'okta', + ]; + public function getProviderLabel(): string { return 'Okta'; diff --git a/src/Appwrite/Utopia/Response/Model/OAuth2Paypal.php b/src/Appwrite/Utopia/Response/Model/OAuth2Paypal.php index b8e836eedd..20ff9f9ba5 100644 --- a/src/Appwrite/Utopia/Response/Model/OAuth2Paypal.php +++ b/src/Appwrite/Utopia/Response/Model/OAuth2Paypal.php @@ -6,6 +6,10 @@ use Appwrite\Utopia\Response; class OAuth2Paypal extends OAuth2Base { + public array $conditions = [ + '$id' => ['paypal', 'paypalSandbox'], + ]; + public function getProviderLabel(): string { return 'PayPal'; diff --git a/src/Appwrite/Utopia/Response/Model/OAuth2Podio.php b/src/Appwrite/Utopia/Response/Model/OAuth2Podio.php index 429d1e666d..f588136a62 100644 --- a/src/Appwrite/Utopia/Response/Model/OAuth2Podio.php +++ b/src/Appwrite/Utopia/Response/Model/OAuth2Podio.php @@ -6,6 +6,10 @@ use Appwrite\Utopia\Response; class OAuth2Podio extends OAuth2Base { + public array $conditions = [ + '$id' => 'podio', + ]; + public function getProviderLabel(): string { return 'Podio'; diff --git a/src/Appwrite/Utopia/Response/Model/OAuth2Salesforce.php b/src/Appwrite/Utopia/Response/Model/OAuth2Salesforce.php index d880f87745..c76ddce854 100644 --- a/src/Appwrite/Utopia/Response/Model/OAuth2Salesforce.php +++ b/src/Appwrite/Utopia/Response/Model/OAuth2Salesforce.php @@ -6,6 +6,10 @@ use Appwrite\Utopia\Response; class OAuth2Salesforce extends OAuth2Base { + public array $conditions = [ + '$id' => 'salesforce', + ]; + public function getProviderLabel(): string { return 'Salesforce'; diff --git a/src/Appwrite/Utopia/Response/Model/OAuth2Slack.php b/src/Appwrite/Utopia/Response/Model/OAuth2Slack.php index d034cfa6af..47eb058816 100644 --- a/src/Appwrite/Utopia/Response/Model/OAuth2Slack.php +++ b/src/Appwrite/Utopia/Response/Model/OAuth2Slack.php @@ -6,6 +6,10 @@ use Appwrite\Utopia\Response; class OAuth2Slack extends OAuth2Base { + public array $conditions = [ + '$id' => 'slack', + ]; + public function getProviderLabel(): string { return 'Slack'; diff --git a/src/Appwrite/Utopia/Response/Model/OAuth2Spotify.php b/src/Appwrite/Utopia/Response/Model/OAuth2Spotify.php index 0aa6f131ce..3fdf9da659 100644 --- a/src/Appwrite/Utopia/Response/Model/OAuth2Spotify.php +++ b/src/Appwrite/Utopia/Response/Model/OAuth2Spotify.php @@ -6,6 +6,10 @@ use Appwrite\Utopia\Response; class OAuth2Spotify extends OAuth2Base { + public array $conditions = [ + '$id' => 'spotify', + ]; + public function getProviderLabel(): string { return 'Spotify'; diff --git a/src/Appwrite/Utopia/Response/Model/OAuth2Stripe.php b/src/Appwrite/Utopia/Response/Model/OAuth2Stripe.php index bcb2325521..98c7a88af7 100644 --- a/src/Appwrite/Utopia/Response/Model/OAuth2Stripe.php +++ b/src/Appwrite/Utopia/Response/Model/OAuth2Stripe.php @@ -6,6 +6,10 @@ use Appwrite\Utopia\Response; class OAuth2Stripe extends OAuth2Base { + public array $conditions = [ + '$id' => 'stripe', + ]; + public function getProviderLabel(): string { return 'Stripe'; diff --git a/src/Appwrite/Utopia/Response/Model/OAuth2Tradeshift.php b/src/Appwrite/Utopia/Response/Model/OAuth2Tradeshift.php index dcf39cc8b0..8a790b31f8 100644 --- a/src/Appwrite/Utopia/Response/Model/OAuth2Tradeshift.php +++ b/src/Appwrite/Utopia/Response/Model/OAuth2Tradeshift.php @@ -6,6 +6,10 @@ use Appwrite\Utopia\Response; class OAuth2Tradeshift extends OAuth2Base { + public array $conditions = [ + '$id' => ['tradeshift', 'tradeshiftSandbox'], + ]; + public function getProviderLabel(): string { return 'Tradeshift'; diff --git a/src/Appwrite/Utopia/Response/Model/OAuth2Twitch.php b/src/Appwrite/Utopia/Response/Model/OAuth2Twitch.php index 320084493d..4b03b3d6cc 100644 --- a/src/Appwrite/Utopia/Response/Model/OAuth2Twitch.php +++ b/src/Appwrite/Utopia/Response/Model/OAuth2Twitch.php @@ -6,6 +6,10 @@ use Appwrite\Utopia\Response; class OAuth2Twitch extends OAuth2Base { + public array $conditions = [ + '$id' => 'twitch', + ]; + public function getProviderLabel(): string { return 'Twitch'; diff --git a/src/Appwrite/Utopia/Response/Model/OAuth2WordPress.php b/src/Appwrite/Utopia/Response/Model/OAuth2WordPress.php index 099b5154e7..89df7a081e 100644 --- a/src/Appwrite/Utopia/Response/Model/OAuth2WordPress.php +++ b/src/Appwrite/Utopia/Response/Model/OAuth2WordPress.php @@ -6,6 +6,10 @@ use Appwrite\Utopia\Response; class OAuth2WordPress extends OAuth2Base { + public array $conditions = [ + '$id' => 'wordpress', + ]; + public function getProviderLabel(): string { return 'WordPress'; diff --git a/src/Appwrite/Utopia/Response/Model/OAuth2X.php b/src/Appwrite/Utopia/Response/Model/OAuth2X.php index 3e9303015a..2f36166c19 100644 --- a/src/Appwrite/Utopia/Response/Model/OAuth2X.php +++ b/src/Appwrite/Utopia/Response/Model/OAuth2X.php @@ -6,6 +6,10 @@ use Appwrite\Utopia\Response; class OAuth2X extends OAuth2Base { + public array $conditions = [ + '$id' => 'x', + ]; + public function getProviderLabel(): string { return 'X'; diff --git a/src/Appwrite/Utopia/Response/Model/OAuth2Yahoo.php b/src/Appwrite/Utopia/Response/Model/OAuth2Yahoo.php index cc0e3ad1b8..0e3bc7b8a6 100644 --- a/src/Appwrite/Utopia/Response/Model/OAuth2Yahoo.php +++ b/src/Appwrite/Utopia/Response/Model/OAuth2Yahoo.php @@ -6,6 +6,10 @@ use Appwrite\Utopia\Response; class OAuth2Yahoo extends OAuth2Base { + public array $conditions = [ + '$id' => 'yahoo', + ]; + public function getProviderLabel(): string { return 'Yahoo'; diff --git a/src/Appwrite/Utopia/Response/Model/OAuth2Yandex.php b/src/Appwrite/Utopia/Response/Model/OAuth2Yandex.php index c720055e71..dd6b8a4486 100644 --- a/src/Appwrite/Utopia/Response/Model/OAuth2Yandex.php +++ b/src/Appwrite/Utopia/Response/Model/OAuth2Yandex.php @@ -6,6 +6,10 @@ use Appwrite\Utopia\Response; class OAuth2Yandex extends OAuth2Base { + public array $conditions = [ + '$id' => 'yandex', + ]; + public function getProviderLabel(): string { return 'Yandex'; diff --git a/src/Appwrite/Utopia/Response/Model/OAuth2Zoho.php b/src/Appwrite/Utopia/Response/Model/OAuth2Zoho.php index 67adcaae6d..abf9e98d9a 100644 --- a/src/Appwrite/Utopia/Response/Model/OAuth2Zoho.php +++ b/src/Appwrite/Utopia/Response/Model/OAuth2Zoho.php @@ -6,6 +6,10 @@ use Appwrite\Utopia\Response; class OAuth2Zoho extends OAuth2Base { + public array $conditions = [ + '$id' => 'zoho', + ]; + public function getProviderLabel(): string { return 'Zoho'; diff --git a/src/Appwrite/Utopia/Response/Model/OAuth2Zoom.php b/src/Appwrite/Utopia/Response/Model/OAuth2Zoom.php index dd87338b8b..d14fe6d0cf 100644 --- a/src/Appwrite/Utopia/Response/Model/OAuth2Zoom.php +++ b/src/Appwrite/Utopia/Response/Model/OAuth2Zoom.php @@ -6,6 +6,10 @@ use Appwrite\Utopia\Response; class OAuth2Zoom extends OAuth2Base { + public array $conditions = [ + '$id' => 'zoom', + ]; + public function getProviderLabel(): string { return 'Zoom';