1
0
Fork 0
mirror of synced 2024-10-02 02:07:04 +13:00

Removed import path

This commit is contained in:
Eldad Fux 2022-08-14 19:29:07 +03:00
parent 98fc8669e1
commit 7d83f9d644
2 changed files with 13 additions and 13 deletions

View file

@ -127,7 +127,7 @@ App::post('/v1/users/bcrypt')
$response->dynamic($user, Response::MODEL_USER); $response->dynamic($user, Response::MODEL_USER);
}); });
App::post('/v1/users/import/md5') App::post('/v1/users/md5')
->desc('Create User with MD5 Password') ->desc('Create User with MD5 Password')
->groups(['api', 'users']) ->groups(['api', 'users'])
->label('event', 'users.[userId].create') ->label('event', 'users.[userId].create')
@ -154,7 +154,7 @@ App::post('/v1/users/import/md5')
$response->dynamic($user, Response::MODEL_USER); $response->dynamic($user, Response::MODEL_USER);
}); });
App::post('/v1/users/import/argon2') App::post('/v1/users/argon2')
->desc('Create User with Argon2 Password') ->desc('Create User with Argon2 Password')
->groups(['api', 'users']) ->groups(['api', 'users'])
->label('event', 'users.[userId].create') ->label('event', 'users.[userId].create')
@ -181,7 +181,7 @@ App::post('/v1/users/import/argon2')
$response->dynamic($user, Response::MODEL_USER); $response->dynamic($user, Response::MODEL_USER);
}); });
App::post('/v1/users/import/sha') App::post('/v1/users/sha')
->desc('Create User with SHA Password') ->desc('Create User with SHA Password')
->groups(['api', 'users']) ->groups(['api', 'users'])
->label('event', 'users.[userId].create') ->label('event', 'users.[userId].create')
@ -215,7 +215,7 @@ App::post('/v1/users/import/sha')
$response->dynamic($user, Response::MODEL_USER); $response->dynamic($user, Response::MODEL_USER);
}); });
App::post('/v1/users/import/phpass') App::post('/v1/users/phpass')
->desc('Create User with PHPass Password') ->desc('Create User with PHPass Password')
->groups(['api', 'users']) ->groups(['api', 'users'])
->label('event', 'users.[userId].create') ->label('event', 'users.[userId].create')
@ -242,7 +242,7 @@ App::post('/v1/users/import/phpass')
$response->dynamic($user, Response::MODEL_USER); $response->dynamic($user, Response::MODEL_USER);
}); });
App::post('/v1/users/import/scrypt') App::post('/v1/users/scrypt')
->desc('Create User with Scrypt Password') ->desc('Create User with Scrypt Password')
->groups(['api', 'users']) ->groups(['api', 'users'])
->label('event', 'users.[userId].create') ->label('event', 'users.[userId].create')
@ -282,7 +282,7 @@ App::post('/v1/users/import/scrypt')
$response->dynamic($user, Response::MODEL_USER); $response->dynamic($user, Response::MODEL_USER);
}); });
App::post('/v1/users/import/scrypt-modified') App::post('/v1/users/scrypt-modified')
->desc('Create User with Scrypt Modified Password') ->desc('Create User with Scrypt Modified Password')
->groups(['api', 'users']) ->groups(['api', 'users'])
->label('event', 'users.[userId].create') ->label('event', 'users.[userId].create')

View file

