From 69d42fc980c781cd3b08e94fa171cb77bbc61228 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 29 Sep 2022 16:52:57 +1300 Subject: [PATCH 1/2] Fix create scrypt user route param defaults types --- app/controllers/api/users.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php index d2b303c6a1..407bc1eaab 100644 --- a/app/controllers/api/users.php +++ b/app/controllers/api/users.php @@ -290,10 +290,10 @@ App::post('/v1/users/scrypt') ->param('email', '', new Email(), 'User email.') ->param('password', '', new Password(), 'User password hashed using Scrypt.') ->param('passwordSalt', '', new Text(128), 'Optional salt used to hash password.') - ->param('passwordCpu', '', new Integer(), 'Optional CPU cost used to hash password.') - ->param('passwordMemory', '', new Integer(), 'Optional memory cost used to hash password.') - ->param('passwordParallel', '', new Integer(), 'Optional parallelization cost used to hash password.') - ->param('passwordLength', '', new Integer(), 'Optional hash length used to hash password.') + ->param('passwordCpu', 8, new Integer(), 'Optional CPU cost used to hash password.') + ->param('passwordMemory', 14, new Integer(), 'Optional memory cost used to hash password.') + ->param('passwordParallel', 1, new Integer(), 'Optional parallelization cost used to hash password.') + ->param('passwordLength', 64, new Integer(), 'Optional hash length used to hash password.') ->param('name', '', new Text(128), 'User name. Max length: 128 chars.', true) ->inject('response') ->inject('dbForProject') From 5e1bb655dcb68a7259d3b1500f300189396a6ef1 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 29 Sep 2022 16:54:01 +1300 Subject: [PATCH 2/2] Fix scrypt algo response model rule default types --- src/Appwrite/Utopia/Response/Model/AlgoScrypt.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Appwrite/Utopia/Response/Model/AlgoScrypt.php b/src/Appwrite/Utopia/Response/Model/AlgoScrypt.php index 606bcb50a7..ca3ab3dd70 100644 --- a/src/Appwrite/Utopia/Response/Model/AlgoScrypt.php +++ b/src/Appwrite/Utopia/Response/Model/AlgoScrypt.php @@ -13,26 +13,26 @@ class AlgoScrypt extends Model ->addRule('costCpu', [ 'type' => self::TYPE_INTEGER, 'description' => 'CPU complexity of computed hash.', - 'default' => '', + 'default' => 8, 'example' => 8, ]) ->addRule('costMemory', [ 'type' => self::TYPE_INTEGER, 'description' => 'Memory complexity of computed hash.', - 'default' => '', + 'default' => 14, 'example' => 14, ]) ->addRule('costParallel', [ 'type' => self::TYPE_INTEGER, 'description' => 'Parallelization of computed hash.', - 'default' => '', + 'default' => 1, 'example' => 1, ]) ->addRule('length', [ 'type' => self::TYPE_INTEGER, 'description' => 'Length used to compute hash.', - 'default' => '', - 'example' => 1, + 'default' => 64, + 'example' => 64, ]) ; }