change DatetimeValidator
This commit is contained in:
parent
45ac40cc85
commit
9a8ef2a30d
1 changed files with 3 additions and 4 deletions
|
@ -20,7 +20,7 @@ use Utopia\Database\Document;
|
||||||
use Utopia\Database\DateTime;
|
use Utopia\Database\DateTime;
|
||||||
use Utopia\Database\Query;
|
use Utopia\Database\Query;
|
||||||
use Utopia\Database\Validator\Authorization;
|
use Utopia\Database\Validator\Authorization;
|
||||||
use Utopia\Database\Validator\DatetimeValidation;
|
use Utopia\Database\Validator\DatetimeValidator;
|
||||||
use Utopia\Database\Validator\UID;
|
use Utopia\Database\Validator\UID;
|
||||||
use Utopia\Domains\Domain;
|
use Utopia\Domains\Domain;
|
||||||
use Utopia\Registry\Registry;
|
use Utopia\Registry\Registry;
|
||||||
|
@ -28,7 +28,6 @@ use Appwrite\Extend\Exception;
|
||||||
use Utopia\Validator\ArrayList;
|
use Utopia\Validator\ArrayList;
|
||||||
use Utopia\Validator\Boolean;
|
use Utopia\Validator\Boolean;
|
||||||
use Utopia\Validator\Hostname;
|
use Utopia\Validator\Hostname;
|
||||||
use Utopia\Validator\Integer;
|
|
||||||
use Utopia\Validator\Range;
|
use Utopia\Validator\Range;
|
||||||
use Utopia\Validator\Text;
|
use Utopia\Validator\Text;
|
||||||
use Utopia\Validator\WhiteList;
|
use Utopia\Validator\WhiteList;
|
||||||
|
@ -821,7 +820,7 @@ App::post('/v1/projects/:projectId/keys')
|
||||||
->param('projectId', null, new UID(), 'Project unique ID.')
|
->param('projectId', null, new UID(), 'Project unique ID.')
|
||||||
->param('name', null, new Text(128), 'Key name. Max length: 128 chars.')
|
->param('name', null, new Text(128), 'Key name. Max length: 128 chars.')
|
||||||
->param('scopes', null, new ArrayList(new WhiteList(array_keys(Config::getParam('scopes')), true), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Key scopes list. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' scopes are allowed.')
|
->param('scopes', null, new ArrayList(new WhiteList(array_keys(Config::getParam('scopes')), true), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Key scopes list. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' scopes are allowed.')
|
||||||
->param('expire', null, new DateTimeValidation(), 'Expiration time in DateTime. Use null for unlimited expiration.', true)
|
->param('expire', null, new DatetimeValidator(), 'Expiration time in DateTime. Use null for unlimited expiration.', true)
|
||||||
->inject('response')
|
->inject('response')
|
||||||
->inject('dbForConsole')
|
->inject('dbForConsole')
|
||||||
->action(function (string $projectId, string $name, array $scopes, ?string $expire, Response $response, Database $dbForConsole) {
|
->action(function (string $projectId, string $name, array $scopes, ?string $expire, Response $response, Database $dbForConsole) {
|
||||||
|
@ -931,7 +930,7 @@ App::put('/v1/projects/:projectId/keys/:keyId')
|
||||||
->param('keyId', null, new UID(), 'Key unique ID.')
|
->param('keyId', null, new UID(), 'Key unique ID.')
|
||||||
->param('name', null, new Text(128), 'Key name. Max length: 128 chars.')
|
->param('name', null, new Text(128), 'Key name. Max length: 128 chars.')
|
||||||
->param('scopes', null, new ArrayList(new WhiteList(array_keys(Config::getParam('scopes')), true), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Key scopes list. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' events are allowed.')
|
->param('scopes', null, new ArrayList(new WhiteList(array_keys(Config::getParam('scopes')), true), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Key scopes list. Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' events are allowed.')
|
||||||
->param('expire', null, new DatetimeValidation(), 'Expiration time in DateTime. Use null for unlimited expiration.', true)
|
->param('expire', null, new DatetimeValidator(), 'Expiration time in DateTime. Use null for unlimited expiration.', true)
|
||||||
->inject('response')
|
->inject('response')
|
||||||
->inject('dbForConsole')
|
->inject('dbForConsole')
|
||||||
->action(function (string $projectId, string $keyId, string $name, array $scopes, ?string $expire, Response $response, Database $dbForConsole) {
|
->action(function (string $projectId, string $keyId, string $name, array $scopes, ?string $expire, Response $response, Database $dbForConsole) {
|
||||||
|
|
Loading…
Reference in a new issue