From b8e22151f64e6f623815ab4df0cca7f06a8503e2 Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Wed, 2 Aug 2023 15:22:52 -0700 Subject: [PATCH] Remove identity status Until we have a clearer picture of why we need it, it would be best to remove it since it's easier to add it later than to remove it after it's released. --- app/config/collections.php | 18 ------------------ app/controllers/api/account.php | 2 -- .../Database/Validator/Queries/Identities.php | 1 - .../Utopia/Response/Model/Identity.php | 6 ------ 4 files changed, 27 deletions(-) diff --git a/app/config/collections.php b/app/config/collections.php index bd1b634d4..a484f379c 100644 --- a/app/config/collections.php +++ b/app/config/collections.php @@ -1959,17 +1959,6 @@ $collections = [ 'array' => false, 'filters' => [], ], - [ - '$id' => ID::custom('status'), - 'type' => Database::VAR_STRING, - 'format' => '', - 'size' => 256, - 'signed' => true, - 'required' => true, - 'default' => 'connected', - 'array' => false, - 'filters' => [], - ], [ '$id' => ID::custom('providerUid'), 'type' => Database::VAR_STRING, @@ -2062,13 +2051,6 @@ $collections = [ 'lengths' => [100], 'orders' => [Database::ORDER_ASC], ], - [ - '$id' => ID::custom('_key_status'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['status'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], [ '$id' => ID::custom('_key_providerUid'), 'type' => Database::INDEX_KEY, diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 0f9db07e9..c1874df7e 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -628,7 +628,6 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') 'userInternalId' => $user->getInternalId(), 'userId' => $userId, 'provider' => $provider, - 'status' => 'connected', 'providerUid' => $oauth2ID, 'providerEmail' => $email, 'providerAccessToken' => $accessToken, @@ -637,7 +636,6 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') ])); } else { $identity - ->setAttribute('status', 'connected') ->setAttribute('providerAccessToken', $accessToken) ->setAttribute('providerRefreshToken', $refreshToken) ->setAttribute('providerAccessTokenExpiry', DateTime::addSeconds(new \DateTime(), (int)$accessTokenExpiry)); diff --git a/src/Appwrite/Utopia/Database/Validator/Queries/Identities.php b/src/Appwrite/Utopia/Database/Validator/Queries/Identities.php index 6d51740f9..2099d9e51 100644 --- a/src/Appwrite/Utopia/Database/Validator/Queries/Identities.php +++ b/src/Appwrite/Utopia/Database/Validator/Queries/Identities.php @@ -7,7 +7,6 @@ class Identities extends Base public const ALLOWED_ATTRIBUTES = [ 'userId', 'provider', - 'status', 'providerUid', 'providerEmail', ]; diff --git a/src/Appwrite/Utopia/Response/Model/Identity.php b/src/Appwrite/Utopia/Response/Model/Identity.php index 858f1da85..ff7f57a3e 100644 --- a/src/Appwrite/Utopia/Response/Model/Identity.php +++ b/src/Appwrite/Utopia/Response/Model/Identity.php @@ -40,12 +40,6 @@ class Identity extends Model 'default' => '', 'example' => 'email', ]) - ->addRule('status', [ - 'type' => self::TYPE_STRING, - 'description' => 'Connection status. Can be connected or disconnected', - 'default' => '', - 'example' => 'connected', - ]) ->addRule('providerUid', [ 'type' => self::TYPE_STRING, 'description' => 'ID of the User in the Identity Provider.',