diff --git a/app/config/collections.php b/app/config/collections.php index 0b4dda6851..c7572ddad7 100644 --- a/app/config/collections.php +++ b/app/config/collections.php @@ -1244,6 +1244,17 @@ $collections = [ 'array' => false, 'filters' => [], ], + [ + '$id' => ID::custom('labels'), + 'type' => Database::VAR_STRING, + 'format' => '', + 'size' => 128, + 'signed' => true, + 'required' => false, + 'default' => null, + 'array' => true, + 'filters' => [], + ], [ '$id' => ID::custom('passwordHistory'), 'type' => Database::VAR_STRING, diff --git a/src/Appwrite/Utopia/Response/Model/User.php b/src/Appwrite/Utopia/Response/Model/User.php index 648b1c5dce..0fa07cb79a 100644 --- a/src/Appwrite/Utopia/Response/Model/User.php +++ b/src/Appwrite/Utopia/Response/Model/User.php @@ -77,6 +77,13 @@ class User extends Model 'default' => true, 'example' => true, ]) + ->addRule('labels', [ + 'type' => self::TYPE_STRING, + 'description' => 'Labels for the user.', + 'default' => [], + 'example' => ['vip'], + 'array' => true, + ]) ->addRule('passwordUpdate', [ 'type' => self::TYPE_DATETIME, 'description' => 'Password update time in ISO 8601 format.', diff --git a/tests/e2e/Services/Account/AccountBase.php b/tests/e2e/Services/Account/AccountBase.php index ba751516d3..7665b10dc0 100644 --- a/tests/e2e/Services/Account/AccountBase.php +++ b/tests/e2e/Services/Account/AccountBase.php @@ -39,6 +39,7 @@ trait AccountBase $this->assertEquals(true, $dateValidator->isValid($response['body']['registration'])); $this->assertEquals($response['body']['email'], $email); $this->assertEquals($response['body']['name'], $name); + $this->assertEquals($response['body']['labels'], []); /** * Test for FAILURE diff --git a/tests/e2e/Services/Users/UsersBase.php b/tests/e2e/Services/Users/UsersBase.php index 9f14c59306..cb83faea82 100644 --- a/tests/e2e/Services/Users/UsersBase.php +++ b/tests/e2e/Services/Users/UsersBase.php @@ -35,6 +35,7 @@ trait UsersBase $this->assertEquals($body['email'], 'cristiano.ronaldo@manchester-united.co.uk'); $this->assertEquals($body['status'], true); $this->assertGreaterThan('2000-01-01 00:00:00', $body['registration']); + $this->assertEquals($body['labels'], []); /** * Test Create with Custom ID for SUCCESS