@ -58,7 +58,7 @@ trait UsersBase
/** /**
* Test Create with hashed passwords * Test Create with hashed passwords
*/ */
$res = $this->client->call(Client::METHOD_POST, '/users/import/md5', array_merge([ $res = $this->client->call(Client::METHOD_POST, '/users/md5', array_merge([
'content-type' => 'application/json', 'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()), [ ], $this->getHeaders()), [
@ -68,7 +68,7 @@ trait UsersBase
'name' => 'MD5 User', 'name' => 'MD5 User',
]); ]);
$res = $this->client->call(Client::METHOD_POST, '/users/import/bcrypt', array_merge([ $res = $this->client->call(Client::METHOD_POST, '/users/bcrypt', array_merge([
'content-type' => 'application/json', 'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()), [ ], $this->getHeaders()), [
@ -82,7 +82,7 @@ trait UsersBase
$this->assertEquals($res['body']['password'], '$2a$15$xX/myGbFU.ZSKHSi6EHdBOySTdYm8QxBLXmOPHrYMwV0mHRBBSBOq'); $this->assertEquals($res['body']['password'], '$2a$15$xX/myGbFU.ZSKHSi6EHdBOySTdYm8QxBLXmOPHrYMwV0mHRBBSBOq');
$this->assertEquals($res['body']['hash'], 'bcrypt'); $this->assertEquals($res['body']['hash'], 'bcrypt');
$res = $this->client->call(Client::METHOD_POST, '/users/import/argon2', array_merge([ $res = $this->client->call(Client::METHOD_POST, '/users/argon2', array_merge([
'content-type' => 'application/json', 'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()), [ ], $this->getHeaders()), [
@ -96,7 +96,7 @@ trait UsersBase
$this->assertEquals($res['body']['password'], '$argon2i$v=19$m=20,t=3,p=2$YXBwd3JpdGU$A/54i238ed09ZR4NwlACU5XnkjNBZU9QeOEuhjLiexI'); $this->assertEquals($res['body']['password'], '$argon2i$v=19$m=20,t=3,p=2$YXBwd3JpdGU$A/54i238ed09ZR4NwlACU5XnkjNBZU9QeOEuhjLiexI');
$this->assertEquals($res['body']['hash'], 'argon2'); $this->assertEquals($res['body']['hash'], 'argon2');
$res = $this->client->call(Client::METHOD_POST, '/users/import/sha', array_merge([ $res = $this->client->call(Client::METHOD_POST, '/users/sha', array_merge([
'content-type' => 'application/json', 'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()), [ ], $this->getHeaders()), [
@ -112,7 +112,7 @@ trait UsersBase
$this->assertEquals($res['body']['hash'], 'sha'); $this->assertEquals($res['body']['hash'], 'sha');
$this->assertEquals($res['body']['hashOptions']['version'], 'sha512'); $this->assertEquals($res['body']['hashOptions']['version'], 'sha512');
$res = $this->client->call(Client::METHOD_POST, '/users/import/scrypt', array_merge([ $res = $this->client->call(Client::METHOD_POST, '/users/scrypt', array_merge([
'content-type' => 'application/json', 'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()), [ ], $this->getHeaders()), [
@ -136,7 +136,7 @@ trait UsersBase
$this->assertEquals($res['body']['hashOptions']['costParallel'], 2); $this->assertEquals($res['body']['hashOptions']['costParallel'], 2);
$this->assertEquals($res['body']['hashOptions']['length'], 64); $this->assertEquals($res['body']['hashOptions']['length'], 64);
$res = $this->client->call(Client::METHOD_POST, '/users/import/phpass', array_merge([ $res = $this->client->call(Client::METHOD_POST, '/users/phpass', array_merge([
'content-type' => 'application/json', 'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()), [ ], $this->getHeaders()), [
@ -149,7 +149,7 @@ trait UsersBase
$this->assertEquals($res['headers']['status-code'], 201); $this->assertEquals($res['headers']['status-code'], 201);
$this->assertEquals($res['body']['password'], '$P$Br387rwferoKN7uwHZqNMu98q3U8RO.'); $this->assertEquals($res['body']['password'], '$P$Br387rwferoKN7uwHZqNMu98q3U8RO.');
$res = $this->client->call(Client::METHOD_POST, '/users/import/scrypt-modified', array_merge([ $res = $this->client->call(Client::METHOD_POST, '/users/scrypt-modified', array_merge([
'content-type' => 'application/json', 'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'], 'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()), [ ], $this->getHeaders()), [