diff --git a/app/console b/app/console index 5169fe16d6..f483d9631d 160000 --- a/app/console +++ b/app/console @@ -1 +1 @@ -Subproject commit 5169fe16d63066f64ab5013c78953aea04e24b53 +Subproject commit f483d9631d6f21e94aedb20b5c37c56fea06c23e diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index b7f1526b56..066a959efc 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -105,7 +105,8 @@ App::post('/v1/projects') 'passwordHistory' => 0, 'passwordDictionary' => false, 'duration' => Auth::TOKEN_EXPIRATION_LOGIN_LONG, - 'personalDataCheck' => false + 'personalDataCheck' => false, + 'mockNumbers' => [] ]; foreach ($auth as $method) { $auths[$method['key'] ?? ''] = true; diff --git a/app/init.php b/app/init.php index 9b406916c5..eae9b21b44 100644 --- a/app/init.php +++ b/app/init.php @@ -1321,6 +1321,7 @@ App::setResource('console', function () { 'legalAddress' => '', 'legalTaxId' => '', 'auths' => [ + 'mockNumbers' => [], 'invites' => System::getEnv('_APP_CONSOLE_INVITES', 'enabled') === 'enabled', 'limit' => (System::getEnv('_APP_CONSOLE_WHITELIST_ROOT', 'enabled') === 'enabled') ? 1 : 0, // limit signup to 1 user 'duration' => Auth::TOKEN_EXPIRATION_LOGIN_LONG, // 1 Year in seconds diff --git a/src/Appwrite/Utopia/Response.php b/src/Appwrite/Utopia/Response.php index 254b23582c..1e1d5f87ae 100644 --- a/src/Appwrite/Utopia/Response.php +++ b/src/Appwrite/Utopia/Response.php @@ -351,7 +351,6 @@ class Response extends SwooleResponse ->setModel(new BaseList('Projects List', self::MODEL_PROJECT_LIST, 'projects', self::MODEL_PROJECT, true, false)) ->setModel(new BaseList('Webhooks List', self::MODEL_WEBHOOK_LIST, 'webhooks', self::MODEL_WEBHOOK, true, false)) ->setModel(new BaseList('API Keys List', self::MODEL_KEY_LIST, 'keys', self::MODEL_KEY, true, false)) - ->setModel(new BaseList('Providers List', self::MODEL_PROVIDER_LIST, 'providers', self::MODEL_PROVIDER, true, false)) ->setModel(new BaseList('Mock Numbers List', self::MODEL_MOCK_NUMBER_LIST, 'numbers', self::MODEL_MOCK_NUMBER, true, false)) ->setModel(new BaseList('Auth Providers List', self::MODEL_AUTH_PROVIDER_LIST, 'platforms', self::MODEL_AUTH_PROVIDER, true, false)) ->setModel(new BaseList('Platforms List', self::MODEL_PLATFORM_LIST, 'platforms', self::MODEL_PLATFORM, true, false)) @@ -424,7 +423,6 @@ class Response extends SwooleResponse ->setModel(new Project()) ->setModel(new Webhook()) ->setModel(new Key()) - ->setModel(new Provider()) ->setModel(new MockNumber()) ->setModel(new AuthProvider()) ->setModel(new Platform()) diff --git a/src/Appwrite/Utopia/Response/Model/MockNumber.php b/src/Appwrite/Utopia/Response/Model/MockNumber.php index fec8331ec5..14ce747da6 100644 --- a/src/Appwrite/Utopia/Response/Model/MockNumber.php +++ b/src/Appwrite/Utopia/Response/Model/MockNumber.php @@ -10,7 +10,7 @@ class MockNumber extends Model public function __construct() { $this - ->addRule('number', [ + ->addRule('phone', [ 'type' => self::TYPE_STRING, 'description' => 'Mock phone number for testing phone authentication. Useful for testing phone authentication without sending an SMS.', 'default' => '', diff --git a/src/Appwrite/Utopia/Response/Model/Project.php b/src/Appwrite/Utopia/Response/Model/Project.php index bf0e6ffeec..638e9e4549 100644 --- a/src/Appwrite/Utopia/Response/Model/Project.php +++ b/src/Appwrite/Utopia/Response/Model/Project.php @@ -140,7 +140,7 @@ class Project extends Model ]) ->addRule('authMockNumbers', [ 'type' => Response::MODEL_MOCK_NUMBER_LIST, - 'description' => 'Whether or not to check the user password for similarity with their personal data.', + 'description' => 'An array of mock numbers and their corresponding verification codes (OTPs).', 'default' => [], 'example' => true, ]) diff --git a/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php b/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php index 2c1d873cc9..753322f168 100644 --- a/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php +++ b/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php @@ -21,8 +21,8 @@ class ProjectsConsoleClientTest extends Scope use SideClient; /** - * @group testing - * */ + * @group smtpAndTemplates + * @group projectsCRUD */ public function testCreateProject(): array { /**